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
@@ -15,34 +15,25 @@
|
|
15
15
|
|
16
16
|
By default the Date Field View show Date only, but if you need to show the Time do:
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}),
|
23
|
-
}}}
|
18
|
+
dateAndTime: Shared.DateFieldView.design({
|
19
|
+
showTime: YES,
|
20
|
+
valueBinding: '...'
|
21
|
+
}),
|
24
22
|
|
25
|
-
and if you only need to show time:
|
23
|
+
and if you only need to show time:
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
})
|
33
|
-
}}}
|
34
|
-
|
35
|
-
The default format are:
|
36
|
-
- formatTime: '%I:%M %p',
|
37
|
-
- formatDate: '%d/%m/%Y',
|
38
|
-
- formatDateTime: '%d/%m/%Y %I:%M %p',
|
25
|
+
timeOnly: Shared.DateFieldView.design({
|
26
|
+
showTime: YES,
|
27
|
+
showDate: NO,
|
28
|
+
valueBinding: '...'
|
29
|
+
})
|
39
30
|
|
40
31
|
Example usage with special format:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
32
|
+
|
33
|
+
specialDate: Shared.DateFieldView.design({
|
34
|
+
formatDate: '%d %b of %Y',
|
35
|
+
valueBinding: '...'
|
36
|
+
}),
|
46
37
|
|
47
38
|
You can override these format as you like, but has some limitations,
|
48
39
|
actually only support these KEY from SC.DateTime:
|
@@ -56,29 +47,57 @@
|
|
56
47
|
@author Juan Pablo Goldfinger
|
57
48
|
*/
|
58
49
|
SC.DateFieldView = SC.TextFieldView.extend(
|
59
|
-
/** @scope SC.DateFieldView.prototype */
|
60
|
-
{
|
50
|
+
/** @scope SC.DateFieldView.prototype */ {
|
61
51
|
|
52
|
+
/**
|
53
|
+
@type String
|
54
|
+
@default null
|
55
|
+
*/
|
62
56
|
value: null,
|
63
57
|
|
64
|
-
|
58
|
+
/**
|
59
|
+
@type Boolean
|
60
|
+
@default YES
|
61
|
+
*/
|
65
62
|
showDate: YES,
|
63
|
+
|
64
|
+
/**
|
65
|
+
@type Boolean
|
66
|
+
@default NO
|
67
|
+
*/
|
66
68
|
showTime: NO,
|
67
69
|
|
68
|
-
|
70
|
+
/**
|
71
|
+
@type String
|
72
|
+
@default '%I:%M %p'
|
73
|
+
*/
|
69
74
|
formatTime: '%I:%M %p',
|
75
|
+
|
76
|
+
/**
|
77
|
+
@type String
|
78
|
+
@default '%d/%m/%Y'
|
79
|
+
*/
|
70
80
|
formatDate: '%d/%m/%Y',
|
81
|
+
|
82
|
+
/**
|
83
|
+
@type String
|
84
|
+
@default '%d/%m/%Y %I:%M %p'
|
85
|
+
*/
|
71
86
|
formatDateTime: '%d/%m/%Y %I:%M %p',
|
72
87
|
|
73
88
|
// DateTime constants (with fixed width, like numbers or abbs with fixed length)
|
74
89
|
// original: '%a %A %b %B %c %d %h %H %i %I %j %m %M %p %S %U %W %x %X %y %Y %Z %%'.w(),
|
75
90
|
// NOTE: I think that %a and %b areb't useful because is more adecuato to represente day
|
76
91
|
// with 1..31 without zeros at start, but causes the lenght not to be fixed)
|
92
|
+
|
93
|
+
/** @private*/
|
77
94
|
_dtConstants: '%a %b %d %H %I %j %m %M %p %S %U %W %y %Y'.w(),
|
78
95
|
// Width constants for each representation %@.
|
96
|
+
|
97
|
+
/** @private */
|
79
98
|
_wtConstants: [3,3,2,2,2,3,2,2,2,2,2,2,2,4],
|
80
99
|
|
81
|
-
|
100
|
+
/** @private */
|
82
101
|
activeSelection: 0,
|
83
102
|
|
84
103
|
/*
|
@@ -100,8 +119,10 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
100
119
|
/**
|
101
120
|
The current format to apply for Validator and to show.
|
102
121
|
|
103
|
-
@
|
104
|
-
@type
|
122
|
+
@field
|
123
|
+
@type String
|
124
|
+
@observes showTime
|
125
|
+
@observes showDate
|
105
126
|
*/
|
106
127
|
format: function() {
|
107
128
|
var st = this.get('showTime');
|
@@ -114,8 +135,9 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
114
135
|
/**
|
115
136
|
The current validator to format the Date to the input field and viceversa.
|
116
137
|
|
117
|
-
@
|
118
|
-
@type
|
138
|
+
@field
|
139
|
+
@type SC.Validator.DateTime
|
140
|
+
@observes format
|
119
141
|
*/
|
120
142
|
validator: function() {
|
121
143
|
return SC.Validator.DateTime.extend({ format: this.get('format') });
|
@@ -124,8 +146,8 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
124
146
|
/**
|
125
147
|
Array of Key/TextSelection found for the current format.
|
126
148
|
|
127
|
-
@
|
128
|
-
@type
|
149
|
+
@field
|
150
|
+
@type SC.Array
|
129
151
|
*/
|
130
152
|
tabsSelections: function() {
|
131
153
|
var arr = [];
|
@@ -164,7 +186,6 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
164
186
|
|
165
187
|
/** @private
|
166
188
|
If the activeSelection changes or the value changes, update the "TextSelection" to show accordingly.
|
167
|
-
|
168
189
|
*/
|
169
190
|
updateTextSelecitonObserver: function() {
|
170
191
|
var as = this.get('activeSelection');
|
@@ -176,7 +197,6 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
176
197
|
|
177
198
|
/** @private
|
178
199
|
Updates the value according the key.
|
179
|
-
|
180
200
|
*/
|
181
201
|
updateValue: function(key, upOrDown) {
|
182
202
|
// 0 is DOWN - 1 is UP
|
@@ -207,19 +227,12 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
207
227
|
}*/
|
208
228
|
},
|
209
229
|
|
210
|
-
/*_textField_fieldDidFocus: function(evt) {
|
211
|
-
SC.RunLoop.begin();
|
212
|
-
//console.log(evt);
|
213
|
-
//console.log(event);
|
214
|
-
//console.log(evt.originalEvent);
|
215
|
-
this.fieldDidFocus();
|
216
|
-
SC.RunLoop.end();
|
217
|
-
},*/
|
218
230
|
|
219
|
-
|
220
|
-
//
|
221
|
-
|
231
|
+
// ..........................................................
|
232
|
+
// Key Event Support
|
233
|
+
//
|
222
234
|
|
235
|
+
/** @private */
|
223
236
|
keyDown: function(evt) {
|
224
237
|
if (this.interpretKeyEvents(evt)) {
|
225
238
|
evt.stop();
|
@@ -228,10 +241,12 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
228
241
|
return sc_super();
|
229
242
|
},
|
230
243
|
|
244
|
+
/** @private */
|
231
245
|
ctrl_a: function() {
|
232
246
|
return YES;
|
233
247
|
},
|
234
248
|
|
249
|
+
/** @private */
|
235
250
|
moveUp: function(evt) {
|
236
251
|
var as = this.get('activeSelection');
|
237
252
|
var ts = this.get('tabsSelections');
|
@@ -239,6 +254,7 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
239
254
|
return YES;
|
240
255
|
},
|
241
256
|
|
257
|
+
/** @private */
|
242
258
|
moveDown: function(evt) {
|
243
259
|
var as = this.get('activeSelection');
|
244
260
|
var ts = this.get('tabsSelections');
|
@@ -246,10 +262,12 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
246
262
|
return YES;
|
247
263
|
},
|
248
264
|
|
265
|
+
/** @private */
|
249
266
|
insertText: function(evt) {
|
250
267
|
return YES;
|
251
268
|
},
|
252
269
|
|
270
|
+
/** @private */
|
253
271
|
moveRight: function(evt) {
|
254
272
|
var ts = this.get('tabsSelections');
|
255
273
|
var ns = this.get('activeSelection') + 1;
|
@@ -260,6 +278,7 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
260
278
|
return YES;
|
261
279
|
},
|
262
280
|
|
281
|
+
/** @private */
|
263
282
|
moveLeft: function(evt) {
|
264
283
|
var ts = this.get('tabsSelections');
|
265
284
|
var ns = this.get('activeSelection') - 1;
|
@@ -270,6 +289,7 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
270
289
|
return YES;
|
271
290
|
},
|
272
291
|
|
292
|
+
/** @private */
|
273
293
|
insertTab: function(evt) {
|
274
294
|
var ts = this.get('tabsSelections');
|
275
295
|
var ns = this.get('activeSelection') + 1;
|
@@ -280,15 +300,17 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
280
300
|
return NO;
|
281
301
|
},
|
282
302
|
|
303
|
+
/** @private */
|
283
304
|
insertBacktab: function(evt) {
|
284
305
|
var ns = this.get('activeSelection') - 1;
|
285
306
|
if (ns !== -1) {
|
286
307
|
this.set('activeSelection', ns);
|
287
|
-
return YES;
|
308
|
+
return YES;
|
288
309
|
}
|
289
310
|
return NO;
|
290
311
|
},
|
291
312
|
|
313
|
+
/** @private */
|
292
314
|
mouseUp: function(evt) {
|
293
315
|
var ret = sc_super();
|
294
316
|
var cs = this.get('selection');
|
@@ -308,10 +330,12 @@ SC.DateFieldView = SC.TextFieldView.extend(
|
|
308
330
|
return ret;
|
309
331
|
},
|
310
332
|
|
333
|
+
/** @private */
|
311
334
|
deleteBackward: function(evt) {
|
312
335
|
return YES;
|
313
336
|
},
|
314
337
|
|
338
|
+
/** @private */
|
315
339
|
deleteForward: function(evt) {
|
316
340
|
return YES;
|
317
341
|
}
|
@@ -11,50 +11,75 @@
|
|
11
11
|
Disclosure triangle button. As a subclass of SC.ButtonView, this view
|
12
12
|
takes a lot of the same properties as a button:
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
- isEnabled: whether disclosure triangle is clickable or not
|
15
|
+
- value: `YES` or `NO` (where `YES` implies expanded/open)
|
16
|
+
|
17
|
+
A disclosure view also supports expanding and collapsing via
|
18
|
+
the keyboard.
|
16
19
|
|
17
20
|
@extends SC.ButtonView
|
18
|
-
@since SproutCore
|
21
|
+
@since SproutCore 1.0
|
19
22
|
*/
|
20
23
|
SC.DisclosureView = SC.ButtonView.extend(
|
21
24
|
/** @scope SC.DisclosureView.prototype */ {
|
22
25
|
|
26
|
+
/**
|
27
|
+
@type Array
|
28
|
+
@default ['sc-disclosure-view']
|
29
|
+
@see SC.View#classNames
|
30
|
+
*/
|
23
31
|
classNames: ['sc-disclosure-view'],
|
24
32
|
|
33
|
+
/**
|
34
|
+
@type String
|
35
|
+
@default 'disclosureRenderDelegate'
|
36
|
+
*/
|
25
37
|
renderDelegateName: 'disclosureRenderDelegate',
|
26
38
|
|
39
|
+
/**
|
40
|
+
@type String
|
41
|
+
@default SC.TOGGLE_BEHAVIOR
|
42
|
+
@see SC.ButtonView#buttonBehavior
|
43
|
+
*/
|
27
44
|
buttonBehavior: SC.TOGGLE_BEHAVIOR,
|
28
45
|
|
29
46
|
/**
|
30
47
|
This is the value that will be set when the disclosure triangle is toggled
|
31
48
|
open.
|
49
|
+
|
50
|
+
@type Boolean
|
51
|
+
@default YES
|
32
52
|
*/
|
33
53
|
toggleOnValue: YES,
|
34
54
|
|
35
55
|
/**
|
36
56
|
The value that will be set when the disclosure triangle is toggled closed.
|
57
|
+
|
58
|
+
@type Boolean
|
59
|
+
@default YES
|
37
60
|
*/
|
38
61
|
toggleOffValue: NO,
|
39
62
|
|
40
63
|
/** @private */
|
41
|
-
valueBindingDefault: SC.Binding.bool()
|
64
|
+
valueBindingDefault: SC.Binding.bool(),
|
42
65
|
|
43
|
-
/**
|
44
|
-
|
66
|
+
/** @private
|
67
|
+
|
68
|
+
Allows toggling of the value with the right and left arrow keys.
|
45
69
|
Extends the behavior inherted from SC.ButtonView.
|
46
70
|
@param evt
|
47
71
|
*/
|
48
72
|
keyDown: function(evt) {
|
49
|
-
if (evt.which === 37 || evt.which === 38) {
|
73
|
+
if (evt.which === 37 || evt.which === 38) {
|
50
74
|
this.set('value', this.get('toggleOffValue')) ;
|
51
75
|
return YES;
|
52
76
|
}
|
53
|
-
|
77
|
+
|
78
|
+
if (evt.which === 39 || evt.which === 40) {
|
54
79
|
this.set('value', this.get('toggleOnValue')) ;
|
55
80
|
return YES;
|
56
81
|
}
|
57
82
|
sc_super();
|
58
83
|
}
|
59
|
-
|
84
|
+
|
60
85
|
});
|
@@ -4,27 +4,48 @@
|
|
4
4
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
|
+
|
8
|
+
/*
|
9
|
+
TODO revisit this to see if these classnames are usable
|
10
|
+
*/
|
11
|
+
|
7
12
|
/** @class
|
8
13
|
|
9
14
|
Implements a customized file input by creating a standard file input in a
|
10
15
|
transparent iframe over top of a SC.ButtonView.
|
11
16
|
|
12
|
-
// TODO: revisit this to see if these classnames are usable
|
13
17
|
SC.FieldView uses the SC.Control mixin which will apply CSS
|
14
18
|
classnames when the state of the file view changes:
|
19
|
+
|
15
20
|
- active when button is active
|
16
21
|
- sel when button is toggled to a selected state
|
17
22
|
|
18
23
|
@extends SC.FieldView
|
19
|
-
@since SproutCore 1.0
|
24
|
+
@since SproutCore 1.0
|
20
25
|
@author Tyler Keating
|
21
26
|
*/
|
22
27
|
SC.FileView = SC.FieldView.extend(
|
23
|
-
/** @scope SC.FileView.prototype */
|
24
|
-
|
28
|
+
/** @scope SC.FileView.prototype */ {
|
29
|
+
|
30
|
+
/**
|
31
|
+
@type Array
|
32
|
+
@default ['sc-file-view']
|
33
|
+
@see SC.View#classNames
|
34
|
+
*/
|
35
|
+
classNames: ['sc-file-view'],
|
36
|
+
|
37
|
+
/** @private */
|
38
|
+
childViews: ['button', 'form'],
|
25
39
|
|
26
|
-
classNames: 'sc-file-view'.w(),
|
27
40
|
|
41
|
+
// ..........................................................
|
42
|
+
// Properties
|
43
|
+
//
|
44
|
+
|
45
|
+
/**
|
46
|
+
@type Boolean
|
47
|
+
@default YES
|
48
|
+
*/
|
28
49
|
autoSubmit: YES,
|
29
50
|
|
30
51
|
/**
|
@@ -39,12 +60,13 @@ SC.FileView = SC.FieldView.extend(
|
|
39
60
|
here. If you set a target, then the button will try to call the method
|
40
61
|
on the target itself.
|
41
62
|
|
42
|
-
For legacy support, you can also set the action property to a function.
|
63
|
+
For legacy support, you can also set the action property to a function.
|
43
64
|
Doing so will cause the function itself to be called when the button is
|
44
65
|
clicked. It is generally better to use the target/action approach and
|
45
66
|
to implement your code in a controller of some type.
|
46
67
|
|
47
|
-
@
|
68
|
+
@type String
|
69
|
+
@default 'uploadImage'
|
48
70
|
*/
|
49
71
|
action: 'uploadImage',
|
50
72
|
|
@@ -56,20 +78,33 @@ SC.FileView = SC.FieldView.extend(
|
|
56
78
|
null, then the button will search the responder chain for a view that
|
57
79
|
implements the action when the button is pressed instead.
|
58
80
|
|
59
|
-
@
|
81
|
+
@type Object
|
82
|
+
@default null
|
60
83
|
*/
|
61
84
|
target: null,
|
62
85
|
|
63
|
-
|
64
|
-
|
86
|
+
/**
|
87
|
+
@type String
|
88
|
+
@default "Choose File"
|
89
|
+
*/
|
90
|
+
title: "Choose File",
|
91
|
+
|
92
|
+
|
93
|
+
// ..........................................................
|
94
|
+
// Views
|
95
|
+
//
|
96
|
+
|
97
|
+
/** @private */
|
65
98
|
button: SC.ButtonView.design({
|
66
99
|
title: 'Choose File',
|
67
100
|
theme: 'capsule'
|
68
101
|
}),
|
69
102
|
|
103
|
+
/** @private */
|
70
104
|
form: SC.View.design({
|
71
105
|
tagName: 'form',
|
72
106
|
|
107
|
+
/** @private */
|
73
108
|
render: function(context, firstTime) {
|
74
109
|
context.attr('method', 'post').attr('action', "javascript:;").attr('enctype', 'multipart/form-data');
|
75
110
|
sc_super();
|
@@ -80,6 +115,7 @@ SC.FileView = SC.FieldView.extend(
|
|
80
115
|
input: SC.View.design({
|
81
116
|
tagName: 'input',
|
82
117
|
|
118
|
+
/** @private */
|
83
119
|
render: function(context, firstTime) {
|
84
120
|
context.attr('type', 'file').end();
|
85
121
|
sc_super();
|
@@ -87,19 +123,20 @@ SC.FileView = SC.FieldView.extend(
|
|
87
123
|
})
|
88
124
|
}),
|
89
125
|
|
90
|
-
title: 'Choose File',
|
91
126
|
|
92
|
-
|
127
|
+
// ..........................................................
|
128
|
+
// FieldView Overrides
|
129
|
+
//
|
93
130
|
|
94
|
-
/**
|
131
|
+
/** @private
|
95
132
|
Since it is impossible to set the value of file inputs, don't attempt it.
|
96
|
-
|
97
133
|
*/
|
98
134
|
setFieldValue: function(newValue) {
|
99
135
|
SC.Logger.log("SC.FileView: setFieldValue: %@ does nothing".fmt(newValue));
|
100
136
|
//if (newValue) throw SC.$error('SC.FileView can not set the value of the file field');
|
101
137
|
},
|
102
138
|
|
139
|
+
/** @private */
|
103
140
|
fieldValueDidChange: function(partialChange) {
|
104
141
|
sc_super();
|
105
142
|
if (this.get('autoSubmit')) {
|
@@ -4,9 +4,6 @@
|
|
4
4
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
|
-
// ==========================================================================
|
8
|
-
// SC.GridView
|
9
|
-
// ==========================================================================
|
10
7
|
|
11
8
|
require('views/list') ;
|
12
9
|
|
@@ -14,20 +11,34 @@ require('views/list') ;
|
|
14
11
|
|
15
12
|
A grid view renders a collection of items in a grid of rows and columns.
|
16
13
|
|
17
|
-
@extends SC.
|
18
|
-
@author
|
14
|
+
@extends SC.ListView
|
15
|
+
@author Charles Jolley
|
19
16
|
@version 1.0
|
20
17
|
*/
|
21
18
|
SC.GridView = SC.ListView.extend(
|
22
19
|
/** @scope SC.GridView.prototype */ {
|
23
|
-
|
20
|
+
|
21
|
+
/**
|
22
|
+
@type Array
|
23
|
+
@default ['sc-grid-view']
|
24
|
+
@see SC.View#classNames
|
25
|
+
*/
|
26
|
+
classNames: ['sc-grid-view'],
|
24
27
|
|
28
|
+
/**
|
29
|
+
@type Hash
|
30
|
+
@default { left:0, right:0, top:0, bottom:0 }
|
31
|
+
@see SC.View#layout
|
32
|
+
*/
|
25
33
|
layout: { left:0, right:0, top:0, bottom:0 },
|
26
34
|
|
27
35
|
/**
|
28
36
|
The common row height for grid items.
|
29
37
|
|
30
38
|
The value should be an integer expressed in pixels.
|
39
|
+
|
40
|
+
@type Number
|
41
|
+
@default 48
|
31
42
|
*/
|
32
43
|
rowHeight: 48,
|
33
44
|
|
@@ -35,6 +46,9 @@ SC.GridView = SC.ListView.extend(
|
|
35
46
|
The minimum column width for grid items. Items will actually
|
36
47
|
be laid out as needed to completely fill the space, but the minimum
|
37
48
|
width of each item will be this value.
|
49
|
+
|
50
|
+
@type Number
|
51
|
+
@default 64
|
38
52
|
*/
|
39
53
|
columnWidth: 64,
|
40
54
|
|
@@ -42,9 +56,21 @@ SC.GridView = SC.ListView.extend(
|
|
42
56
|
The default example item view will render text-based items.
|
43
57
|
|
44
58
|
You can override this as you wish.
|
59
|
+
|
60
|
+
@type SC.View
|
61
|
+
@default SC.LabelView
|
45
62
|
*/
|
46
63
|
exampleView: SC.LabelView,
|
47
64
|
|
65
|
+
/**
|
66
|
+
Possible values:
|
67
|
+
|
68
|
+
- SC.HORIZONTAL_ORIENTATION
|
69
|
+
- SC.VERTICAL_ORIENTATION
|
70
|
+
|
71
|
+
@type String
|
72
|
+
@default SC.HORIZONTAL_ORIENTATION
|
73
|
+
*/
|
48
74
|
insertionOrientation: SC.HORIZONTAL_ORIENTATION,
|
49
75
|
|
50
76
|
/** @private */
|
@@ -105,15 +131,18 @@ SC.GridView = SC.ListView.extend(
|
|
105
131
|
return ret;
|
106
132
|
},
|
107
133
|
|
134
|
+
/**
|
135
|
+
@type SC.View
|
136
|
+
*/
|
108
137
|
insertionPointClass: SC.View.extend({
|
109
138
|
classNames: ['grid-insertion-point'],
|
110
139
|
|
111
140
|
render: function(context, firstTime) {
|
112
141
|
if (firstTime) context.push('<span class="anchor"></span>') ;
|
113
142
|
}
|
114
|
-
|
115
143
|
}),
|
116
144
|
|
145
|
+
/** @private */
|
117
146
|
showInsertionPoint: function(itemView, dropOperation) {
|
118
147
|
if (!itemView) return ;
|
119
148
|
|
@@ -155,6 +184,7 @@ SC.GridView = SC.ListView.extend(
|
|
155
184
|
|
156
185
|
},
|
157
186
|
|
187
|
+
/** @private */
|
158
188
|
hideInsertionPoint: function() {
|
159
189
|
var insertionPoint = this._insertionPointView ;
|
160
190
|
if (insertionPoint) insertionPoint.removeFromParent() ;
|
@@ -165,7 +195,7 @@ SC.GridView = SC.ListView.extend(
|
|
165
195
|
}
|
166
196
|
},
|
167
197
|
|
168
|
-
|
198
|
+
/** @private */
|
169
199
|
insertionIndexForLocation: function(loc, dropOperation) {
|
170
200
|
var f = this.get('frame'),
|
171
201
|
sf = this.get('clippingFrame'),
|
@@ -44,9 +44,9 @@ SC.ImageButtonView = SC.ButtonView.extend(
|
|
44
44
|
/** @scope SC.ImageButtonView.prototype */ {
|
45
45
|
|
46
46
|
/**
|
47
|
-
|
48
|
-
|
49
|
-
@
|
47
|
+
@type Array
|
48
|
+
@default ['sc-image-button-view']
|
49
|
+
@see SC.View#classNames
|
50
50
|
*/
|
51
51
|
classNames: ['sc-image-button-view'],
|
52
52
|
|
@@ -54,23 +54,29 @@ SC.ImageButtonView = SC.ButtonView.extend(
|
|
54
54
|
Unlike SC.ButtonView, SC.ImageButtonView does not have a default theme
|
55
55
|
that needs to be applied for backwards compatibility.
|
56
56
|
|
57
|
-
@
|
57
|
+
@type String
|
58
|
+
@default null
|
58
59
|
*/
|
59
60
|
themeName: null,
|
60
61
|
|
61
62
|
/**
|
62
|
-
|
63
|
-
|
64
|
-
@property {String}
|
63
|
+
@type String
|
64
|
+
@default 'imageButtonRenderDelegate'
|
65
65
|
*/
|
66
66
|
renderDelegateName: 'imageButtonRenderDelegate',
|
67
67
|
|
68
|
+
/**
|
69
|
+
@type Array
|
70
|
+
@default ['image']
|
71
|
+
*/
|
68
72
|
displayProperties: ['image'],
|
69
73
|
|
70
74
|
/**
|
71
75
|
A class name that will be applied to the img tag of the button.
|
72
|
-
|
73
|
-
@
|
76
|
+
|
77
|
+
@type String
|
78
|
+
@default null
|
74
79
|
*/
|
75
80
|
image: null
|
81
|
+
|
76
82
|
}) ;
|