sproutcore 1.0.1003 → 1.0.1008
Sign up to get free protection for your applications and to get access to all the features.
- data/Buildfile +15 -3
- data/Rakefile +3 -7
- data/VERSION.yml +2 -2
- data/buildtasks/manifest.rake +2 -0
- data/frameworks/sproutcore/Buildfile +2 -0
- data/frameworks/sproutcore/HISTORY +218 -203
- data/frameworks/sproutcore/README +47 -6
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +4 -0
- data/frameworks/sproutcore/design/Design Charts.graffle +2945 -4332
- data/frameworks/sproutcore/frameworks/bootstrap/README +9 -0
- data/frameworks/sproutcore/frameworks/bootstrap/core.js +7 -0
- data/frameworks/sproutcore/frameworks/bootstrap/setup_body_class_names.js +10 -0
- data/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +28 -0
- data/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +45 -0
- data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +9 -8
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +49 -9
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +9 -0
- data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +3 -2
- data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +81 -8
- data/frameworks/sproutcore/frameworks/datastore/system/query.js +26 -5
- data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +47 -0
- data/frameworks/sproutcore/frameworks/datastore/system/store.js +164 -32
- data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +32 -4
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +56 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +15 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +16 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +22 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +32 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/core_methods.js +70 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +12 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +50 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +9 -9
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +8 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +79 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +24 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/error_methods.js +62 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +2 -0
- data/frameworks/sproutcore/frameworks/debug/core.js +10 -6
- data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +43 -18
- data/frameworks/sproutcore/frameworks/designer/core.js +10 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/selection_handles.css +58 -0
- data/frameworks/sproutcore/frameworks/designer/{views/mixins → mixins}/button.js +0 -0
- data/frameworks/sproutcore/frameworks/designer/views/{controls/button.js → button.js} +6 -2
- data/frameworks/sproutcore/frameworks/designer/views/designer.js +566 -136
- data/frameworks/sproutcore/frameworks/designer/views/selection_handles.js +77 -0
- data/frameworks/sproutcore/frameworks/desktop/core.js +12 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +1 -1
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +3 -2
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +0 -36
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +14 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +4 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +2 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +0 -4
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +8 -5
- data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +2 -2
- data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +100 -111
- data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +51 -13
- data/frameworks/sproutcore/frameworks/desktop/panes/{drop_down.js → select_button.js} +70 -109
- data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +8 -0
- data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +69 -23
- data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +4 -4
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +2 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/{dropDown → select_button}/methods.js +15 -11
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/{dropDown → select_button}/ui.js +22 -22
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +0 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +19 -3
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +53 -28
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +6 -6
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +23 -9
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +24 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +10 -3
- data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +50 -28
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +6 -6
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +3 -3
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +8 -8
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/button.js +5 -3
- data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +4 -3
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +125 -96
- data/frameworks/sproutcore/frameworks/desktop/views/grid.js +1 -0
- data/frameworks/sproutcore/frameworks/desktop/views/list.js +68 -18
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +134 -56
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +18 -11
- data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +562 -2
- data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +13 -0
- data/frameworks/sproutcore/frameworks/desktop/views/progress.js +11 -8
- data/frameworks/sproutcore/frameworks/desktop/views/radio.js +7 -7
- data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +99 -33
- data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +3 -7
- data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +0 -7
- data/frameworks/sproutcore/frameworks/desktop/views/separator.js +2 -3
- data/frameworks/sproutcore/frameworks/desktop/views/slider.js +0 -8
- data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/split.js +27 -7
- data/frameworks/sproutcore/frameworks/desktop/views/tab.js +2 -6
- data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +15 -10
- data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +20 -1
- data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +3 -6
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +3 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +8 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/inline_editor.css +12 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +11 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +13 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +1 -2
- data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +70 -21
- data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +88 -54
- data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +0 -25
- data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +23 -2
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +34 -23
- data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +20 -0
- data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +32 -23
- data/frameworks/sproutcore/frameworks/foundation/system/browser.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/system/bundle.js +77 -15
- data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +5 -4
- data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +22 -7
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +466 -309
- data/frameworks/sproutcore/frameworks/foundation/system/responder.js +2 -1
- data/frameworks/sproutcore/frameworks/foundation/system/response.js +457 -0
- data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +66 -15
- data/frameworks/sproutcore/frameworks/foundation/system/routes.js +4 -4
- data/frameworks/sproutcore/frameworks/foundation/system/timer.js +6 -4
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +46 -8
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +17 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +18 -5
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +0 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +11 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +14 -14
- data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +15 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +8 -7
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +3 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +51 -44
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +4 -4
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +2 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +9 -9
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +3 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +10 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +14 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +5 -5
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +1 -11
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +2 -4
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +2 -4
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +0 -2
- data/frameworks/sproutcore/frameworks/foundation/validators/password.js +5 -5
- data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +4 -2
- data/frameworks/sproutcore/frameworks/foundation/views/field.js +5 -8
- data/frameworks/sproutcore/frameworks/foundation/views/label.js +21 -5
- data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +112 -69
- data/frameworks/sproutcore/frameworks/foundation/views/view.js +67 -6
- data/frameworks/sproutcore/frameworks/runtime/core.js +51 -2
- data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +4 -1
- data/frameworks/sproutcore/frameworks/runtime/system/binding.js +2 -1
- data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +5 -4
- data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +6 -1
- data/frameworks/sproutcore/frameworks/runtime/system/logger.js +408 -0
- data/frameworks/sproutcore/frameworks/runtime/system/object.js +15 -4
- data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +30 -2
- data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +5 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +3 -3
- data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +2 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +2 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +2 -2
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +11 -7
- data/frameworks/sproutcore/frameworks/runtime/tests/system/error.js +3 -2
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +18 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/logger.js +165 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +3 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +13 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +24 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +32 -13
- data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +2 -2
- data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +7 -2
- data/frameworks/sproutcore/lib/index.rhtml +6 -20
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +0 -1
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +5 -4
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +4 -3
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +7 -7
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +38 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/menu.css +20 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +1 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +3 -1
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +1 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +1 -1
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +0 -15
- data/gen/data-source/Buildfile +18 -0
- data/gen/data-source/README +1 -0
- data/gen/data-source/USAGE +15 -0
- data/gen/data-source/templates/data_sources/@filename@.js +64 -0
- data/lib/sproutcore/builders/combine.rb +23 -0
- data/lib/sproutcore/builders/javascript.rb +27 -2
- data/lib/sproutcore/buildfile/task.rb +1 -1
- data/lib/sproutcore/helpers/entry_sorter.rb +2 -2
- data/lib/sproutcore/helpers/static_helper.rb +79 -0
- data/lib/sproutcore/models/manifest.rb +2 -2
- data/lib/sproutcore/models/target.rb +1 -1
- data/lib/sproutcore/tools/build.rb +1 -1
- data/lib/sproutcore/tools/docs.rb +3 -3
- data/lib/sproutcore/tools/gen.rb +17 -15
- data/lib/sproutcore/tools/manifest.rb +9 -9
- data/lib/sproutcore/tools/server.rb +3 -3
- data/lib/sproutcore/tools.rb +259 -250
- data/lib/sproutcore.rb +9 -1
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +2 -2
- data/spec/fixtures/entry_for_project/frameworks/unrelated/PLACEHOLDER +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/{lproj → english.lproj}/strings.js +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/main.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/resources/main_page.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/t.js +1 -0
- data/spec/lib/models/manifest/find_entry.rb +12 -0
- data/spec/lib/tools/gen_spec.rb +1 -0
- data/spec/lib/tools/tools_spec.rb +1 -0
- data/sproutcore-abbot.gemspec +36 -44
- metadata +43 -44
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/indicator.gif +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sticky-note.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/views/form.js +0 -594
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
- data/lib/thor/CHANGELOG.rdoc +0 -52
- data/lib/thor/LICENSE +0 -20
- data/lib/thor/README.markdown +0 -76
- data/lib/thor/Rakefile +0 -6
- data/lib/thor/Thorfile +0 -45
- data/lib/thor/bin/rake2thor +0 -83
- data/lib/thor/bin/thor +0 -7
- data/lib/thor/lib/thor/error.rb +0 -3
- data/lib/thor/lib/thor/options.rb +0 -267
- data/lib/thor/lib/thor/ordered_hash.rb +0 -64
- data/lib/thor/lib/thor/runner.rb +0 -305
- data/lib/thor/lib/thor/task.rb +0 -83
- data/lib/thor/lib/thor/task_hash.rb +0 -22
- data/lib/thor/lib/thor/tasks/package.rb +0 -18
- data/lib/thor/lib/thor/tasks.rb +0 -77
- data/lib/thor/lib/thor/util.rb +0 -75
- data/lib/thor/lib/thor.rb +0 -170
- data/lib/thor/script/destroy +0 -14
- data/lib/thor/script/generate +0 -14
- data/lib/thor/spec/fixtures/task.thor +0 -10
- data/lib/thor/spec/options_spec.rb +0 -271
- data/lib/thor/spec/ordered_hash_spec.rb +0 -84
- data/lib/thor/spec/spec.opts +0 -1
- data/lib/thor/spec/spec_helper.rb +0 -30
- data/lib/thor/spec/task_spec.rb +0 -11
- data/lib/thor/spec/tasks_spec.rb +0 -28
- data/lib/thor/spec/thor_runner_spec.rb +0 -194
- data/lib/thor/spec/thor_spec.rb +0 -206
- data/lib/thor/spec/util_spec.rb +0 -99
- data/lib/thor/task.thor +0 -15
- data/lib/thor/thor.gemspec +0 -29
@@ -0,0 +1,408 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// SC.Logger
|
3
|
+
// ==========================================================================
|
4
|
+
|
5
|
+
|
6
|
+
/**
|
7
|
+
If {@link SC.Logger.format} is true, this delimiter will be put between arguments.
|
8
|
+
|
9
|
+
@property {String}
|
10
|
+
*/
|
11
|
+
SC.LOGGER_LOG_DELIMITER = ", ";
|
12
|
+
|
13
|
+
/**
|
14
|
+
If {@link SC.Logger.error} falls back onto {@link SC.Logger.log}, this will be
|
15
|
+
prepended to the output.
|
16
|
+
|
17
|
+
@property {String}
|
18
|
+
*/
|
19
|
+
SC.LOGGER_LOG_ERROR = "ERROR: ";
|
20
|
+
|
21
|
+
/**
|
22
|
+
If {@link SC.Logger.info} falls back onto {@link SC.Logger.log}, this will be
|
23
|
+
prepended to the output.
|
24
|
+
|
25
|
+
@property {String}
|
26
|
+
*/
|
27
|
+
SC.LOGGER_LOG_INFO = "INFO: ";
|
28
|
+
|
29
|
+
/**
|
30
|
+
If {@link SC.Logger.warn} falls back onto {@link SC.Logger.log}, this will be
|
31
|
+
prepended to the output.
|
32
|
+
|
33
|
+
@property {String}
|
34
|
+
*/
|
35
|
+
SC.LOGGER_LOG_WARN = "WARNING: ";
|
36
|
+
|
37
|
+
/** @class
|
38
|
+
|
39
|
+
Object to allow for safe logging actions, such as using the browser console.
|
40
|
+
|
41
|
+
The FireFox plugin Firebug was used as a function reference. Please see
|
42
|
+
{@link <a href="http://getfirebug.com/logging.html">Firebug Logging Reference</a>}
|
43
|
+
for further information.
|
44
|
+
|
45
|
+
@author Colin Campbell
|
46
|
+
@extends SC.Object
|
47
|
+
@since Sproutcore 1.0
|
48
|
+
@see <a href="http://getfirebug.com/logging.html">Firebug Logging Reference</a>
|
49
|
+
*/
|
50
|
+
SC.Logger = SC.Object.create({
|
51
|
+
|
52
|
+
// ..........................................................
|
53
|
+
// PROPERTIES
|
54
|
+
//
|
55
|
+
|
56
|
+
/**
|
57
|
+
Computed property that checks for the existence of the reporter object.
|
58
|
+
|
59
|
+
@property {Boolean}
|
60
|
+
*/
|
61
|
+
exists: function() {
|
62
|
+
return typeof(this.get('reporter')) !== 'undefined' && this.get('reporter') != null;
|
63
|
+
}.property('reporter').cacheable(),
|
64
|
+
|
65
|
+
/**
|
66
|
+
If console.log does not exist, SC.Logger will use window.alert instead.
|
67
|
+
|
68
|
+
This property is only used inside {@link SC.Logger.log}. If fallBackOnLog is
|
69
|
+
false and you call a different function, an alert will not be opened.
|
70
|
+
|
71
|
+
@property {Boolean}
|
72
|
+
*/
|
73
|
+
fallBackOnAlert: NO,
|
74
|
+
|
75
|
+
/**
|
76
|
+
If some function, such as console.dir, does not exist,
|
77
|
+
SC.Logger will try console.log if this is true.
|
78
|
+
|
79
|
+
@property {Boolean}
|
80
|
+
*/
|
81
|
+
fallBackOnLog: YES,
|
82
|
+
|
83
|
+
/**
|
84
|
+
Whether or not to format multiple arguments together
|
85
|
+
or let the browser deal with that.
|
86
|
+
|
87
|
+
@property {Boolean}
|
88
|
+
*/
|
89
|
+
format: YES,
|
90
|
+
|
91
|
+
/**
|
92
|
+
The reporter is the object which implements the actual logging functions.
|
93
|
+
|
94
|
+
@default The browser's console
|
95
|
+
@property {Object}
|
96
|
+
*/
|
97
|
+
reporter: console,
|
98
|
+
|
99
|
+
// ..........................................................
|
100
|
+
// METHODS
|
101
|
+
//
|
102
|
+
|
103
|
+
/**
|
104
|
+
Log output to the console, but only if it exists.
|
105
|
+
|
106
|
+
@param {String|Array|Function|Object}
|
107
|
+
@returns {Boolean} true if reporter.log exists, false otherwise
|
108
|
+
*/
|
109
|
+
log: function() {
|
110
|
+
var reporter = this.get('reporter');
|
111
|
+
|
112
|
+
// log through the reporter
|
113
|
+
if (this.get('exists') && typeof(reporter.log) === "function") {
|
114
|
+
if (this.get('format')) {
|
115
|
+
reporter.log(this._argumentsToString.apply(this, arguments));
|
116
|
+
}
|
117
|
+
else {
|
118
|
+
reporter.log.apply(reporter, arguments);
|
119
|
+
}
|
120
|
+
return true;
|
121
|
+
}
|
122
|
+
|
123
|
+
// log through alert
|
124
|
+
else if (this.fallBackOnAlert) {
|
125
|
+
var s = this.get('format') ? this._argumentsToString.apply(this, arguments) : arguments;
|
126
|
+
// include support for overriding the alert through the reporter
|
127
|
+
// if it has come this far, it's likely this will fail
|
128
|
+
if (this.get('exists') && typeof(reporter.alert) === "function") {
|
129
|
+
reporter.alert(s);
|
130
|
+
}
|
131
|
+
else {
|
132
|
+
alert(s);
|
133
|
+
}
|
134
|
+
return true;
|
135
|
+
}
|
136
|
+
return false;
|
137
|
+
},
|
138
|
+
|
139
|
+
/**
|
140
|
+
Prints the properties of an object.
|
141
|
+
|
142
|
+
Logs the object using {@link SC.Logger.log} if the reporter.dir function does not exist and
|
143
|
+
{@link SC.Logger.fallBackOnLog} is true.
|
144
|
+
|
145
|
+
@param {Object}
|
146
|
+
@returns {Boolean} true if logged to console, false if not
|
147
|
+
*/
|
148
|
+
dir: function() {
|
149
|
+
var reporter = this.get('reporter');
|
150
|
+
|
151
|
+
if (this.get('exists') && typeof(reporter.dir) === "function") {
|
152
|
+
// Firebug's console.dir doesn't support multiple objects here
|
153
|
+
// but maybe custom reporters will
|
154
|
+
reporter.dir.apply(reporter, arguments);
|
155
|
+
return true;
|
156
|
+
}
|
157
|
+
return (this.fallBackOnLog) ? this.log.apply(this, arguments) : false;
|
158
|
+
},
|
159
|
+
|
160
|
+
/**
|
161
|
+
Prints an XML outline for any HTML or XML object.
|
162
|
+
|
163
|
+
Logs the object using {@link SC.Logger.log} if reporter.dirxml function does not exist and
|
164
|
+
{@lnk SC.Logger.fallBackOnLog} is true.
|
165
|
+
|
166
|
+
@param {Object}
|
167
|
+
@returns {Boolean} true if logged to reporter, false if not
|
168
|
+
*/
|
169
|
+
dirxml: function() {
|
170
|
+
var reporter = this.get('reporter');
|
171
|
+
|
172
|
+
if (this.get('exists') && typeof(reporter.dirxml) === "function") {
|
173
|
+
// Firebug's console.dirxml doesn't support multiple objects here
|
174
|
+
// but maybe custom reporters will
|
175
|
+
reporter.dirxml.apply(reporter, arguments);
|
176
|
+
return true;
|
177
|
+
}
|
178
|
+
return (this.fallBackOnLog) ? this.log.apply(this, arguments) : false;
|
179
|
+
},
|
180
|
+
|
181
|
+
/**
|
182
|
+
Log an error to the console
|
183
|
+
|
184
|
+
Logs the error using {@link SC.Logger.log} if reporter.error does not exist and
|
185
|
+
{@link SC.Logger.fallBackOnLog} is true.
|
186
|
+
|
187
|
+
@param {String|Array|Function|Object}
|
188
|
+
@returns {Boolean} true if logged to reporter, false if not
|
189
|
+
*/
|
190
|
+
error: function() {
|
191
|
+
var reporter = this.get('reporter');
|
192
|
+
|
193
|
+
if (this.get('exists') && typeof(reporter.error) === "function") {
|
194
|
+
reporter.error.apply(reporter, arguments);
|
195
|
+
return true;
|
196
|
+
}
|
197
|
+
else if (this.fallBackOnLog) {
|
198
|
+
var a = this._argumentsToArray(arguments);
|
199
|
+
if (typeof(a.unshift) === "function") a.unshift(SC.LOGGER_LOG_ERROR);
|
200
|
+
return this.log.apply(this, a);
|
201
|
+
}
|
202
|
+
return false;
|
203
|
+
},
|
204
|
+
|
205
|
+
/**
|
206
|
+
Every log after this call until {@link SC.Logger.groupEnd} is called
|
207
|
+
will be indented for readability. You can create as many levels
|
208
|
+
as you want.
|
209
|
+
|
210
|
+
@param {String} [title] An optional title to display above the group
|
211
|
+
@returns {Boolean} true if reporter.group exists, false otherwise
|
212
|
+
*/
|
213
|
+
group: function(s) {
|
214
|
+
var reporter = this.get('reporter');
|
215
|
+
|
216
|
+
if (this.get('exists') && typeof(reporter.group) === "function") {
|
217
|
+
reporter.group(s);
|
218
|
+
return true;
|
219
|
+
}
|
220
|
+
return false;
|
221
|
+
},
|
222
|
+
|
223
|
+
/**
|
224
|
+
Ends a group declared with {@link SC.Logger.group}.
|
225
|
+
|
226
|
+
@returns {Boolean} true if the reporter.groupEnd exists, false otherwise
|
227
|
+
@see SC.Logger.group
|
228
|
+
*/
|
229
|
+
groupEnd: function() {
|
230
|
+
var reporter = this.get('reporter');
|
231
|
+
|
232
|
+
if (this.get('exists') && typeof(reporter.groupEnd) === "function") {
|
233
|
+
reporter.groupEnd();
|
234
|
+
return true;
|
235
|
+
}
|
236
|
+
return false;
|
237
|
+
},
|
238
|
+
|
239
|
+
/**
|
240
|
+
Log an information response to the reporter.
|
241
|
+
|
242
|
+
Logs the response using {@link SC.Logger.log} if reporter.info does not exist and
|
243
|
+
{@link SC.Logger.fallBackOnLog} is true.
|
244
|
+
|
245
|
+
@param {String|Array|Function|Object}
|
246
|
+
@returns {Boolean} true if logged to reporter, false if not
|
247
|
+
*/
|
248
|
+
info: function() {
|
249
|
+
var reporter = this.get('reporter');
|
250
|
+
|
251
|
+
if (this.get('exists') && typeof(reporter.info) === "function") {
|
252
|
+
reporter.info.apply(reporter, arguments);
|
253
|
+
return true;
|
254
|
+
}
|
255
|
+
else if (this.fallBackOnLog) {
|
256
|
+
var a = this._argumentsToArray(arguments);
|
257
|
+
if (typeof(a.unshift) === "function") a.unshift(SC.LOGGER_LOG_INFO);
|
258
|
+
return this.log.apply(this, a);
|
259
|
+
}
|
260
|
+
return false;
|
261
|
+
},
|
262
|
+
|
263
|
+
/**
|
264
|
+
Begins the JavaScript profiler, if it exists. Call {@link SC.Logger.profileEnd}
|
265
|
+
to end the profiling process and receive a report.
|
266
|
+
|
267
|
+
@returns {Boolean} true if reporter.profile exists, false otherwise
|
268
|
+
*/
|
269
|
+
profile: function() {
|
270
|
+
var reporter = this.get('reporter');
|
271
|
+
|
272
|
+
if (this.get('exists') && typeof(reporter.profile) === "function") {
|
273
|
+
reporter.profile();
|
274
|
+
return true;
|
275
|
+
}
|
276
|
+
return false;
|
277
|
+
},
|
278
|
+
|
279
|
+
/**
|
280
|
+
Ends the JavaScript profiler, if it exists.
|
281
|
+
|
282
|
+
@returns {Boolean} true if reporter.profileEnd exists, false otherwise
|
283
|
+
@see SC.Logger.profile
|
284
|
+
*/
|
285
|
+
profileEnd: function() {
|
286
|
+
var reporter = this.get('reporter');
|
287
|
+
|
288
|
+
if (this.get('exists') && typeof(reporter.profileEnd) === "function") {
|
289
|
+
reporter.profileEnd();
|
290
|
+
return true;
|
291
|
+
}
|
292
|
+
return false;
|
293
|
+
},
|
294
|
+
|
295
|
+
/**
|
296
|
+
Measure the time between when this function is called and
|
297
|
+
{@link SC.Logger.timeEnd} is called.
|
298
|
+
|
299
|
+
@param {String} name The name of the profile to begin
|
300
|
+
@returns {Boolean} true if reporter.time exists, false otherwise
|
301
|
+
@see SC.Logger.timeEnd
|
302
|
+
*/
|
303
|
+
time: function(name) {
|
304
|
+
var reporter = this.get('reporter');
|
305
|
+
|
306
|
+
if (this.get('exists') && typeof(reporter.time) === "function") {
|
307
|
+
reporter.time(name);
|
308
|
+
return true;
|
309
|
+
}
|
310
|
+
return false;
|
311
|
+
},
|
312
|
+
|
313
|
+
/**
|
314
|
+
Ends the profile specified.
|
315
|
+
|
316
|
+
@param {String} name The name of the profile to end
|
317
|
+
@returns {Boolean} true if reporter.timeEnd exists, false otherwise
|
318
|
+
@see SC.Logger.time
|
319
|
+
*/
|
320
|
+
timeEnd: function(name) {
|
321
|
+
var reporter = this.get('reporter');
|
322
|
+
|
323
|
+
if (this.get('exists') && typeof(reporter.timeEnd) === "function") {
|
324
|
+
reporter.timeEnd(name);
|
325
|
+
return true;
|
326
|
+
}
|
327
|
+
return false;
|
328
|
+
},
|
329
|
+
|
330
|
+
/**
|
331
|
+
Prints a stack-trace.
|
332
|
+
|
333
|
+
@returns {Boolean} true if reporter.trace exists, false otherwise
|
334
|
+
*/
|
335
|
+
trace: function() {
|
336
|
+
var reporter = this.get('reporter');
|
337
|
+
|
338
|
+
if (this.get('exists') && typeof(reporter.trace) === "function") {
|
339
|
+
reporter.trace();
|
340
|
+
return true;
|
341
|
+
}
|
342
|
+
return false;
|
343
|
+
},
|
344
|
+
|
345
|
+
/**
|
346
|
+
Log a warning to the console.
|
347
|
+
|
348
|
+
Logs the warning using {@link SC.Logger.log} if reporter.warning does not exist and
|
349
|
+
{@link SC.Logger.fallBackOnLog} is true.
|
350
|
+
|
351
|
+
@param {String|Array|Function|Object}
|
352
|
+
@returns {Boolean} true if logged to reporter, false if not
|
353
|
+
*/
|
354
|
+
warn: function() {
|
355
|
+
var reporter = this.get('reporter');
|
356
|
+
|
357
|
+
if (this.get('exists') && typeof(reporter.warn) === "function") {
|
358
|
+
reporter.warn.apply(reporter, arguments);
|
359
|
+
return true;
|
360
|
+
}
|
361
|
+
else if (this.fallBackOnLog) {
|
362
|
+
var a = this._argumentsToArray(arguments);
|
363
|
+
if (typeof(a.unshift) === "function") a.unshift(SC.LOGGER_LOG_WARN);
|
364
|
+
return this.log.apply(this, a);
|
365
|
+
}
|
366
|
+
return false;
|
367
|
+
},
|
368
|
+
|
369
|
+
// ..........................................................
|
370
|
+
// INTERNAL SUPPORT
|
371
|
+
//
|
372
|
+
|
373
|
+
/**
|
374
|
+
@private
|
375
|
+
|
376
|
+
The arguments function property doesn't support Array#unshift. This helper
|
377
|
+
copies the elements of arguments to a blank array.
|
378
|
+
|
379
|
+
@param {Array} arguments The arguments property of a function
|
380
|
+
@returns {Array} An array containing the elements of arguments parameter
|
381
|
+
*/
|
382
|
+
_argumentsToArray: function(arguments) {
|
383
|
+
if (!arguments) return [];
|
384
|
+
var a = [];
|
385
|
+
for (var i = 0; i < arguments.length; i++) {
|
386
|
+
a[i] = arguments[i];
|
387
|
+
}
|
388
|
+
return a;
|
389
|
+
},
|
390
|
+
|
391
|
+
/**
|
392
|
+
@private
|
393
|
+
|
394
|
+
Formats the arguments array of a function by creating a string
|
395
|
+
with SC.LOGGER_LOG_DELIMITER between the elements.
|
396
|
+
|
397
|
+
@returns {String} A string of formatted arguments
|
398
|
+
*/
|
399
|
+
_argumentsToString: function() {
|
400
|
+
var s = "";
|
401
|
+
for (var i = 0; i<arguments.length - 1; i++) {
|
402
|
+
s += arguments[i] + SC.LOGGER_LOG_DELIMITER;
|
403
|
+
}
|
404
|
+
s += arguments[arguments.length-1];
|
405
|
+
return s;
|
406
|
+
}
|
407
|
+
|
408
|
+
});
|
@@ -121,7 +121,7 @@ SC._object_extend = function _object_extend(base, ext) {
|
|
121
121
|
while(--pathLoc >= 0) {
|
122
122
|
local = base._kvo_for(SC.keyFor('_kvo_local', paths[pathLoc]), SC.Set);
|
123
123
|
local.add(key);
|
124
|
-
base._kvo_for('_kvo_observed_keys', SC.
|
124
|
+
base._kvo_for('_kvo_observed_keys', SC.CoreSet).add(paths[pathLoc]);
|
125
125
|
}
|
126
126
|
|
127
127
|
// handle computed properties
|
@@ -145,6 +145,20 @@ SC._object_extend = function _object_extend(base, ext) {
|
|
145
145
|
// copy property
|
146
146
|
base[key] = value ;
|
147
147
|
}
|
148
|
+
|
149
|
+
// Manually set base on toString() because some JS engines (such as IE8) do
|
150
|
+
// not enumerate it
|
151
|
+
if (ext.hasOwnProperty('toString')) {
|
152
|
+
key = 'toString';
|
153
|
+
// get the value. use concats if defined
|
154
|
+
value = (concats.hasOwnProperty(key) ? concats[key] : null) || ext[key] ;
|
155
|
+
if (!value.superclass && (value !== (cur=base[key]))) {
|
156
|
+
value.superclass = value.base = cur || K ;
|
157
|
+
}
|
158
|
+
// copy property
|
159
|
+
base[key] = value ;
|
160
|
+
}
|
161
|
+
|
148
162
|
|
149
163
|
// copy bindings, observers, and properties
|
150
164
|
base._bindings = bindings || [];
|
@@ -152,9 +166,6 @@ SC._object_extend = function _object_extend(base, ext) {
|
|
152
166
|
base._properties = properties || [] ;
|
153
167
|
base.outlets = outlets || [];
|
154
168
|
|
155
|
-
// toString is usually skipped. Don't do that!
|
156
|
-
if (ext.hasOwnProperty('toString')) base.toString = ext.toString;
|
157
|
-
|
158
169
|
return base ;
|
159
170
|
} ;
|
160
171
|
|
@@ -86,6 +86,9 @@ SC.SelectionSet = SC.Object.extend(SC.Enumerable, SC.Freezable, SC.Copyable,
|
|
86
86
|
// try to find in cache
|
87
87
|
if (!cache) cache = this._indexSetCache = {};
|
88
88
|
ret = cache[SC.guidFor(source)];
|
89
|
+
if (ret && ret._sourceRevision && (ret._sourceRevision !== source.propertyRevision)) {
|
90
|
+
ret = null;
|
91
|
+
}
|
89
92
|
|
90
93
|
// not in cache. generate from index sets and any saved objects
|
91
94
|
if (!ret) {
|
@@ -102,7 +105,10 @@ SC.SelectionSet = SC.Object.extend(SC.Enumerable, SC.Freezable, SC.Copyable,
|
|
102
105
|
}, this);
|
103
106
|
}
|
104
107
|
|
105
|
-
if (ret)
|
108
|
+
if (ret) {
|
109
|
+
ret = cache[SC.guidFor(source)] = ret.frozenCopy();
|
110
|
+
ret._sourceRevision = source.propertyRevision;
|
111
|
+
}
|
106
112
|
}
|
107
113
|
|
108
114
|
return ret;
|
@@ -241,14 +247,36 @@ SC.SelectionSet = SC.Object.extend(SC.Enumerable, SC.Freezable, SC.Copyable,
|
|
241
247
|
}
|
242
248
|
}
|
243
249
|
|
250
|
+
// save starter info
|
244
251
|
set = this._indexSetForSource(source, YES);
|
245
252
|
oldlen = this.get('length');
|
246
253
|
newlen = oldlen - set.get('length');
|
247
|
-
|
254
|
+
|
255
|
+
// if we have objects selected, determine if they are in the index
|
256
|
+
// set and remove them as well.
|
257
|
+
if (set && (objects = this._objects)) {
|
258
|
+
|
259
|
+
// convert start/length to index set so the iterator below will work...
|
260
|
+
if (length !== undefined) {
|
261
|
+
start = SC.IndexSet.create(start, length);
|
262
|
+
length = undefined;
|
263
|
+
}
|
264
|
+
|
265
|
+
objects.forEach(function(object) {
|
266
|
+
idx = source.indexOf(object);
|
267
|
+
if (start.contains(idx)) {
|
268
|
+
objects.remove(object);
|
269
|
+
newlen--;
|
270
|
+
}
|
271
|
+
}, this);
|
272
|
+
}
|
273
|
+
|
274
|
+
// remove indexes from source index set
|
248
275
|
set.remove(start, length);
|
249
276
|
setlen = set.get('length');
|
250
277
|
newlen += setlen;
|
251
278
|
|
279
|
+
// update caches; change enumerable...
|
252
280
|
this._indexSetCache = null;
|
253
281
|
if (newlen !== oldlen) {
|
254
282
|
this.propertyDidChange('length');
|
@@ -3,6 +3,8 @@
|
|
3
3
|
// ========================================================================
|
4
4
|
/*globals module test */
|
5
5
|
|
6
|
+
var StringA, StringB, StringC;
|
7
|
+
|
6
8
|
module("String's - isEqual", {
|
7
9
|
|
8
10
|
setup: function(){
|
@@ -18,6 +20,8 @@ test("strings should be equal ",function(){
|
|
18
20
|
equals(SC.isEqual(StringA,StringC),true);
|
19
21
|
});
|
20
22
|
|
23
|
+
var num1, num2, num3;
|
24
|
+
|
21
25
|
module("Number's - isEqual",{
|
22
26
|
|
23
27
|
setup: function(){
|
@@ -33,7 +37,7 @@ test("numericals should be equal ",function(){
|
|
33
37
|
equals(SC.isEqual(num1,num3),false);
|
34
38
|
});
|
35
39
|
|
36
|
-
var objectA,objectB; //global variables
|
40
|
+
var objectA,objectB, objectC; //global variables
|
37
41
|
|
38
42
|
module("Array's - isEqual",{
|
39
43
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
// ========================================================================
|
4
4
|
/*globals module test ok isObj equals expects */
|
5
5
|
|
6
|
-
var objectA, objectB ; // global variables
|
6
|
+
var objectA, objectB , arrayA, stringA; // global variables
|
7
7
|
|
8
8
|
module("Beget function Module", {
|
9
9
|
setup: function() {
|
@@ -23,7 +23,7 @@ module("SC.compare()", {
|
|
23
23
|
v[10] = [1,3];
|
24
24
|
v[11] = {a: 'hash'};
|
25
25
|
v[12] = SC.Object.create();
|
26
|
-
v[13] = function (a) {return a};
|
26
|
+
v[13] = function (a) {return a;};
|
27
27
|
}
|
28
28
|
});
|
29
29
|
|
@@ -37,8 +37,8 @@ test("ordering should work", function() {
|
|
37
37
|
equals(SC.compare(v[j],v[j]), 0, j +' should equal itself');
|
38
38
|
for (var i=j+1; i < v.length; i++) {
|
39
39
|
equals(SC.compare(v[j],v[i]), -1, 'v[' + j + '] (' + SC.typeOf(v[j]) + ') should be smaller than v[' + i + '] (' + SC.typeOf(v[i]) + ')' );
|
40
|
-
}
|
40
|
+
}
|
41
41
|
|
42
|
-
}
|
42
|
+
}
|
43
43
|
});
|
44
44
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
var object;
|
1
2
|
module("item type", {
|
2
3
|
setup: function() {
|
3
4
|
object = SC.Object.create({
|
@@ -12,7 +13,7 @@ module("item type", {
|
|
12
13
|
});
|
13
14
|
|
14
15
|
test("should return the type for the passed item", function() {
|
15
|
-
a = null;
|
16
|
+
var a = null;
|
16
17
|
var arr = [1,2,3];
|
17
18
|
var obj = {};
|
18
19
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
// ========================================================================
|
4
4
|
/*globals module test */
|
5
5
|
|
6
|
-
var object1,object3; //global variables
|
6
|
+
var object, object1,object3; //global variables
|
7
7
|
|
8
8
|
module("Checking the tuple for property path",{
|
9
9
|
|
@@ -33,5 +33,5 @@ test("should check for the tuple property", function() {
|
|
33
33
|
test("should check for the tuple property when path is undefined",function(){ //test case where no property defined
|
34
34
|
var object2;
|
35
35
|
object2 = SC.tupleForPropertyPath(object.value,'');
|
36
|
-
equals(YES,object2
|
36
|
+
equals(YES,object2 === null,'returns null for undefined path');
|
37
37
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
// ========================================================================
|
4
4
|
/*globals module test ok isObj equals expects */
|
5
5
|
|
6
|
-
var fromObject, toObject, binding ; // global variables
|
6
|
+
var fromObject, toObject, binding, Bon1, bon2 ; // global variables
|
7
7
|
|
8
8
|
module("basic object binding", {
|
9
9
|
|
@@ -190,12 +190,12 @@ module("Custom Binding", {
|
|
190
190
|
});
|
191
191
|
|
192
192
|
test("Binding value1 such that it will recieve only single values", function() {
|
193
|
-
bon1 = Bon1.create({
|
193
|
+
var bon1 = Bon1.create({
|
194
194
|
value1Binding: SC.Binding.single("TestNamespace.bon2.val1"),
|
195
195
|
array1Binding: SC.Binding.single("TestNamespace.bon2.arr")
|
196
196
|
});
|
197
197
|
SC.Binding.flushPendingChanges();
|
198
|
-
var a =
|
198
|
+
var a = [23,31,12,21];
|
199
199
|
bon2.set("arr", a);
|
200
200
|
bon2.set("val1","changed");
|
201
201
|
SC.Binding.flushPendingChanges();
|
@@ -205,7 +205,7 @@ test("Binding value1 such that it will recieve only single values", function() {
|
|
205
205
|
});
|
206
206
|
|
207
207
|
test("Single binding using notEmpty function.", function() {
|
208
|
-
bond = Bon1.create ({
|
208
|
+
var bond = Bon1.create ({
|
209
209
|
array1Binding: SC.Binding.single("TestNamespace.bon2.arr").notEmpty(null,'(EMPTY)')
|
210
210
|
});
|
211
211
|
SC.Binding.flushPendingChanges();
|
@@ -215,7 +215,7 @@ test("Single binding using notEmpty function.", function() {
|
|
215
215
|
});
|
216
216
|
|
217
217
|
test("Binding with transforms, function to check the type of value", function() {
|
218
|
-
jon = Bon1.create({
|
218
|
+
var jon = Bon1.create({
|
219
219
|
value1Binding: SC.Binding.transform(function(val1) {
|
220
220
|
return (SC.typeOf(val1) == SC.T_STRING)? val1 : "";
|
221
221
|
}).from("TestNamespace.bon2.val1")
|
@@ -232,11 +232,13 @@ test("two bindings to the same value should sync in the order they are initializ
|
|
232
232
|
|
233
233
|
SC.RunLoop.begin();
|
234
234
|
|
235
|
-
|
235
|
+
window.a = SC.Object.create({
|
236
236
|
foo: "bar"
|
237
237
|
});
|
238
238
|
|
239
|
-
var
|
239
|
+
var a = window.a;
|
240
|
+
|
241
|
+
window.b = SC.Object.create({
|
240
242
|
foo: "baz",
|
241
243
|
fooBinding: "a.foo",
|
242
244
|
|
@@ -251,6 +253,8 @@ test("two bindings to the same value should sync in the order they are initializ
|
|
251
253
|
}
|
252
254
|
|
253
255
|
});
|
256
|
+
|
257
|
+
var b = window.b;
|
254
258
|
|
255
259
|
SC.LOG_BINDINGS = YES;
|
256
260
|
|