sproutcore 1.6.0.rc.2-x86-mingw32 → 1.6.0.1-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +12 -0
- data/VERSION.yml +1 -1
- data/bin/sc-docs +6 -1
- data/lib/buildtasks/target.rake +1 -1
- data/lib/frameworks/sproutcore/Buildfile +5 -1
- data/lib/frameworks/sproutcore/CHANGELOG.md +175 -1
- data/lib/frameworks/sproutcore/apps/test_controls/controllers/select.js +12 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/select_page.js +19 -5
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +28 -31
- data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +9 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +21 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/responder_context.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +6 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +26 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/keyboard.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +12 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +25 -9
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +157 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +7 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +9 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +8 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +104 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/theme.js +3 -56
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/content_destroyed.js +59 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/string.js +41 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +10 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/panes/template.js +16 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +18 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +10 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +18 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +9 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +9 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +15 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +14 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +8 -18
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +12 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/mixins/relationship_support.js +296 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +330 -326
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +22 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +614 -614
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/data_source.js +14 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +20 -13
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +61 -46
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +30 -30
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +24 -24
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/connectDataSource.js +31 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushRelationships.js +1177 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +4 -63
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +7 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +18 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +9 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/collection.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/image_button.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/master_detail.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js +12 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/panel.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/picker.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segmented.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/toolbar.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/well.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/workspace.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +1 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +33 -22
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +20 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +10 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +34 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +14 -15
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +40 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +699 -700
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +11 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +16 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +49 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_button.js +9 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +4 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +20 -19
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +2 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/view_designer.js +249 -249
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/edit_mode.js +13 -5
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/emptiness.js +53 -37
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form_row.js +3 -11
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/mixins/edit_mode.js +53 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/mixins/emptiness.js +114 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form.js +174 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_row.js +86 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +80 -110
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form_row.js +96 -97
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +2 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +20 -36
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +121 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu_item.js +90 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/mixins/select_view_menu.js +139 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/render_delegates/select_button.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/ext/menu_resizing.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/bindings.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/check_selected.js +32 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/popup_button/menu_setup.js +40 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/popup_button/show_menu.js +45 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/menu_width.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/selected_item.js +191 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/popup_button.js +264 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +450 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_child.js +14 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_thumb.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split_divider.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split.js +9 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/thumb.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +7 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +35 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor_delegate.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/helpers/sizing.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/image.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/render_delegate.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/favicon.ico +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +0 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/system/exception_handler.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/system/math.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +13 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +6 -9
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +912 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +36 -7
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +58 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/validator.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +0 -15
- data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +25 -14
- data/lib/frameworks/sproutcore/frameworks/handlebars/handlebars.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +15 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/flatten.js +24 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/ext/function.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +19 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/runtime/system/error.js +3 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +15 -16
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +30 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +9 -2
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/testing/resources/runner.css +0 -1
- data/lib/frameworks/sproutcore/frameworks/yuireset/resources/base.css +80 -0
- data/lib/frameworks/sproutcore/frameworks/yuireset/resources/core.css +0 -4
- data/lib/frameworks/sproutcore/lib/index.rhtml +2 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +3 -3
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +2 -2
- data/lib/frameworks/sproutcore/themes/ace/resources/form/form.css +9 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu.css +3 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/picker.js +1 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/workspace.js +1 -1
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/button.js +1 -1
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/panel.js +1 -1
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/progress.js +2 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/slider.js +1 -1
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/well.js +1 -1
- data/lib/sproutcore/builders/base.rb +5 -1
- data/lib/sproutcore/builders/handlebars.rb +12 -1
- data/lib/sproutcore/models/target.rb +1 -9
- data/lib/sproutcore/rack/proxy.rb +238 -92
- data/lib/sproutcore/tools/docs.rb +1 -7
- data/spec/fixtures/builder_tests/apps/handlebars_test/Buildfile +1 -0
- data/spec/fixtures/builder_tests/apps/handlebars_test/{template.handlebars → templates/template.handlebars} +2 -0
- data/spec/lib/builders/handlebars_spec.rb +10 -4
- data/sproutcore.gemspec +3 -1
- metadata +73 -44
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/english.lproj/default_styles.css +0 -5
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/english.lproj/strings.js +0 -15
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_checkbox_field.js +0 -17
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_field.js +0 -17
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_label.js +0 -17
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_radio_field.js +0 -17
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_text_field.js +0 -17
@@ -373,6 +373,25 @@ SC.CoreArray = /** @lends SC.Array.prototype */ {
|
|
373
373
|
return ret ;
|
374
374
|
},
|
375
375
|
|
376
|
+
/**
|
377
|
+
Returns a new array that is a one-dimensional flattening of this array,
|
378
|
+
i.e. for every element of this array extract that and it's elements into
|
379
|
+
a new array.
|
380
|
+
|
381
|
+
@returns {Array}
|
382
|
+
*/
|
383
|
+
flatten: function() {
|
384
|
+
var ret = [];
|
385
|
+
this.forEach(function(k) {
|
386
|
+
if (k && k.isEnumerable) {
|
387
|
+
ret = ret.pushObjects(k.flatten());
|
388
|
+
} else {
|
389
|
+
ret.pushObject(k);
|
390
|
+
}
|
391
|
+
});
|
392
|
+
return ret;
|
393
|
+
},
|
394
|
+
|
376
395
|
/**
|
377
396
|
Returns the largest Number in an array of Numbers. Make sure the array
|
378
397
|
only contains values of type Number to get expected result.
|
@@ -36,7 +36,8 @@ SC.Copyable = /** @scope SC.Copyable.prototype */{
|
|
36
36
|
@returns {Object} copy of receiver
|
37
37
|
*/
|
38
38
|
copy: function(deep) {
|
39
|
-
|
39
|
+
var className = SC._object_className(this.constructor);
|
40
|
+
throw "%@.copy() is not implemented".fmt(className);
|
40
41
|
},
|
41
42
|
|
42
43
|
/**
|
@@ -76,4 +77,4 @@ Array.prototype.copy = function(deep) {
|
|
76
77
|
while (idx--) ret[idx] = SC.copy(ret[idx], true);
|
77
78
|
}
|
78
79
|
return ret;
|
79
|
-
}
|
80
|
+
};
|
@@ -91,7 +91,7 @@ SC.Freezable = /** @scope SC.Freezable.prototype */ {
|
|
91
91
|
Freezes the object. Once this method has been called the object should
|
92
92
|
no longer allow any properties to be edited.
|
93
93
|
|
94
|
-
@returns {Object}
|
94
|
+
@returns {Object} receiver
|
95
95
|
*/
|
96
96
|
freeze: function() {
|
97
97
|
// NOTE: Once someone actually implements Object.freeze() in the browser,
|
@@ -783,7 +783,7 @@ SC.Observable = /** @scope SC.Observable.prototype */{
|
|
783
783
|
@param {String} key the key to observer
|
784
784
|
@param {Object} target the target object to invoke
|
785
785
|
@param {String|Function} method the method to invoke.
|
786
|
-
@returns {SC.Observable}
|
786
|
+
@returns {SC.Observable} receiver
|
787
787
|
*/
|
788
788
|
removeObserver: function(key, target, method) {
|
789
789
|
|
@@ -259,7 +259,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
259
259
|
The returned instance will also have its parentBinding property set to the
|
260
260
|
receiver.
|
261
261
|
|
262
|
-
@param {String} fromPath
|
262
|
+
@param {String} [fromPath]
|
263
263
|
@returns {SC.Binding} new binding instance
|
264
264
|
*/
|
265
265
|
beget: function(fromPath) {
|
@@ -291,7 +291,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
291
291
|
behavior is used to support the high-level API provided by SC.Object.
|
292
292
|
|
293
293
|
@param {String|Tuple} propertyPath A property path or tuple
|
294
|
-
@param {Object} root
|
294
|
+
@param {Object} [root] root object to use when resolving the path.
|
295
295
|
@returns {SC.Binding} this
|
296
296
|
*/
|
297
297
|
from: function(propertyPath, root) {
|
@@ -315,7 +315,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
315
315
|
until you connect the binding.
|
316
316
|
|
317
317
|
@param {String|Tuple} propertyPath A property path or tuple
|
318
|
-
@param {Object} root
|
318
|
+
@param {Object} [root] root object to use when resolving the path.
|
319
319
|
@returns {SC.Binding} this
|
320
320
|
*/
|
321
321
|
to: function(propertyPath, root) {
|
@@ -724,8 +724,8 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
724
724
|
means that if you change the "to" side directly, the "from" side may have
|
725
725
|
a different value.
|
726
726
|
|
727
|
-
@param {String} fromPath
|
728
|
-
@param {Boolean} aFlag
|
727
|
+
@param {String} [fromPath] from path to connect.
|
728
|
+
@param {Boolean} [aFlag] Pass NO to set the binding back to two-way
|
729
729
|
@returns {SC.Binding} this
|
730
730
|
*/
|
731
731
|
oneWay: function(fromPath, aFlag) {
|
@@ -795,8 +795,8 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
795
795
|
Note that this is not a transform function since it will be called at the
|
796
796
|
end of the transform chain.
|
797
797
|
|
798
|
-
@param {String} fromPath
|
799
|
-
@param {Boolean} aFlag
|
798
|
+
@param {String} [fromPath] from path to connect.
|
799
|
+
@param {Boolean} [aFlag] Pass NO to allow error objects again.
|
800
800
|
@returns {SC.Binding} this
|
801
801
|
*/
|
802
802
|
noError: function(fromPath, aFlag) {
|
@@ -828,7 +828,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
828
828
|
values are send unchanged.
|
829
829
|
|
830
830
|
@param {String} fromPath from path or null
|
831
|
-
@param {Object} placeholder
|
831
|
+
@param {Object} [placeholder] placeholder value.
|
832
832
|
@returns {SC.Binding} this
|
833
833
|
*/
|
834
834
|
single: function(fromPath, placeholder) {
|
@@ -849,7 +849,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
849
849
|
null, undefined, an empty array or an empty string. See also notNull().
|
850
850
|
|
851
851
|
@param {String} fromPath from path or null
|
852
|
-
@param {Object} placeholder
|
852
|
+
@param {Object} [placeholder]
|
853
853
|
@returns {SC.Binding} this
|
854
854
|
*/
|
855
855
|
notEmpty: function(fromPath, placeholder) {
|
@@ -867,7 +867,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
867
867
|
null or undefined. Otherwise it will passthrough untouched. See also notEmpty().
|
868
868
|
|
869
869
|
@param {String} fromPath from path or null
|
870
|
-
@param {Object} placeholder
|
870
|
+
@param {Object} [placeholder]
|
871
871
|
@returns {SC.Binding} this
|
872
872
|
*/
|
873
873
|
notNull: function(fromPath, placeholder) {
|
@@ -882,7 +882,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
882
882
|
Adds a transform that will convert the passed value to an array. If
|
883
883
|
the value is null or undefined, it will be converted to an empty array.
|
884
884
|
|
885
|
-
@param {String} fromPath
|
885
|
+
@param {String} [fromPath]
|
886
886
|
@returns {SC.Binding} this
|
887
887
|
*/
|
888
888
|
multiple: function(fromPath) {
|
@@ -897,7 +897,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
897
897
|
an array it will return YES if array is not empty. If the value is a string
|
898
898
|
it will return YES if the string is not empty.
|
899
899
|
|
900
|
-
@param {String} fromPath
|
900
|
+
@param {String} [fromPath]
|
901
901
|
@returns {SC.Binding} this
|
902
902
|
*/
|
903
903
|
bool: function(fromPath) {
|
@@ -970,7 +970,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
970
970
|
Adds a transform to convert the value to the inverse of a bool value. This
|
971
971
|
uses the same transform as bool() but inverts it.
|
972
972
|
|
973
|
-
@param {String} fromPath
|
973
|
+
@param {String} [fromPath]
|
974
974
|
@returns {SC.Binding} this
|
975
975
|
*/
|
976
976
|
not: function(fromPath) {
|
@@ -984,7 +984,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
984
984
|
/**
|
985
985
|
Adds a transform that will return YES if the value is null or undefined, NO otherwise.
|
986
986
|
|
987
|
-
@param {String} fromPath
|
987
|
+
@param {String} [fromPath]
|
988
988
|
@returns {SC.Binding} this
|
989
989
|
*/
|
990
990
|
isNull: function(fromPath) {
|
@@ -32,6 +32,9 @@ sc_require('ext/function');
|
|
32
32
|
set isError to YES, then calling SC.ok(obj) on your object will return NO.
|
33
33
|
If isError is YES, then SC.val(obj) will return your errorValue property
|
34
34
|
instead of the receiver.
|
35
|
+
|
36
|
+
When using SC.typeOf(obj), SC.T_ERROR will only be returned if the obj
|
37
|
+
is an instance of SC.Error
|
35
38
|
|
36
39
|
@extends SC.Object
|
37
40
|
@since SproutCore 1.0
|
@@ -132,7 +132,7 @@ SC.LOGGER_LEVEL_NONE = 'none';
|
|
132
132
|
functions, such as defining groups.
|
133
133
|
|
134
134
|
The FireFox plugin Firebug was used as a function reference. Please see
|
135
|
-
|
135
|
+
[Firebug Logging Reference](http://getfirebug.com/logging.html)
|
136
136
|
for further information.
|
137
137
|
|
138
138
|
@author Colin Campbell
|
@@ -258,7 +258,7 @@ SC.Logger = SC.Object.create(
|
|
258
258
|
If this property is set to YES, it will set 'logOutputLevel' to
|
259
259
|
SC.LOGGER_LEVEL_DEBUG. Otherwise, it will have no effect.
|
260
260
|
|
261
|
-
@deprecated
|
261
|
+
@deprecated Set the log level instead.
|
262
262
|
@property: {Boolean}
|
263
263
|
*/
|
264
264
|
debugEnabled: NO,
|
@@ -555,7 +555,7 @@ SC.Object.prototype = {
|
|
555
555
|
Although the default init() method returns the receiver, the return
|
556
556
|
value is ignored.
|
557
557
|
|
558
|
-
|
558
|
+
|
559
559
|
*/
|
560
560
|
init: function() {
|
561
561
|
this.initObservable();
|
@@ -729,7 +729,7 @@ SC.Object.prototype = {
|
|
729
729
|
method is called automatically for view classes but may be used for any
|
730
730
|
object.
|
731
731
|
|
732
|
-
|
732
|
+
|
733
733
|
*/
|
734
734
|
awake: function() {
|
735
735
|
var outlets = this.outlets,
|
@@ -56,7 +56,7 @@ SC.RangeObserver = /** @scope SC.RangeObserver.prototype */{
|
|
56
56
|
ret.source = source;
|
57
57
|
ret.indexes = indexSet ? indexSet.frozenCopy() : null;
|
58
58
|
ret.target = target;
|
59
|
-
ret.method = method;
|
59
|
+
ret.method = (typeof method === 'string') ? target[method] : method;
|
60
60
|
ret.context = context ;
|
61
61
|
ret.isDeep = isDeep || false ;
|
62
62
|
ret.beginObserving();
|
@@ -291,12 +291,12 @@ SC.run = function(callback, target, forceNested) {
|
|
291
291
|
if (callback) callback.call(target);
|
292
292
|
if(forceNested || !alreadyRunning) SC.RunLoop.end();
|
293
293
|
} catch (e) {
|
294
|
-
SC.ExceptionHandler.handleException(e);
|
294
|
+
var handled = SC.ExceptionHandler.handleException(e);
|
295
295
|
|
296
|
-
//
|
296
|
+
// If the exception was not handled, throw it again so the browser
|
297
297
|
// can deal with it (and potentially use it for debugging).
|
298
298
|
// (We don't throw it in IE because the user will see two errors)
|
299
|
-
if (!SC.browser.msie) {
|
299
|
+
if (!handled && !SC.browser.msie) {
|
300
300
|
throw e;
|
301
301
|
}
|
302
302
|
}
|
@@ -32,7 +32,7 @@ sc_require('mixins/copyable');
|
|
32
32
|
|
33
33
|
Whether or not property observing is enabled, sets offer very powerful
|
34
34
|
notifications of items being added and removed, through the
|
35
|
-
|
35
|
+
`:addSetObserver` and `:removeSetObserver` methods; this can be
|
36
36
|
very useful, for instance, for filtering or mapping sets.
|
37
37
|
|
38
38
|
Note that SC.Set is a primitive object, like an array. It does implement
|
@@ -49,18 +49,17 @@ sc_require('mixins/copyable');
|
|
49
49
|
Finally, you can pass in an existing set and the set will be copied. You
|
50
50
|
can also create a copy of a set by calling SC.Set#clone().
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
var foundNames = SC.Set.create();
|
52
|
+
// creates a new empty set
|
53
|
+
var foundNames = SC.Set.create();
|
55
54
|
|
56
|
-
|
57
|
-
|
55
|
+
// creates a set with four names in it.
|
56
|
+
var names = SC.Set.create(["Charles", "Tom", "Juan", "Alex"]) ; // :P
|
58
57
|
|
59
|
-
|
60
|
-
|
58
|
+
// creates a copy of the names set.
|
59
|
+
var namesCopy = SC.Set.create(names);
|
61
60
|
|
62
|
-
|
63
|
-
|
61
|
+
// same as above.
|
62
|
+
var anotherNamesCopy = names.clone();
|
64
63
|
|
65
64
|
Adding/Removing Objects
|
66
65
|
-----------------------
|
@@ -91,8 +90,8 @@ sc_require('mixins/copyable');
|
|
91
90
|
|
92
91
|
Observing changes
|
93
92
|
-----------------
|
94
|
-
When using
|
95
|
-
|
93
|
+
When using `:SC.Set` (rather than `:SC.CoreSet`), you can observe the
|
94
|
+
`:"[]"` property to be alerted whenever the content changes.
|
96
95
|
|
97
96
|
This is often unhelpful. If you are filtering sets of objects, for instance,
|
98
97
|
it is very inefficient to re-filter all of the items each time the set changes.
|
@@ -100,10 +99,10 @@ sc_require('mixins/copyable');
|
|
100
99
|
was changed on the original set. The same issue applies to merging sets,
|
101
100
|
as well.
|
102
101
|
|
103
|
-
|
104
|
-
|
105
|
-
an object which implements
|
106
|
-
|
102
|
+
`:SC.Set` and `:SC.CoreSet` both offer another method of being observed:
|
103
|
+
`:addSetObserver` and `:removeSetObserver`. These take a single parameter:
|
104
|
+
an object which implements `:didAddItem(set, item)` and
|
105
|
+
`:didRemoveItem(set, item)`.
|
107
106
|
|
108
107
|
Whenever an item is added or removed from the set, all objects in the set
|
109
108
|
(a SC.CoreSet, actually) of observing objects will be alerted appropriately.
|
@@ -10,7 +10,8 @@ test("SC.typeOf", function() {
|
|
10
10
|
var a = null,
|
11
11
|
arr = [1,2,3],
|
12
12
|
obj = {},
|
13
|
-
object = SC.Object.create({ method: function() {} })
|
13
|
+
object = SC.Object.create({ method: function() {} }),
|
14
|
+
E = SC.Error.extend();
|
14
15
|
|
15
16
|
equals(SC.T_UNDEFINED, SC.typeOf(undefined), "item of type undefined");
|
16
17
|
equals(SC.T_NULL, SC.typeOf(a), "item of type null");
|
@@ -20,6 +21,9 @@ test("SC.typeOf", function() {
|
|
20
21
|
equals(SC.T_FUNCTION, SC.typeOf(object.method), "item of type function") ;
|
21
22
|
equals(SC.T_CLASS, SC.typeOf(SC.Object), "item of type class");
|
22
23
|
equals(SC.T_ERROR, SC.typeOf(SC.Error.create()), "item of type error");
|
24
|
+
equals(SC.T_OBJECT, SC.typeOf(SC.Object.create({ isError: YES })), "sc object with isError property should be of type object");
|
25
|
+
equals(SC.T_ERROR, SC.typeOf(E.create()), "item of type error");
|
26
|
+
equals(SC.T_HASH, SC.typeOf({ isObject: YES }), "hash object with isObject property should be of type hash");
|
23
27
|
});
|
24
28
|
|
25
29
|
test("SC.none", function() {
|
@@ -71,7 +75,7 @@ test("SC.isArray" ,function(){
|
|
71
75
|
equals( SC.isArray(fn), false, "function() {}" );
|
72
76
|
|
73
77
|
if (window.document) {
|
74
|
-
var nodelist = document.getElementsByTagName("body")
|
78
|
+
var nodelist = document.getElementsByTagName("body");
|
75
79
|
equals( SC.isArray(nodelist), true, "NodeList" );
|
76
80
|
}
|
77
81
|
});
|
@@ -194,3 +194,33 @@ test("enhance still works if there is no base method to enhance", function() {
|
|
194
194
|
|
195
195
|
ok(enhanced.weirdName(), "enhanced function runs with no errors");
|
196
196
|
});
|
197
|
+
|
198
|
+
test("should invalidate a computed property added to a subclass via reopen() that depends on a key defined in original");
|
199
|
+
|
200
|
+
// Enable the following once we fix this
|
201
|
+
/*
|
202
|
+
test("should invalidate a computed property added to a subclass via reopen() that depends on a key defined in original", function() {
|
203
|
+
var MyClass = SC.Object.extend({ property: function() { }.property() });
|
204
|
+
var MySubclass = MyClass.extend({ anotherProperty: function() { }.property() });
|
205
|
+
|
206
|
+
var observerCalled = 0;
|
207
|
+
|
208
|
+
MyClass.reopen({
|
209
|
+
yetAnotherProperty: function() {
|
210
|
+
return "Yet Another Property";
|
211
|
+
}.property('property')
|
212
|
+
});
|
213
|
+
|
214
|
+
var mySubclass = MySubclass.create();
|
215
|
+
mySubclass.addObserver('yetAnothesProperty', function() {
|
216
|
+
observerCalled++;
|
217
|
+
});
|
218
|
+
|
219
|
+
SC.run(function() {
|
220
|
+
mySubclass.set('property', "foo");
|
221
|
+
});
|
222
|
+
|
223
|
+
equals(observerCalled, 1, "fires observer once");
|
224
|
+
});
|
225
|
+
*/
|
226
|
+
|
@@ -57,3 +57,20 @@ test("does not observe object properties if isDeep is NO", function() {
|
|
57
57
|
}
|
58
58
|
equals(observer.callCount, 0, 'range observer should not fire');
|
59
59
|
});
|
60
|
+
|
61
|
+
test("SC.RangeObserver.create should accept methods specified as strings", function() {
|
62
|
+
var myArray = [ SC.Object.create({ prop: 0 })],
|
63
|
+
rangeObserverCount = 0,
|
64
|
+
observer = SC.Object.create({
|
65
|
+
rangeObserverDidFire: function(source, object, key, index) {
|
66
|
+
++rangeObserverCount;
|
67
|
+
}
|
68
|
+
}),
|
69
|
+
rangeObserver = SC.RangeObserver.create( myArray, SC.IndexSet.create(0, 1),
|
70
|
+
observer, 'rangeObserverDidFire',
|
71
|
+
null, true /* isDeep */);
|
72
|
+
|
73
|
+
equals(rangeObserverCount, 0, "Range observer hasn't fired yet");
|
74
|
+
myArray[0].incrementProperty('prop');
|
75
|
+
equals(rangeObserverCount, 1, "Range observer should fire on property change");
|
76
|
+
});
|
@@ -18,11 +18,14 @@
|
|
18
18
|
You do not create an instance of a state itself. The statechart manager will go through its
|
19
19
|
state heirarchy and create the states itself.
|
20
20
|
|
21
|
+
For more information on using statecharts, see SC.StatechartManager.
|
22
|
+
|
21
23
|
@author Michael Cohen
|
22
24
|
@extends SC.Object
|
23
25
|
*/
|
24
|
-
SC.State = SC.Object.extend(
|
25
|
-
|
26
|
+
SC.State = SC.Object.extend(
|
27
|
+
/** @lends SC.State.prototype */ {
|
28
|
+
|
26
29
|
/**
|
27
30
|
The name of the state
|
28
31
|
|
@@ -1062,6 +1065,10 @@ SC.State.plugin = function(value) {
|
|
1062
1065
|
console.error('SC.State.plugin: Unable to determine path %@'.fmt(value));
|
1063
1066
|
return undefined;
|
1064
1067
|
}
|
1068
|
+
if (!klass.isClass || !klass.kindOf(SC.State)) {
|
1069
|
+
console.error('SC.State.plugin: Unable to extend. %@ must be a class extending from SC.State'.fmt(value));
|
1070
|
+
return undefined;
|
1071
|
+
}
|
1065
1072
|
return klass.extend.apply(klass, args);
|
1066
1073
|
};
|
1067
1074
|
func.statePlugin = YES;
|
@@ -62,7 +62,7 @@ sc_require('system/state');
|
|
62
62
|
|
63
63
|
If you liked to specify a class that should be used as the root state but using the above method to defined
|
64
64
|
states, you can set the rootStateExample property with a class that extends from SC.State. If the
|
65
|
-
|
65
|
+
rootStateExample property is not explicitly assigned the then default class used will be SC.State.
|
66
66
|
|
67
67
|
To provide your statechart with orthogonality, you use concurrent states. If you use concurrent states,
|
68
68
|
then your statechart will have multiple current states. That is because each concurrent state represents an
|
@@ -590,6 +590,8 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
590
590
|
// No explicit current state to start from; therefore, just use the first current state as
|
591
591
|
// a default, if there is a current state.
|
592
592
|
fromCurrentState = this.get('currentStates')[0];
|
593
|
+
msg = "gotoState: fromCurrentState not explicitly provided. Using a default current state to transition from: %@";
|
594
|
+
this.statechartLogWarning(msg.fmt(fromCurrentState));
|
593
595
|
}
|
594
596
|
|
595
597
|
if (trace) {
|