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
@@ -4,6 +4,8 @@
|
|
4
4
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
|
+
|
8
|
+
|
7
9
|
/** @class
|
8
10
|
|
9
11
|
A RadioView is used to create a group of radio buttons. The user can use
|
@@ -15,36 +17,36 @@
|
|
15
17
|
The radio buttons themselves are designed to be styled using CSS classes with
|
16
18
|
the following structure:
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
<label class="sc-radio-button">
|
21
|
+
<img class="button" src="some_image.gif"/>
|
22
|
+
<input type="radio" name="<sc-guid>" value=""/>
|
23
|
+
<span class="sc-button-label">Label for button1</span>
|
24
|
+
</label>
|
23
25
|
|
24
26
|
Setting up a RadioView accepts a number of properties, for example:
|
25
|
-
{
|
26
|
-
items: [{ title: "Red",
|
27
|
-
value: "red",
|
28
|
-
enabled: YES,
|
29
|
-
icon: "button_red" },
|
30
|
-
{ title: "Green",
|
31
|
-
value: "green",
|
32
|
-
enabled: YES,
|
33
|
-
icon: 'button_green' }],
|
34
|
-
value: 'red',
|
35
|
-
itemTitleKey: 'title',
|
36
|
-
itemValueKey: 'value',
|
37
|
-
itemIconKey: 'icon',
|
38
|
-
itemIsEnabledKey: 'enabled',
|
39
|
-
isEnabled: YES,
|
40
|
-
layoutDirection: SC.LAYOUT_HORIZONTAL
|
41
|
-
}
|
42
|
-
|
43
|
-
Default layoutDirection is vertical.
|
44
|
-
Default isEnabled is YES.
|
45
27
|
|
46
|
-
|
47
|
-
|
28
|
+
radio: SC.RadioView.design({
|
29
|
+
items: [
|
30
|
+
{
|
31
|
+
title: "Red",
|
32
|
+
value: "red",
|
33
|
+
enabled: YES,
|
34
|
+
icon: "button_red"
|
35
|
+
},{
|
36
|
+
title: "Green",
|
37
|
+
value: "green",
|
38
|
+
enabled: YES,
|
39
|
+
icon: 'button_green'
|
40
|
+
}
|
41
|
+
],
|
42
|
+
value: 'red',
|
43
|
+
itemTitleKey: 'title',
|
44
|
+
itemValueKey: 'value',
|
45
|
+
itemIconKey: 'icon',
|
46
|
+
itemIsEnabledKey: 'enabled',
|
47
|
+
isEnabled: YES,
|
48
|
+
layoutDirection: SC.LAYOUT_HORIZONTAL
|
49
|
+
})
|
48
50
|
|
49
51
|
The items array can contain either strings, or as in the example above a
|
50
52
|
hash. When using a hash, make sure to also specify the itemTitleKey
|
@@ -52,33 +54,67 @@
|
|
52
54
|
itemIconKey if you are using icons radio buttons. The individual items
|
53
55
|
enabled property is YES by default, and the icon is optional.
|
54
56
|
|
55
|
-
@extends SC.
|
57
|
+
@extends SC.View
|
58
|
+
@extends SC.Control
|
56
59
|
@since SproutCore 1.0
|
57
60
|
*/
|
58
61
|
SC.RadioView = SC.View.extend(SC.Control,
|
59
|
-
/** @scope SC.RadioView.prototype */
|
60
|
-
|
62
|
+
/** @scope SC.RadioView.prototype */{
|
63
|
+
|
64
|
+
/**
|
65
|
+
@field
|
66
|
+
@type Boolean
|
67
|
+
@default YES
|
68
|
+
@observes isEnabled
|
69
|
+
*/
|
70
|
+
acceptsFirstResponder: function() {
|
71
|
+
if(!SC.SAFARI_FOCUS_BEHAVIOR) return this.get('isEnabled');
|
72
|
+
else return NO;
|
73
|
+
}.property('isEnabled'),
|
61
74
|
|
62
|
-
|
75
|
+
/**
|
76
|
+
@type Array
|
77
|
+
@default ['sc-radio-view']
|
78
|
+
@see SC.View#classNames
|
79
|
+
*/
|
63
80
|
classNames: ['sc-radio-view'],
|
64
81
|
|
65
82
|
/**
|
66
|
-
The WAI-ARIA role for a group of radio buttons.
|
67
|
-
should not be changed.
|
83
|
+
The WAI-ARIA role for a group of radio buttons.
|
68
84
|
|
69
|
-
@
|
85
|
+
@type String
|
86
|
+
@default 'radiogroup'
|
87
|
+
@readOnly
|
70
88
|
*/
|
71
89
|
ariaRole: 'radiogroup',
|
72
90
|
|
91
|
+
/**
|
92
|
+
@type Array
|
93
|
+
@default ['displayItems', 'isEnabled', 'layoutDirection']
|
94
|
+
@see SC.View#displayProperties
|
95
|
+
*/
|
96
|
+
displayProperties: ['displayItems', 'isEnabled', 'layoutDirection'],
|
97
|
+
|
98
|
+
/**
|
99
|
+
@type String
|
100
|
+
@default 'radioGroupRenderDelegate'
|
101
|
+
*/
|
102
|
+
renderDelegateName: 'radioGroupRenderDelegate',
|
103
|
+
|
104
|
+
// ..........................................................
|
105
|
+
// Properties
|
106
|
+
//
|
107
|
+
|
73
108
|
/**
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
@
|
109
|
+
If items property is a hash, specify which property will function as
|
110
|
+
the ariaLabeledBy with this itemAriaLabeledByKey property.ariaLabeledBy is used
|
111
|
+
as the WAI-ARIA attribute for the radio view. This property is assigned to
|
112
|
+
'aria-labelledby' attribute, which defines a string value that labels the
|
113
|
+
element. Used to support voiceover. It should be assigned a non-empty string,
|
114
|
+
if the 'aria-labelledby' attribute has to be set for the element.
|
115
|
+
|
116
|
+
@type String
|
117
|
+
@default null
|
82
118
|
*/
|
83
119
|
itemAriaLabeledByKey: null,
|
84
120
|
|
@@ -90,7 +126,8 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
90
126
|
element. Used to support voiceover. It should be assigned a non-empty string,
|
91
127
|
if the 'aria-label' attribute has to be set for the element.
|
92
128
|
|
93
|
-
@
|
129
|
+
@type String
|
130
|
+
@default null
|
94
131
|
*/
|
95
132
|
itemAriaLabelKey: null,
|
96
133
|
|
@@ -98,27 +135,45 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
98
135
|
The value of the currently selected item, and which will be checked in the
|
99
136
|
UI. This can be either a string or an array with strings for checking
|
100
137
|
multiple values.
|
138
|
+
|
139
|
+
@type Object|String
|
140
|
+
@default null
|
101
141
|
*/
|
102
142
|
value: null,
|
103
143
|
|
104
144
|
/**
|
105
|
-
This property indicates how the radio buttons are arranged.
|
145
|
+
This property indicates how the radio buttons are arranged. Possible values:
|
146
|
+
|
147
|
+
- SC.LAYOUT_VERTICAL
|
148
|
+
- SC.LAYOUT_HORIZONTAL
|
149
|
+
|
150
|
+
@type String
|
151
|
+
@default SC.LAYOUT_VERTICAL
|
106
152
|
*/
|
107
153
|
layoutDirection: SC.LAYOUT_VERTICAL,
|
108
154
|
|
109
|
-
|
155
|
+
/**
|
156
|
+
@type Boolean
|
157
|
+
@default YES
|
158
|
+
*/
|
110
159
|
escapeHTML: YES,
|
111
160
|
|
112
161
|
/**
|
113
162
|
The items property can be either an array with strings, or a
|
114
163
|
hash. When using a hash, make sure to also specify the appropriate
|
115
164
|
itemTitleKey, itemValueKey, itemIsEnabledKey and itemIconKey.
|
165
|
+
|
166
|
+
@type Array
|
167
|
+
@default []
|
116
168
|
*/
|
117
169
|
items: [],
|
118
170
|
|
119
171
|
/**
|
120
172
|
If items property is a hash, specify which property will function as
|
121
173
|
the title with this itemTitleKey property.
|
174
|
+
|
175
|
+
@type String
|
176
|
+
@default null
|
122
177
|
*/
|
123
178
|
itemTitleKey: null,
|
124
179
|
|
@@ -128,7 +183,7 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
128
183
|
layoutDirection is set to SC.LAYOUT_HORIONZTAL and can be used to override
|
129
184
|
the default value provided by the framework or theme CSS.
|
130
185
|
|
131
|
-
@
|
186
|
+
@type String
|
132
187
|
@default null
|
133
188
|
*/
|
134
189
|
itemWidthKey: null,
|
@@ -136,22 +191,31 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
136
191
|
/**
|
137
192
|
If items property is a hash, specify which property will function as
|
138
193
|
the value with this itemValueKey property.
|
194
|
+
|
195
|
+
@type String
|
196
|
+
@default null
|
139
197
|
*/
|
140
198
|
itemValueKey: null,
|
141
199
|
|
142
200
|
/**
|
143
201
|
If items property is a hash, specify which property will function as
|
144
202
|
the value with this itemIsEnabledKey property.
|
203
|
+
|
204
|
+
@type String
|
205
|
+
@default null
|
145
206
|
*/
|
146
207
|
itemIsEnabledKey: null,
|
147
208
|
|
148
209
|
/**
|
149
210
|
If items property is a hash, specify which property will function as
|
150
211
|
the value with this itemIconKey property.
|
212
|
+
|
213
|
+
@type String
|
214
|
+
@default null
|
151
215
|
*/
|
152
216
|
itemIconKey: null,
|
153
217
|
|
154
|
-
/**
|
218
|
+
/** @private
|
155
219
|
If the items array itself changes, add/remove observer on item...
|
156
220
|
*/
|
157
221
|
itemsDidChange: function() {
|
@@ -165,7 +229,7 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
165
229
|
this.itemContentDidChange();
|
166
230
|
}.observes('items'),
|
167
231
|
|
168
|
-
/**
|
232
|
+
/** @private
|
169
233
|
Invoked whenever the item array or an item in the array is changed.
|
170
234
|
This method will regenerate the list of items.
|
171
235
|
*/
|
@@ -179,11 +243,6 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
179
243
|
// ..........................................................
|
180
244
|
// PRIVATE SUPPORT
|
181
245
|
//
|
182
|
-
/**
|
183
|
-
The display properties for radio buttons are the value and _displayItems.
|
184
|
-
*/
|
185
|
-
displayProperties: ['displayItems', 'isEnabled', 'layoutDirection'],
|
186
|
-
renderDelegateName: 'radioGroupRenderDelegate',
|
187
246
|
|
188
247
|
/** @private
|
189
248
|
Data Sources for radioRenderDelegates, as required by radioGroupRenderDelegate.
|
@@ -280,13 +339,7 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
280
339
|
return ret; // done!
|
281
340
|
}.property('isEnabled', 'value', 'items', 'itemTitleKey', 'itemWidthKey', 'itemValueKey', 'itemIsEnabledKey', 'localize', 'itemIconKey','itemAriaLabeledByKey', 'itemAriaLabelKey').cacheable(),
|
282
341
|
|
283
|
-
|
284
|
-
acceptsFirstResponder: function() {
|
285
|
-
if(!SC.SAFARI_FOCUS_BEHAVIOR) return this.get('isEnabled');
|
286
|
-
else return NO;
|
287
|
-
}.property('isEnabled'),
|
288
|
-
|
289
|
-
/**
|
342
|
+
/** @private
|
290
343
|
If the user clicks on of the items mark it as active on mouseDown unless
|
291
344
|
is disabled.
|
292
345
|
|
@@ -312,7 +365,7 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
312
365
|
return YES;
|
313
366
|
},
|
314
367
|
|
315
|
-
/**
|
368
|
+
/** @private
|
316
369
|
If we have a radio element that was clicked on previously, make sure we
|
317
370
|
remove the active state. Then update the value if the item clicked is
|
318
371
|
enabled.
|
@@ -338,11 +391,14 @@ SC.RadioView = SC.View.extend(SC.Control,
|
|
338
391
|
}
|
339
392
|
},
|
340
393
|
|
394
|
+
/** @private */
|
341
395
|
touchStart: function(evt) {
|
342
396
|
return this.mouseDown(evt);
|
343
397
|
},
|
344
398
|
|
399
|
+
/** @private */
|
345
400
|
touchEnd: function(evt) {
|
346
401
|
return this.mouseUp(evt);
|
347
402
|
}
|
403
|
+
|
348
404
|
});
|
@@ -13,7 +13,7 @@
|
|
13
13
|
optionally choose the kind of animation used to transition the two scenes
|
14
14
|
as well if supported on the web browser.
|
15
15
|
|
16
|
-
|
16
|
+
# Using SC.SceneView
|
17
17
|
|
18
18
|
To setup the scene view, you should define the 'scenes' property with an
|
19
19
|
array of scene names. These will be the properties on the scene view that
|
@@ -26,11 +26,11 @@
|
|
26
26
|
is visible on screen. Otherwise, it will simply make the new scene view
|
27
27
|
the current content view and that's it.
|
28
28
|
|
29
|
-
@extends SC.
|
29
|
+
@extends SC.ContainerView
|
30
30
|
@since SproutCore 1.0
|
31
31
|
*/
|
32
32
|
SC.SceneView = SC.ContainerView.extend(
|
33
|
-
|
33
|
+
/** @scope SC.SceneView.prototype */ {
|
34
34
|
|
35
35
|
/**
|
36
36
|
Array of scene names. Scenes will slide on and off screen in the order
|
@@ -38,10 +38,8 @@ SC.SceneView = SC.ContainerView.extend(
|
|
38
38
|
2 to a scene at index 1, the scenes will animation backwards. If you
|
39
39
|
shift to a scene at index 3, the scenes will animate forwards.
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
@property {Array}
|
41
|
+
@type Array
|
42
|
+
@default ['master', 'detail']
|
45
43
|
*/
|
46
44
|
scenes: ['master', 'detail'],
|
47
45
|
|
@@ -50,21 +48,26 @@ SC.SceneView = SC.ContainerView.extend(
|
|
50
48
|
scene view to transition to the new scene. If you set this property to
|
51
49
|
null, an empty string, or a non-existant scene, then the scene will appear
|
52
50
|
empty.
|
51
|
+
|
52
|
+
@type String
|
53
|
+
@default null
|
53
54
|
*/
|
54
55
|
nowShowing: null,
|
55
56
|
|
56
57
|
/**
|
57
58
|
Speed of transition. Should be expressed in msec.
|
59
|
+
|
60
|
+
@type Number
|
61
|
+
@default 200
|
58
62
|
*/
|
59
63
|
transitionDuration: 200,
|
60
64
|
|
65
|
+
/** @private */
|
61
66
|
_state: 'NO_VIEW', // no view
|
62
67
|
|
63
68
|
/** @private
|
64
|
-
|
65
69
|
Whenever called to change the content, save the nowShowing state and
|
66
70
|
then animate in by adjusting the layout.
|
67
|
-
|
68
71
|
*/
|
69
72
|
replaceContent: function(content) {
|
70
73
|
if (content && this._state===this.READY) this.animateScene(content);
|
@@ -73,7 +76,6 @@ SC.SceneView = SC.ContainerView.extend(
|
|
73
76
|
},
|
74
77
|
|
75
78
|
/** @private
|
76
|
-
|
77
79
|
Invoked whenever we just need to swap the scenes without playing an
|
78
80
|
animation.
|
79
81
|
*/
|
@@ -102,7 +104,6 @@ SC.SceneView = SC.ContainerView.extend(
|
|
102
104
|
},
|
103
105
|
|
104
106
|
/** @private
|
105
|
-
|
106
107
|
Invoked whenever we need to animate in the new scene.
|
107
108
|
*/
|
108
109
|
animateScene: function(newContent) {
|
@@ -143,7 +144,8 @@ SC.SceneView = SC.ContainerView.extend(
|
|
143
144
|
this.tick();
|
144
145
|
},
|
145
146
|
|
146
|
-
/** @private
|
147
|
+
/** @private
|
148
|
+
Called while the animation runs. Compute the new layout for
|
147
149
|
the left and right views based on the portion completed. When we finish
|
148
150
|
call replaceScene().
|
149
151
|
*/
|
@@ -192,13 +194,18 @@ SC.SceneView = SC.ContainerView.extend(
|
|
192
194
|
},
|
193
195
|
|
194
196
|
|
195
|
-
|
197
|
+
/** @private */
|
196
198
|
NO_VIEW: 'NO_VIEW',
|
199
|
+
|
200
|
+
/** @private */
|
197
201
|
ANIMATING: 'ANIMATING',
|
202
|
+
|
203
|
+
/** @private */
|
198
204
|
READY: 'READY',
|
199
205
|
|
200
|
-
/** @private
|
206
|
+
/** @private
|
207
|
+
Standard layout assigned to views at rest
|
208
|
+
*/
|
201
209
|
STANDARD_LAYOUT: { top: 0, left: 0, bottom: 0, right: 0 }
|
202
|
-
|
203
|
-
|
210
|
+
|
204
211
|
});
|