sproutit-sproutcore 1.0.20090721145236 → 1.0.20090721145251
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +189 -54
- data/VERSION.yml +5 -0
- data/frameworks/sproutcore/Buildfile +64 -0
- data/frameworks/sproutcore/HISTORY +682 -0
- data/frameworks/sproutcore/README +23 -0
- data/frameworks/sproutcore/apps/docs/core.js +27 -0
- data/frameworks/sproutcore/apps/docs/english.lproj/loading.rhtml +9 -0
- data/frameworks/sproutcore/apps/docs/english.lproj/main_page.js +22 -0
- data/frameworks/sproutcore/apps/docs/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/apps/docs/main.js +30 -0
- data/frameworks/sproutcore/apps/tests/controllers/detail.js +16 -0
- data/frameworks/sproutcore/apps/tests/controllers/source.js +29 -0
- data/frameworks/sproutcore/apps/tests/controllers/target.js +26 -0
- data/frameworks/sproutcore/apps/tests/controllers/targets.js +86 -0
- data/frameworks/sproutcore/apps/tests/controllers/tests.js +33 -0
- data/frameworks/sproutcore/apps/tests/core.js +133 -0
- data/frameworks/sproutcore/apps/tests/data_source.js +96 -0
- data/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +9 -0
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +39 -0
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +232 -0
- data/frameworks/sproutcore/apps/tests/english.lproj/strings.js +26 -0
- data/frameworks/sproutcore/apps/tests/fixtures/target.js +87 -0
- data/frameworks/sproutcore/apps/tests/fixtures/test.js +44 -0
- data/frameworks/sproutcore/apps/tests/main.js +28 -0
- data/frameworks/sproutcore/apps/tests/models/target.js +92 -0
- data/frameworks/sproutcore/apps/tests/models/test.js +48 -0
- data/frameworks/sproutcore/apps/tests/states/no_targets.js +26 -0
- data/frameworks/sproutcore/apps/tests/states/ready.js +56 -0
- data/frameworks/sproutcore/apps/tests/states/ready_detail.js +41 -0
- data/frameworks/sproutcore/apps/tests/states/ready_empty.js +48 -0
- data/frameworks/sproutcore/apps/tests/states/ready_list.js +41 -0
- data/frameworks/sproutcore/apps/tests/states/ready_loading.js +44 -0
- data/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +31 -0
- data/frameworks/sproutcore/apps/tests/states/start.js +39 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/detail.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/source.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/target.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/targets.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/tests.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/models/target.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/models/test.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/views/offset_checkbox.js +15 -0
- data/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +26 -0
- data/frameworks/sproutcore/apps/welcome/core.js +23 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/loading.rhtml +8 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +43 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/apps/welcome/main.js +36 -0
- data/frameworks/sproutcore/design/Record State Table.numbers +0 -0
- data/frameworks/sproutcore/frameworks/datastore/core.js +14 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +113 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +273 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +311 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures_with_queries.js +238 -0
- data/frameworks/sproutcore/frameworks/datastore/debug/json.js +71 -0
- data/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +96 -0
- data/frameworks/sproutcore/frameworks/datastore/fixtures/author_fixtures.js +2503 -0
- data/frameworks/sproutcore/frameworks/datastore/fixtures/sample.js +17 -0
- data/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +92 -0
- data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +54 -0
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +561 -0
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +423 -0
- data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +158 -0
- data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +488 -0
- data/frameworks/sproutcore/frameworks/datastore/system/query.js +979 -0
- data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +287 -0
- data/frameworks/sproutcore/frameworks/datastore/system/store.js +2007 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +121 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +114 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +91 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +56 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +94 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +30 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +73 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +238 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +48 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +42 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +138 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +46 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +71 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +204 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +178 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +40 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +117 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +135 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +110 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +99 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +180 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +126 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +163 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +166 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare_records.js +126 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +165 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +82 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/find_all.js +362 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parsing.js +170 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +43 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +60 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +67 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +164 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +54 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +126 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +126 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +73 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +72 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +78 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +249 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +106 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +21 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +61 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +74 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +74 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +74 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +144 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +137 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +130 -0
- data/frameworks/sproutcore/frameworks/debug/core.js +61 -0
- data/frameworks/sproutcore/frameworks/deprecated/core.js +59 -0
- data/frameworks/sproutcore/frameworks/deprecated/lib/button_views.rb +330 -0
- data/frameworks/sproutcore/frameworks/deprecated/lib/collection_view.rb +83 -0
- data/frameworks/sproutcore/frameworks/deprecated/lib/core_views.rb +326 -0
- data/frameworks/sproutcore/frameworks/deprecated/lib/form_views.rb +253 -0
- data/frameworks/sproutcore/frameworks/deprecated/lib/index.rhtml +75 -0
- data/frameworks/sproutcore/frameworks/deprecated/lib/menu_views.rb +93 -0
- data/frameworks/sproutcore/frameworks/deprecated/server/rails_server.js +80 -0
- data/frameworks/sproutcore/frameworks/deprecated/server/rest_server.js +178 -0
- data/frameworks/sproutcore/frameworks/deprecated/server/server.js +673 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/animator.js +679 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/binding.js +36 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/browser.js +75 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/classic_responder.js +312 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/event.js +58 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/globals.js +20 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/misc.js +58 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/node_descriptor.js +72 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/object.js +122 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/path_module.js +432 -0
- data/frameworks/sproutcore/frameworks/deprecated/system/string.js +107 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/application/application.rhtml +125 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/clippingFrame.rhtml +401 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/frame.rhtml +357 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/isVisibleInWindow.rhtml +147 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/base.rhtml +298 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/incremental_rendering.rhtml +260 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/source_list_rendering.rhtml +143 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/popup_button.rhtml +128 -0
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml +37 -0
- data/frameworks/sproutcore/frameworks/deprecated/views/collection.js +24 -0
- data/frameworks/sproutcore/frameworks/designer/coders/design.js +29 -0
- data/frameworks/sproutcore/frameworks/designer/coders/localization.js +27 -0
- data/frameworks/sproutcore/frameworks/designer/coders/object.js +347 -0
- data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +102 -0
- data/frameworks/sproutcore/frameworks/designer/css/css_rule.js +22 -0
- data/frameworks/sproutcore/frameworks/designer/css/css_style.js +29 -0
- data/frameworks/sproutcore/frameworks/designer/css/css_style_sheet.js +201 -0
- data/frameworks/sproutcore/frameworks/designer/ext/page.js +86 -0
- data/frameworks/sproutcore/frameworks/designer/ext/view.js +38 -0
- data/frameworks/sproutcore/frameworks/designer/views/controls/button.js +17 -0
- data/frameworks/sproutcore/frameworks/designer/views/designer.js +569 -0
- data/frameworks/sproutcore/frameworks/designer/views/label.js +16 -0
- data/frameworks/sproutcore/frameworks/designer/views/mixins/button.js +11 -0
- data/frameworks/sproutcore/frameworks/designer/views/tab.js +16 -0
- data/frameworks/sproutcore/frameworks/desktop/core.js +6 -0
- data/frameworks/sproutcore/frameworks/desktop/debug/drag.js +41 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +56 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/a_sample_image.jpg +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/apple-logo1.jpeg +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/iframe.html +23 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +71 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +6 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +943 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_222222.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_454545.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_888888.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_ffffff.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/indicator.gif +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-x.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-y.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/000000.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/ffffff.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sticky-note.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +209 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +100 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +5 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +95 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +39 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +31 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +10 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/scroller.css +26 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +141 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +19 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +62 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +70 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +9 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +14 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +12 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/toolbar.css +6 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/border.js +53 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +22 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +61 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +283 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +247 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +408 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +651 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/modal.js +68 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +63 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +184 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +400 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +46 -0
- data/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +39 -0
- data/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +81 -0
- data/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +175 -0
- data/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +280 -0
- data/frameworks/sproutcore/frameworks/desktop/system/drag.js +827 -0
- data/frameworks/sproutcore/frameworks/desktop/system/key_bindings.js +40 -0
- data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +641 -0
- data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +187 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +43 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +152 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +55 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +59 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +35 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +40 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +84 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +38 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +45 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +159 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +144 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +99 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +249 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +82 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +199 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +288 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +65 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +88 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +165 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +121 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +177 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +240 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +191 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +197 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +141 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +182 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +64 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +183 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +133 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +132 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +56 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +167 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +127 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +284 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +44 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +128 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +240 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +113 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +202 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +139 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +111 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +102 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +70 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +95 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +222 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +81 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +100 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +37 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +50 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +52 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +231 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +54 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +88 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +110 -0
- data/frameworks/sproutcore/frameworks/desktop/views/button.js +331 -0
- data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +105 -0
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +2757 -0
- data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +44 -0
- data/frameworks/sproutcore/frameworks/desktop/views/form.js +594 -0
- data/frameworks/sproutcore/frameworks/desktop/views/grid.js +201 -0
- data/frameworks/sproutcore/frameworks/desktop/views/list.js +540 -0
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +660 -0
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +587 -0
- data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +68 -0
- data/frameworks/sproutcore/frameworks/desktop/views/progress.js +207 -0
- data/frameworks/sproutcore/frameworks/desktop/views/radio.js +332 -0
- data/frameworks/sproutcore/frameworks/desktop/views/scene.js +204 -0
- data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +690 -0
- data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +226 -0
- data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +525 -0
- data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +331 -0
- data/frameworks/sproutcore/frameworks/desktop/views/separator.js +37 -0
- data/frameworks/sproutcore/frameworks/desktop/views/slider.js +180 -0
- data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +47 -0
- data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +169 -0
- data/frameworks/sproutcore/frameworks/desktop/views/split.js +677 -0
- data/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +55 -0
- data/frameworks/sproutcore/frameworks/desktop/views/stacked.js +101 -0
- data/frameworks/sproutcore/frameworks/desktop/views/tab.js +191 -0
- data/frameworks/sproutcore/frameworks/desktop/views/thumb.js +49 -0
- data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +49 -0
- data/frameworks/sproutcore/frameworks/desktop/views/web.js +86 -0
- data/frameworks/sproutcore/frameworks/foundation/TESTING +46 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +509 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +45 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +323 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +109 -0
- data/frameworks/sproutcore/frameworks/foundation/core.js +136 -0
- data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +194 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/blank.gif +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +68 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +55 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +221 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +9 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-logo.png +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +30 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/static_layout.css +5 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +45 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +45 -0
- data/frameworks/sproutcore/frameworks/foundation/ext/object.js +81 -0
- data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +158 -0
- data/frameworks/sproutcore/frameworks/foundation/fixtures/file_exists.json +1 -0
- data/frameworks/sproutcore/frameworks/foundation/license.js +19 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +299 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +171 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +88 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +352 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +146 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +462 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +232 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +132 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +251 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +159 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +176 -0
- data/frameworks/sproutcore/frameworks/foundation/panes/main.js +47 -0
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +584 -0
- data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +887 -0
- data/frameworks/sproutcore/frameworks/foundation/protocols/inline_editor_delegate.js +84 -0
- data/frameworks/sproutcore/frameworks/foundation/system/application.js +36 -0
- data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +492 -0
- data/frameworks/sproutcore/frameworks/foundation/system/browser.js +64 -0
- data/frameworks/sproutcore/frameworks/foundation/system/builder.js +210 -0
- data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +2015 -0
- data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +129 -0
- data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +729 -0
- data/frameworks/sproutcore/frameworks/foundation/system/error.js +93 -0
- data/frameworks/sproutcore/frameworks/foundation/system/event.js +853 -0
- data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +433 -0
- data/frameworks/sproutcore/frameworks/foundation/system/json.js +440 -0
- data/frameworks/sproutcore/frameworks/foundation/system/locale.js +288 -0
- data/frameworks/sproutcore/frameworks/foundation/system/page.js +106 -0
- data/frameworks/sproutcore/frameworks/foundation/system/ready.js +195 -0
- data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +904 -0
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +380 -0
- data/frameworks/sproutcore/frameworks/foundation/system/responder.js +120 -0
- data/frameworks/sproutcore/frameworks/foundation/system/responder_context.js +243 -0
- data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +391 -0
- data/frameworks/sproutcore/frameworks/foundation/system/routes.js +487 -0
- data/frameworks/sproutcore/frameworks/foundation/system/time.js +478 -0
- data/frameworks/sproutcore/frameworks/foundation/system/timer.js +549 -0
- data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +165 -0
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +425 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +182 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +193 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +64 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +136 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/empty_case.js +82 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/multiple_case.js +111 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_case.js +193 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_enumerable_case.js +179 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +108 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +113 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +113 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/content.js +195 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +89 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +35 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/content.js +168 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +89 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +128 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +17 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +325 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +718 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +484 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +42 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +1323 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_dimensions.js +387 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_selector.js +405 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/setClass.js +49 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/within.js +66 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +151 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/error.js +41 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/json.js +14 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +128 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/begin.js +47 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/element.js +44 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/end.js +119 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +51 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +50 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +28 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +179 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +100 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/init.js +55 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/join.js +28 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/push_text.js +74 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +45 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +205 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +127 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeKeyPane.js +124 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMainPane.js +68 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/root_responder.js +101 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +238 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/routes.js +33 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invalidate.js +38 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invokeLater.js +201 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +71 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +67 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/schedule.js +170 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js +27 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/normalizeURL.js +18 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/range.js +62 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +35 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +23 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +47 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js +13 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +10 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +83 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +39 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +148 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/main_pane.js +31 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +89 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/firstResponder.js +148 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/keyPane.js +133 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendEvent.js +165 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +76 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +250 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +133 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +246 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +122 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createLayer.js +97 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +85 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +52 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/init.js +50 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +200 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisible.js +51 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisibleInWindow.js +113 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layer.js +150 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutChildViews.js +162 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutDidChange.js +127 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +328 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/parentViewDidChange.js +67 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +166 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/removeChild.js +189 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/render.js +83 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/replaceChild.js +29 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +146 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayerLocation.js +194 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/viewDidResize.js +185 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +125 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/date.js +52 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/email.js +45 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +33 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/number.js +82 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/password.js +86 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +311 -0
- data/frameworks/sproutcore/frameworks/foundation/views/container.js +136 -0
- data/frameworks/sproutcore/frameworks/foundation/views/field.js +287 -0
- data/frameworks/sproutcore/frameworks/foundation/views/image.js +161 -0
- data/frameworks/sproutcore/frameworks/foundation/views/label.js +271 -0
- data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +257 -0
- data/frameworks/sproutcore/frameworks/foundation/views/view.js +2405 -0
- data/frameworks/sproutcore/frameworks/mobile/english.lproj/core.css +12 -0
- data/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml +126 -0
- data/frameworks/sproutcore/frameworks/mobile/system/root_responder.js +109 -0
- data/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js +9 -0
- data/frameworks/sproutcore/frameworks/mobile/views/button.js +190 -0
- data/frameworks/sproutcore/frameworks/runtime/README +12 -0
- data/frameworks/sproutcore/frameworks/runtime/core.js +856 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +238 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +33 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +121 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +34 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +50 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +46 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +371 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +100 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +49 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +94 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +50 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +47 -0
- data/frameworks/sproutcore/frameworks/runtime/license.js +28 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +613 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +64 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +108 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1258 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +104 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1305 -0
- data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +141 -0
- data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +148 -0
- data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +152 -0
- data/frameworks/sproutcore/frameworks/runtime/protocols/observable_protocol.js +40 -0
- data/frameworks/sproutcore/frameworks/runtime/protocols/sparse_array_delegate.js +131 -0
- data/frameworks/sproutcore/frameworks/runtime/system/binding.js +915 -0
- data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +107 -0
- data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +1166 -0
- data/frameworks/sproutcore/frameworks/runtime/system/object.js +801 -0
- data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +265 -0
- data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +241 -0
- data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +649 -0
- data/frameworks/sproutcore/frameworks/runtime/system/set.js +375 -0
- data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +295 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +56 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +23 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +66 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +44 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/console.js +16 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +147 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +25 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +38 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/keys.js +20 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +30 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +19 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +37 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +57 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +611 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +587 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +132 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +79 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +80 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +55 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +265 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +195 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +43 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +74 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +42 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +38 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +38 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +74 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +40 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +40 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +36 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +189 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +89 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +135 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +339 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +59 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +75 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +117 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +110 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +65 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +120 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/add.js +92 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +17 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +85 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/isEqual.js +60 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +87 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +292 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +122 -0
- data/frameworks/sproutcore/frameworks/testing/core.js +196 -0
- data/frameworks/sproutcore/frameworks/testing/english.lproj/additions.css +8 -0
- data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +126 -0
- data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +131 -0
- data/frameworks/sproutcore/frameworks/testing/extras.js +17 -0
- data/frameworks/sproutcore/frameworks/testing/jquery.js +3559 -0
- data/frameworks/sproutcore/frameworks/testing/qunit.js +827 -0
- data/frameworks/sproutcore/frameworks/testing/system/dump.js +205 -0
- data/frameworks/sproutcore/frameworks/testing/system/equiv.js +201 -0
- data/frameworks/sproutcore/frameworks/testing/system/plan.js +691 -0
- data/frameworks/sproutcore/frameworks/testing/system/runner.js +209 -0
- data/frameworks/sproutcore/frameworks/testing/system/suite.js +228 -0
- data/frameworks/sproutcore/frameworks/testing/utils.js +62 -0
- data/frameworks/sproutcore/lib/index.rhtml +121 -0
- data/frameworks/sproutcore/license.js +28 -0
- data/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +69 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/button.css +41 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/core.css +8 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/backButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/blueButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/cancel.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/grayButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/leftButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrow.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrowSel.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listGroup.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/loading.gif +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/pinstripes.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/rightButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/selection.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/thumb.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggle.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggleOn.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolbar.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/whiteButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +331 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +91 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +134 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/core.css +60 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +55 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-ysprite.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-toolbar-view.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/label.css +11 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +30 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/pane.css +8 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/background-fat.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/background-thin.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-left-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-right-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/left-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/overlay.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/right-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-left-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-right-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +26 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +122 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +279 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/slider.css +94 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +27 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +18 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +10 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/toolbar.css +7 -0
- data/lib/sproutcore.rb +9 -1
- data/lib/sproutcore/tools/build.rb +1 -1
- data/lib/thor/CHANGELOG.rdoc +52 -0
- data/lib/thor/LICENSE +20 -0
- data/lib/thor/README.markdown +76 -0
- data/lib/thor/Rakefile +6 -0
- data/lib/thor/Thorfile +45 -0
- data/lib/thor/bin/rake2thor +83 -0
- data/lib/thor/bin/thor +7 -0
- data/lib/thor/lib/thor.rb +170 -0
- data/lib/thor/lib/thor/error.rb +3 -0
- data/lib/thor/lib/thor/options.rb +267 -0
- data/lib/thor/lib/thor/ordered_hash.rb +64 -0
- data/lib/thor/lib/thor/runner.rb +305 -0
- data/lib/thor/lib/thor/task.rb +83 -0
- data/lib/thor/lib/thor/task_hash.rb +22 -0
- data/lib/thor/lib/thor/tasks.rb +77 -0
- data/lib/thor/lib/thor/tasks/package.rb +18 -0
- data/lib/thor/lib/thor/util.rb +75 -0
- data/lib/thor/script/destroy +14 -0
- data/lib/thor/script/generate +14 -0
- data/lib/thor/task.thor +15 -0
- metadata +664 -351
- data/VERSION +0 -1
- data/spec/buildtasks/build/copy_spec.rb +0 -60
- data/spec/buildtasks/build/spec_helper.rb +0 -36
- data/spec/buildtasks/manifest/catalog_spec.rb +0 -48
- data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +0 -125
- data/spec/buildtasks/manifest/localize_spec.rb +0 -97
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +0 -246
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +0 -87
- data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +0 -175
- data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +0 -65
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +0 -70
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +0 -152
- data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +0 -98
- data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +0 -64
- data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +0 -163
- data/spec/buildtasks/manifest/prepare_spec.rb +0 -43
- data/spec/buildtasks/manifest/spec_helper.rb +0 -35
- data/spec/buildtasks/target_spec.rb +0 -214
- data/spec/fixtures/builder_tests/Buildfile +0 -15
- data/spec/fixtures/builder_tests/apps/combine_test/a.js +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/b.js +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/c.js +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +0 -2
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/icons/image.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/image.jpg +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/rhtml_sample.rhtml +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +0 -4
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/style.css +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/french-icons/fr.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/strings.js +0 -4
- data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +0 -15
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +0 -4
- data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +0 -7
- data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +0 -3
- data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +0 -8
- data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +0 -9
- data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +0 -12
- data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +0 -1
- data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +0 -3
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +0 -1
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +0 -1
- data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +0 -4
- data/spec/fixtures/builder_tests/frameworks/debug/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/debug/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/strings.js +0 -4
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +0 -1
- data/spec/fixtures/builder_tests/frameworks/req_target_1/req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/req_style_2.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/test.rhtml +0 -1
- data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +0 -1
- data/spec/fixtures/builder_tests/frameworks/req_target_2/lib/alt_layout.rhtml +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/req_js_2.js +0 -0
- data/spec/fixtures/builder_tests/themes/sample_theme/Buildfile +0 -1
- data/spec/fixtures/buildfiles/basic/Buildfile +0 -16
- data/spec/fixtures/buildfiles/basic/task_module.rake +0 -6
- data/spec/fixtures/buildfiles/installed/Buildfile +0 -7
- data/spec/fixtures/buildfiles/installed/Buildfile2 +0 -5
- data/spec/fixtures/buildfiles/project_test/Buildfile +0 -4
- data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +0 -2
- data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/Buildfile +0 -1
- data/spec/fixtures/entry_for_project/apps/test_app/entry.txt +0 -0
- data/spec/fixtures/entry_for_project/apps/test_app/frameworks/nested/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/Buildfile +0 -8
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/Buildfile +0 -5
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/foos/not_foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/nested/Buildfile +0 -8
- data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +0 -1
- data/spec/fixtures/find_targets/nested/apps/app1/apps/nested_app/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/clients/client1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme2/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/English.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/FreNCH.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/UnknOWN.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/english.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/french.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/german.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/italian.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/japanese.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/spanish.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/unknown.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/no_names/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/de.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-CA.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-GB.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-US.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/es.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/foo.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/fr.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/it.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/ja.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/1.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/B.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/a.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/c.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/core.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/B.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/b.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/b/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/c.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/lproj/strings.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +0 -1
- data/spec/fixtures/ordered_entries/apps/with_requires/a.js +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/b.js +0 -3
- data/spec/fixtures/ordered_entries/apps/with_requires/c.js +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +0 -1
- data/spec/fixtures/real_world/Buildfile +0 -12
- data/spec/fixtures/real_world/apps/account/README +0 -1
- data/spec/fixtures/real_world/apps/calendar/README +0 -1
- data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +0 -1
- data/spec/fixtures/real_world/apps/files/README +0 -1
- data/spec/fixtures/real_world/apps/mail/README +0 -1
- data/spec/fixtures/real_world/apps/mobile_photos/README +0 -1
- data/spec/fixtures/real_world/apps/photos/README +0 -1
- data/spec/fixtures/real_world/apps/uploader/README +0 -1
- data/spec/fixtures/real_world/frameworks/core_files/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/core_photos/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +0 -26
- data/spec/fixtures/real_world/frameworks/sproutcore/README +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/test_runner/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/debug-resource.html +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/sample_debug.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/demo2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/debug/sample_debug-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.css +0 -4
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo2.sass +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.haml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.html.erb +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.rhtml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/fixtures/sample_fixtures-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/has_require.css +0 -4
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/protocols/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.css +0 -6
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +0 -3
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/tests/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample-json-fixture.json +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample_fixtures.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/application/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/costello/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/data_store/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/debug/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/desktop/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/empty_theme/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/foundation/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/mobile/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/qunit/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/uploader/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/french-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/strings.js +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/german-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/strings.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/has_require.js +0 -4
- data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +0 -6
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample1.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.rhtml +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +0 -1
- data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
- data/spec/fixtures/recursive_project/Buildfile +0 -8
- data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
- data/spec/lib/builders/combine_spec.rb +0 -67
- data/spec/lib/builders/html_spec.rb +0 -577
- data/spec/lib/builders/javascript_spec.rb +0 -81
- data/spec/lib/builders/sass_spec.rb +0 -43
- data/spec/lib/builders/spec_helper.rb +0 -30
- data/spec/lib/builders/strings_spec.rb +0 -52
- data/spec/lib/builders/stylesheet_spec.rb +0 -63
- data/spec/lib/builders/test_index_spec.rb +0 -44
- data/spec/lib/builders/test_spec.rb +0 -135
- data/spec/lib/buildfile/config_for_spec.rb +0 -81
- data/spec/lib/buildfile/define_spec.rb +0 -59
- data/spec/lib/buildfile/dup_spec.rb +0 -65
- data/spec/lib/buildfile/invoke_spec.rb +0 -130
- data/spec/lib/buildfile/load_spec.rb +0 -49
- data/spec/lib/buildfile/task/dup_spec.rb +0 -55
- data/spec/lib/buildfile/task_defined_spec.rb +0 -17
- data/spec/lib/buildfile_commands/build_task_spec.rb +0 -19
- data/spec/lib/buildfile_commands/config_spec.rb +0 -97
- data/spec/lib/buildfile_commands/import_spec.rb +0 -17
- data/spec/lib/buildfile_commands/namespace_spec.rb +0 -18
- data/spec/lib/buildfile_commands/proxies_spec.rb +0 -38
- data/spec/lib/buildfile_commands/replace_task_spec.rb +0 -29
- data/spec/lib/buildfile_commands/task_spec.rb +0 -36
- data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +0 -26
- data/spec/lib/models/hash_struct/deep_clone_spec.rb +0 -27
- data/spec/lib/models/hash_struct/has_options_spec.rb +0 -32
- data/spec/lib/models/hash_struct/hash_spec.rb +0 -64
- data/spec/lib/models/hash_struct/merge_spec.rb +0 -26
- data/spec/lib/models/hash_struct/method_missing.rb +0 -41
- data/spec/lib/models/manifest/add_entry_spec.rb +0 -36
- data/spec/lib/models/manifest/add_transform_spec.rb +0 -90
- data/spec/lib/models/manifest/build_spec.rb +0 -78
- data/spec/lib/models/manifest/entry_for_spec.rb +0 -94
- data/spec/lib/models/manifest/find_entry.rb +0 -84
- data/spec/lib/models/manifest/prepare_spec.rb +0 -62
- data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +0 -31
- data/spec/lib/models/manifest_entry/prepare_spec.rb +0 -54
- data/spec/lib/models/project/add_target_spec.rb +0 -44
- data/spec/lib/models/project/buildfile_spec.rb +0 -35
- data/spec/lib/models/project/find_targets_for_spec.rb +0 -77
- data/spec/lib/models/project/load_nearest_project_spec.rb +0 -23
- data/spec/lib/models/project/target_for_spec.rb +0 -33
- data/spec/lib/models/project/targets_spec.rb +0 -62
- data/spec/lib/models/target/compute_build_number_spec.rb +0 -125
- data/spec/lib/models/target/config_spec.rb +0 -30
- data/spec/lib/models/target/expand_required_targets_spec.rb +0 -48
- data/spec/lib/models/target/installed_languages_spec.rb +0 -47
- data/spec/lib/models/target/lproj_for_spec.rb +0 -38
- data/spec/lib/models/target/manifest_for_spec.rb +0 -42
- data/spec/lib/models/target/parent_target_spec.rb +0 -21
- data/spec/lib/models/target/prepare_spec.rb +0 -53
- data/spec/lib/models/target/required_targets_spec.rb +0 -119
- data/spec/lib/models/target/target_for_spec.rb +0 -56
- data/spec/lib/tools/build_number_spec.rb +0 -28
- data/spec/lib/tools/gen_spec.rb +0 -207
- data/spec/lib/tools/tools_spec.rb +0 -78
- data/spec/spec_helper.rb +0 -138
- data/sproutcore-abbot.gemspec +0 -640
- data/vendor/jsdoc/templates/jsdoc/allclasses.tmpl +0 -17
- data/vendor/jsdoc/templates/jsdoc/allfiles.tmpl +0 -56
- data/vendor/jsdoc/templates/jsdoc/class.tmpl +0 -487
- data/vendor/jsdoc/templates/jsdoc/index.tmpl +0 -38
- data/vendor/jsdoc/templates/jsdoc/symbol.tmpl +0 -35
- data/vendor/jsdoc/templates/sproutcore/allclasses.tmpl +0 -0
- data/vendor/jsdoc/templates/sproutcore/allfiles.tmpl +0 -56
- data/vendor/jsdoc/templates/sproutcore/class.tmpl +0 -674
- data/vendor/jsdoc/templates/sproutcore/index.tmpl +0 -55
- data/vendor/jsdoc/templates/sproutcore/symbol.tmpl +0 -35
@@ -0,0 +1,131 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore Costello - Property Observing Library
|
3
|
+
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
+
// Portions ©2008-2009 Apple, Inc. All rights reserved.
|
5
|
+
// License: Licened under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
/** @namespace
|
9
|
+
|
10
|
+
Delegate that provides data for a sparse array. If you set the delegate for
|
11
|
+
a sparse array to an object that implements one or more of these methods,
|
12
|
+
they will be invoked by the sparse array to fetch data or to update the
|
13
|
+
array content as needed.
|
14
|
+
|
15
|
+
Your object does not need to implement all of these methods, but it should
|
16
|
+
at least implment the sparseArrayDidRequestIndex() method.
|
17
|
+
|
18
|
+
@since SproutCore 1.0
|
19
|
+
*/
|
20
|
+
SC.SparseArrayDelegate = {
|
21
|
+
|
22
|
+
/**
|
23
|
+
Invoked when an object requests the length of the sparse array and the
|
24
|
+
length has not yet been set. You can implement this method to update
|
25
|
+
the length property of the sparse array immediately or at a later time
|
26
|
+
by calling the provideLength() method on the sparse array.
|
27
|
+
|
28
|
+
This method will only be called once on your delegate unless you
|
29
|
+
subsequently call provideLength(null) on the array, which will effectively
|
30
|
+
"empty" the array and cause the array to invoke the delegate again the
|
31
|
+
next time its length is request.
|
32
|
+
|
33
|
+
If you do not set a length on the sparse array immediately, it will return
|
34
|
+
a length of 0 until you provide the length.
|
35
|
+
|
36
|
+
@param {SC.SparseArray} sparseArray the array that needs a length.
|
37
|
+
@returns {void}
|
38
|
+
*/
|
39
|
+
sparseArrayDidRequestLength: function(sparseArray) {
|
40
|
+
// Default does nothing.
|
41
|
+
},
|
42
|
+
|
43
|
+
/**
|
44
|
+
Invoked when an object requests an index on the sparse array that has not
|
45
|
+
yet been set. You should implement this method to set the object at the
|
46
|
+
index using provideObjectsAtIndex() or provideObjectsInRange() on the
|
47
|
+
sparse array. You can call these methods immediately during this handler
|
48
|
+
or you can wait and call them at a later time once you have loaded any
|
49
|
+
data.
|
50
|
+
|
51
|
+
This method will only be called when an index is requested on the sparse
|
52
|
+
array that has not yet been filled. If you have filled an index or range
|
53
|
+
and you would like to reset it, call the objectsDidChangeInRange() method
|
54
|
+
on the sparse array.
|
55
|
+
|
56
|
+
Note that if you implement the sparseArrayDidRequestRange() method, that
|
57
|
+
method will be invoked instead of this one whenever possible to allow you
|
58
|
+
to fill in the array with the most efficiency possible.
|
59
|
+
|
60
|
+
@param {SC.SparseArray} sparseArray the sparse array
|
61
|
+
@param {Number} index the requested index
|
62
|
+
@returns {void}
|
63
|
+
*/
|
64
|
+
sparseArrayDidRequestIndex: function(sparseArray, index) {
|
65
|
+
|
66
|
+
},
|
67
|
+
|
68
|
+
/**
|
69
|
+
Alternative method invoked when an object requests an index on the
|
70
|
+
sparse array that has not yet been set. If you set the
|
71
|
+
rangeWindowSize property on the Sparse Array, then all object index
|
72
|
+
requests will be expanded to to nearest range window and then this
|
73
|
+
method will be called with that range.
|
74
|
+
|
75
|
+
You should fill in the passed range by calling the provideObjectsInRange()
|
76
|
+
method on the sparse array.
|
77
|
+
|
78
|
+
If you do not implement this method but set the rangeWindowSize anyway,
|
79
|
+
then the sparseArrayDidRequestIndex() method will be invoked instead.
|
80
|
+
|
81
|
+
Note that the passed range is a temporary object. Be sure to clone it if
|
82
|
+
you want to keep the range for later use.
|
83
|
+
|
84
|
+
@param {SC.SparseArray} sparseArray the sparse array
|
85
|
+
@param {Range} range read only range.
|
86
|
+
@returns {void}
|
87
|
+
*/
|
88
|
+
sparseArrayDidRequestRange: function(sparseArray, range) {
|
89
|
+
|
90
|
+
},
|
91
|
+
|
92
|
+
/**
|
93
|
+
Optional delegate method you can use to determine the index of a
|
94
|
+
particular object. If you do not implement this method, then the
|
95
|
+
sparse array will just search the objects it has loaded already.
|
96
|
+
|
97
|
+
@param {SC.SparseArray} sparseArray the sparse array
|
98
|
+
@param {Object} object the object to find the index of
|
99
|
+
@return {Number} the index or -1
|
100
|
+
@returns {void}
|
101
|
+
*/
|
102
|
+
sparseArrayDidRequestIndexOf: function(sparseArray, object) {
|
103
|
+
|
104
|
+
},
|
105
|
+
|
106
|
+
/**
|
107
|
+
Optional delegate method invoked whenever the sparse array attempts to
|
108
|
+
changes its contents. If you do not implement this method or if you
|
109
|
+
return NO from this method, then the edit will not be allowed.
|
110
|
+
|
111
|
+
@param {SC.SparseArray} sparseArray the sparse array
|
112
|
+
@param {Number} idx the starting index to replace
|
113
|
+
@param {Number} amt the number if items to replace
|
114
|
+
@param {Array} objects the array of objects to insert
|
115
|
+
@returns {Boolean} YES to allow replace, NO to deny
|
116
|
+
*/
|
117
|
+
sparseArrayShouldReplace: function(sparseArray, idx, amt, objects) {
|
118
|
+
return NO ;
|
119
|
+
},
|
120
|
+
|
121
|
+
/**
|
122
|
+
Invoked whenever the sparse array is reset. Resetting a sparse array
|
123
|
+
will cause it to flush its content and go back to the delegate for all
|
124
|
+
property requests again.
|
125
|
+
|
126
|
+
@param {SC.SparseArray} sparseArray the sparse array
|
127
|
+
@returns {void}
|
128
|
+
*/
|
129
|
+
sparseArrayDidReset: function(sparseArray) {
|
130
|
+
}
|
131
|
+
};
|
@@ -0,0 +1,915 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore Costello - Property Observing Library
|
3
|
+
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
+
// Portions ©2008-2009 Apple, Inc. All rights reserved.
|
5
|
+
// License: Licened under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
require('system/object') ;
|
9
|
+
|
10
|
+
/**
|
11
|
+
Debug parameter you can turn on. This will log all bindings that fire to
|
12
|
+
the console. This should be disabled in production code. Note that you
|
13
|
+
can also enable this from the console or temporarily.
|
14
|
+
*/
|
15
|
+
SC.LOG_BINDINGS = NO ;
|
16
|
+
|
17
|
+
/**
|
18
|
+
Performance paramter. This will benchmark the time spent firing each
|
19
|
+
binding.
|
20
|
+
*/
|
21
|
+
SC.BENCHMARK_BINDING_NOTIFICATIONS = NO ;
|
22
|
+
|
23
|
+
/**
|
24
|
+
Performance parameter. This will benchmark the time spend configuring each
|
25
|
+
binding.
|
26
|
+
*/
|
27
|
+
SC.BENCHMARK_BINDING_SETUP = NO;
|
28
|
+
|
29
|
+
/**
|
30
|
+
Default placeholder for multiple values in bindings.
|
31
|
+
*/
|
32
|
+
SC.MULTIPLE_PLACEHOLDER = '@@MULT@@' ;
|
33
|
+
|
34
|
+
/**
|
35
|
+
Default placeholder for null values in bindings.
|
36
|
+
*/
|
37
|
+
SC.NULL_PLACEHOLDER = '@@NULL@@' ;
|
38
|
+
|
39
|
+
/**
|
40
|
+
Default placeholder for empty values in bindings.
|
41
|
+
*/
|
42
|
+
SC.EMPTY_PLACEHOLDER = '@@EMPTY@@' ;
|
43
|
+
|
44
|
+
|
45
|
+
/**
|
46
|
+
A binding simply connects the properties of two objects so that whenever the
|
47
|
+
value of one property changes, the other property will be changed also. You
|
48
|
+
do not usually work with Binding objects directly but instead describe
|
49
|
+
bindings in your class definition using something like:
|
50
|
+
|
51
|
+
valueBinding: "MyApp.someController.title"
|
52
|
+
|
53
|
+
This will create a binding from "MyApp.someController.title" to the "value"
|
54
|
+
property of your object instance automatically. Now the two values will be
|
55
|
+
kept in sync.
|
56
|
+
|
57
|
+
h2. Customizing Your Bindings
|
58
|
+
|
59
|
+
In addition to synchronizing values, bindings can also perform some basic
|
60
|
+
transforms on values. These transforms can help to make sure the data fed
|
61
|
+
into one object always meets the expectations of that object regardless of
|
62
|
+
what the other object outputs.
|
63
|
+
|
64
|
+
To customize a binding, you can use one of the many helper methods defined
|
65
|
+
on SC.Binding like so:
|
66
|
+
|
67
|
+
valueBinding: SC.Binding.single("MyApp.someController.title")
|
68
|
+
|
69
|
+
This will create a binding just like the example above, except that now the
|
70
|
+
binding will convert the value of MyApp.someController.title to a single
|
71
|
+
object (removing any arrays) before applying it to the "value" property of
|
72
|
+
your object.
|
73
|
+
|
74
|
+
You can also chain helper methods to build custom bindings like so:
|
75
|
+
|
76
|
+
valueBinding: SC.Binding.single("MyApp.someController.title").notEmpty("(EMPTY)")
|
77
|
+
|
78
|
+
This will force the value of MyApp.someController.title to be a single value
|
79
|
+
and then check to see if the value is "empty" (null, undefined, empty array,
|
80
|
+
or an empty string). If it is empty, the value will be set to the string
|
81
|
+
"(EMPTY)".
|
82
|
+
|
83
|
+
h2. One Way Bindings
|
84
|
+
|
85
|
+
One especially useful binding customization you can use is the oneWay()
|
86
|
+
helper. This helper tells SproutCore that you are only interested in
|
87
|
+
receiving changes on the object you are binding from. For example, if you
|
88
|
+
are binding to a preference and you want to be notified if the preference
|
89
|
+
has changed, but your object will not be changing the preference itself, you
|
90
|
+
could do:
|
91
|
+
|
92
|
+
bigTitlesBinding: SC.Binding.oneWay("MyApp.preferencesController.bigTitles")
|
93
|
+
|
94
|
+
This way if the value of MyApp.preferencesController.bigTitles changes the
|
95
|
+
"bigTitles" property of your object will change also. However, if you change
|
96
|
+
the value of your "bigTitles" property, it will not update the
|
97
|
+
preferencesController.
|
98
|
+
|
99
|
+
One way bindings are almost twice as fast to setup and twice as fast to
|
100
|
+
execute because the binding only has to worry about changes to one side.
|
101
|
+
|
102
|
+
You should consider using one way bindings anytime you have an object that
|
103
|
+
may be created frequently and you do not intend to change a property; only
|
104
|
+
to monitor it for changes. (such as in the example above).
|
105
|
+
|
106
|
+
h2. Adding Custom Transforms
|
107
|
+
|
108
|
+
In addition to using the standard helpers provided by SproutCore, you can
|
109
|
+
also defined your own custom transform functions which will be used to
|
110
|
+
convert the value. To do this, just define your transform function and add
|
111
|
+
it to the binding with the transform() helper. The following example will
|
112
|
+
not allow Integers less than ten. Note that it checks the value of the
|
113
|
+
bindings and allows all other values to pass:
|
114
|
+
|
115
|
+
{{{
|
116
|
+
valueBinding: SC.Binding.transform(function(value, binding) {
|
117
|
+
return ((SC.typeOf(value) === SC.T_NUMBER) && (value < 10)) ? 10 : value;
|
118
|
+
}).from("MyApp.someController.value")
|
119
|
+
}}}
|
120
|
+
|
121
|
+
If you would like to instead use this transform on a number of bindings,
|
122
|
+
you can also optionally add your own helper method to SC.Binding. This
|
123
|
+
method should simply return the value of this.transform(). The example
|
124
|
+
below adds a new helper called notLessThan() which will limit the value to
|
125
|
+
be not less than the passed minimum:
|
126
|
+
|
127
|
+
{{{
|
128
|
+
SC.Binding.notLessThan = function(minValue) {
|
129
|
+
return this.transform(function(value, binding) {
|
130
|
+
return ((SC.typeOf(value) === SC.T_NUMBER) && (value < minValue)) ? minValue : value ;
|
131
|
+
}) ;
|
132
|
+
} ;
|
133
|
+
}}}
|
134
|
+
|
135
|
+
You could specify this in your core.js file, for example. Then anywhere in
|
136
|
+
your application you can use it to define bindings like so:
|
137
|
+
|
138
|
+
{{{
|
139
|
+
valueBinding: SC.Binding.from("MyApp.someController.value").notLessThan(10)
|
140
|
+
}}}
|
141
|
+
|
142
|
+
Also, remember that helpers are chained so you can use your helper along with
|
143
|
+
any other helpers. The example below will create a one way binding that
|
144
|
+
does not allow empty values or values less than 10:
|
145
|
+
|
146
|
+
{{{
|
147
|
+
valueBinding: SC.Binding.oneWay("MyApp.someController.value").notEmpty().notLessThan(10)
|
148
|
+
}}}
|
149
|
+
|
150
|
+
Note that the built in helper methods all allow you to pass a "from" property
|
151
|
+
path so you don't have to use the from() helper to set the path. You can do
|
152
|
+
the same thing with your own helper methods if you like, but it is not
|
153
|
+
required.
|
154
|
+
|
155
|
+
h2. Creating Custom Binding Templates
|
156
|
+
|
157
|
+
Another way you can customize bindings is to create a binding template. A
|
158
|
+
template is simply a binding that is already partially or completely
|
159
|
+
configured. You can specify this template anywhere in your app and then use
|
160
|
+
it instead of designating your own custom bindings. This is a bit faster on
|
161
|
+
app startup but it is mostly useful in making your code less verbose.
|
162
|
+
|
163
|
+
For example, let's say you will be frequently creating one way, not empty
|
164
|
+
bindings that allow values greater than 10 throughout your app. You could
|
165
|
+
create a binding template in your core.js like this:
|
166
|
+
|
167
|
+
MyApp.LimitBinding = SC.Binding.oneWay().notEmpty().notLessThan(10);
|
168
|
+
|
169
|
+
Then anywhere you want to use this binding, just refer to the template like
|
170
|
+
so:
|
171
|
+
|
172
|
+
valueBinding: MyApp.LimitBinding.beget("MyApp.someController.value")
|
173
|
+
|
174
|
+
Note that when you use binding templates, it is very important that you always
|
175
|
+
start by using beget() to extend the template. If you do not do this, you
|
176
|
+
will end up using the same binding instance throughout your app which will
|
177
|
+
lead to erratic behavior.
|
178
|
+
|
179
|
+
h2. How to Manually Activate a Binding
|
180
|
+
|
181
|
+
All of the examples above show you how to configure a custom binding, but the
|
182
|
+
result of these customizations will be a binding template, not a fully active
|
183
|
+
binding. The binding will actually become active only when you instantiate
|
184
|
+
the object the binding belongs to. It is useful however, to understand what
|
185
|
+
actually happens when the binding is activated.
|
186
|
+
|
187
|
+
For a binding to function it must have at least a "from" property and a "to"
|
188
|
+
property. The from property path points to the object/key that you want to
|
189
|
+
bind from while the to path points to the object/key you want to bind to.
|
190
|
+
|
191
|
+
When you define a custom binding, you are usually describing the property
|
192
|
+
you want to bind from (such as "MyApp.someController.value" in the examples
|
193
|
+
above). When your object is created, it will automatically assign the value
|
194
|
+
you want to bind "to" based on the name of your binding key. In the examples
|
195
|
+
above, during init, SproutCore objects will effectively call something like
|
196
|
+
this on your binding:
|
197
|
+
|
198
|
+
binding = this.valueBinding.beget().to("value", this) ;
|
199
|
+
|
200
|
+
This creates a new binding instance based on the template you provide, and
|
201
|
+
sets the to path to the "value" property of the new object. Now that the
|
202
|
+
binding is fully configured with a "from" and a "to", it simply needs to be
|
203
|
+
connected to become active. This is done through the connect() method:
|
204
|
+
|
205
|
+
binding.connect() ;
|
206
|
+
|
207
|
+
Now that the binding is connected, it will observe both the from and to side
|
208
|
+
and relay changes.
|
209
|
+
|
210
|
+
If you ever needed to do so (you almost never will, but it is useful to
|
211
|
+
understand this anyway), you could manually create an active binding by
|
212
|
+
doing the following:
|
213
|
+
|
214
|
+
{{{
|
215
|
+
SC.Binding.from("MyApp.someController.value")
|
216
|
+
.to("MyApp.anotherObject.value")
|
217
|
+
.connect();
|
218
|
+
}}}
|
219
|
+
|
220
|
+
You could also use the bind() helper method provided by SC.Object. (This is
|
221
|
+
the same method used by SC.Object.init() to setup your bindings):
|
222
|
+
|
223
|
+
{{{
|
224
|
+
MyApp.anotherObject.bind("value", "MyApp.someController.value") ;
|
225
|
+
}}}
|
226
|
+
|
227
|
+
Both of these code fragments have the same effect as doing the most friendly
|
228
|
+
form of binding creation like so:
|
229
|
+
|
230
|
+
{{{
|
231
|
+
MyApp.anotherObject = SC.Object.create({
|
232
|
+
valueBinding: "MyApp.someController.value",
|
233
|
+
|
234
|
+
// OTHER CODE FOR THIS OBJECT...
|
235
|
+
|
236
|
+
}) ;
|
237
|
+
}}}
|
238
|
+
|
239
|
+
SproutCore's built in binding creation method make it easy to automatically
|
240
|
+
create bindings for you. You should always use the highest-level APIs
|
241
|
+
available, even if you understand how to it works underneath.
|
242
|
+
|
243
|
+
|
244
|
+
@extends Object
|
245
|
+
|
246
|
+
*/
|
247
|
+
SC.Binding = {
|
248
|
+
|
249
|
+
/**
|
250
|
+
This is the core method you use to create a new binding instance. The
|
251
|
+
binding instance will have the receiver instance as its parent which means
|
252
|
+
any configuration you have there will be inherited.
|
253
|
+
|
254
|
+
The returned instance will also have its parentBinding property set to the
|
255
|
+
receiver.
|
256
|
+
|
257
|
+
@param fromPath {String} optional from path.
|
258
|
+
@returns {SC.Binding} new binding instance
|
259
|
+
*/
|
260
|
+
beget: function(fromPath) {
|
261
|
+
var ret = SC.beget(this) ;
|
262
|
+
ret.parentBinding = this;
|
263
|
+
if (fromPath !== undefined) ret = ret.from(fromPath) ;
|
264
|
+
return ret ;
|
265
|
+
},
|
266
|
+
|
267
|
+
/**
|
268
|
+
Returns a builder function for compatibility.
|
269
|
+
*/
|
270
|
+
builder: function() {
|
271
|
+
var binding = this ;
|
272
|
+
var ret = function(fromProperty) { return binding.beget().from(fromProperty); };
|
273
|
+
ret.beget = function() { return binding.beget(); } ;
|
274
|
+
return ret ;
|
275
|
+
},
|
276
|
+
|
277
|
+
/**
|
278
|
+
This will set "from" property path to the specified value. It will not
|
279
|
+
attempt to resolve this property path to an actual object/property tuple
|
280
|
+
until you connect the binding.
|
281
|
+
|
282
|
+
The binding will search for the property path starting at the root level
|
283
|
+
unless you specify an alternate root object as the second paramter to this
|
284
|
+
method. Alternatively, you can begin your property path with either "." or
|
285
|
+
"*", which will use the root object of the to side be default. This special
|
286
|
+
behavior is used to support the high-level API provided by SC.Object.
|
287
|
+
|
288
|
+
@param propertyPath {String|Tuple} A property path or tuple
|
289
|
+
@param root {Object} optional root object to use when resolving the path.
|
290
|
+
@returns {SC.Binding} this
|
291
|
+
*/
|
292
|
+
from: function(propertyPath, root) {
|
293
|
+
|
294
|
+
// if the propertyPath is null/undefined, return this. This allows the
|
295
|
+
// method to be called from other methods when the fromPath might be
|
296
|
+
// optional. (cf single(), multiple())
|
297
|
+
if (!propertyPath) return this ;
|
298
|
+
|
299
|
+
// beget if needed.
|
300
|
+
var binding = (this === SC.Binding) ? this.beget() : this ;
|
301
|
+
binding._fromPropertyPath = propertyPath ;
|
302
|
+
binding._fromRoot = root ;
|
303
|
+
binding._fromTuple = null ;
|
304
|
+
return binding ;
|
305
|
+
},
|
306
|
+
|
307
|
+
/**
|
308
|
+
This will set the "to" property path to the specified value. It will not
|
309
|
+
attempt to reoslve this property path to an actual object/property tuple
|
310
|
+
until you connect the binding.
|
311
|
+
|
312
|
+
@param propertyPath {String|Tuple} A property path or tuple
|
313
|
+
@param root {Object} optional root object to use when resolving the path.
|
314
|
+
@returns {SC.Binding} this
|
315
|
+
*/
|
316
|
+
to: function(propertyPath, root) {
|
317
|
+
// beget if needed.
|
318
|
+
var binding = (this === SC.Binding) ? this.beget() : this ;
|
319
|
+
binding._toPropertyPath = propertyPath ;
|
320
|
+
binding._toRoot = root ;
|
321
|
+
binding._toTuple = null ; // clear out any existing one.
|
322
|
+
return binding ;
|
323
|
+
},
|
324
|
+
|
325
|
+
/**
|
326
|
+
Attempts to connect this binding instance so that it can receive and relay
|
327
|
+
changes. This method will raise an exception if you have not set the
|
328
|
+
from/to properties yet.
|
329
|
+
|
330
|
+
@returns {SC.Binding} this
|
331
|
+
*/
|
332
|
+
connect: function() {
|
333
|
+
// If the binding is already connected, do nothing.
|
334
|
+
if (this.isConnected) return this ;
|
335
|
+
this.isConnected = YES ;
|
336
|
+
this._connectionPending = YES ; // its connected but not really...
|
337
|
+
this._syncOnConnect = YES ;
|
338
|
+
SC.Binding._connectQueue.add(this) ;
|
339
|
+
return this;
|
340
|
+
},
|
341
|
+
|
342
|
+
/** @private
|
343
|
+
Actually connects the binding. This is done at the end of the runloop
|
344
|
+
to give you time to setup your entire object graph before the bindings
|
345
|
+
try to activate.
|
346
|
+
*/
|
347
|
+
_connect: function() {
|
348
|
+
if (!this._connectionPending) return; //nothing to do
|
349
|
+
this._connectionPending = NO ;
|
350
|
+
|
351
|
+
var path, root ;
|
352
|
+
var bench = SC.BENCHMARK_BINDING_SETUP;
|
353
|
+
|
354
|
+
if (bench) SC.Benchmark.start("SC.Binding.connect()");
|
355
|
+
|
356
|
+
// try to connect the from side.
|
357
|
+
// as a special behavior, if the from property path begins with either a
|
358
|
+
// . or * and the fromRoot is null, use the toRoot instead. This allows
|
359
|
+
// for support for the SC.Object shorthand:
|
360
|
+
//
|
361
|
+
// contentBinding: "*owner.value"
|
362
|
+
//
|
363
|
+
path = this._fromPropertyPath; root = this._fromRoot ;
|
364
|
+
if (SC.typeOf(path) === SC.T_STRING) {
|
365
|
+
|
366
|
+
// if the first character is a '.', this is a static path. make the
|
367
|
+
// toRoot the default root.
|
368
|
+
if (path.indexOf('.') === 0) {
|
369
|
+
path = path.slice(1);
|
370
|
+
if (!root) root = this._toRoot ;
|
371
|
+
|
372
|
+
// if the first character is a '*', then setup a tuple since this is a
|
373
|
+
// chained path.
|
374
|
+
} else if (path.indexOf('*') === 0) {
|
375
|
+
path = [this._fromRoot || this._toRoot, path.slice(1)] ;
|
376
|
+
root = null ;
|
377
|
+
}
|
378
|
+
}
|
379
|
+
SC.Observers.addObserver(path, this, this.fromPropertyDidChange, root) ;
|
380
|
+
|
381
|
+
// try to connect the to side
|
382
|
+
if (!this._oneWay) {
|
383
|
+
path = this._toPropertyPath; root = this._toRoot ;
|
384
|
+
SC.Observers.addObserver(path, this, this.toPropertyDidChange, root) ;
|
385
|
+
}
|
386
|
+
|
387
|
+
if (bench) SC.Benchmark.end("SC.Binding.connect()");
|
388
|
+
|
389
|
+
// now try to sync if needed
|
390
|
+
if (this._syncOnConnect) {
|
391
|
+
this._syncOnConnect = NO ;
|
392
|
+
if (bench) SC.Benchmark.start("SC.Binding.connect().sync");
|
393
|
+
this.sync();
|
394
|
+
if (bench) SC.Benchmark.end("SC.Binding.connect().sync");
|
395
|
+
}
|
396
|
+
},
|
397
|
+
|
398
|
+
/**
|
399
|
+
Disconnects the binding instance. Changes will no longer be relayed. You
|
400
|
+
will not usually need to call this method.
|
401
|
+
|
402
|
+
@returns {SC.Binding} this
|
403
|
+
*/
|
404
|
+
disconnect: function() {
|
405
|
+
if (!this.isConnected) return this; // nothing to do.
|
406
|
+
|
407
|
+
// if connection is still pending, just cancel
|
408
|
+
if (this._connectionPending) {
|
409
|
+
this._connectionPending = NO ;
|
410
|
+
|
411
|
+
// connection is completed, disconnect.
|
412
|
+
} else {
|
413
|
+
SC.Observers.removeObserver(this._fromPropertyPath, this, this.fromPropertyDidChange, this._fromRoot) ;
|
414
|
+
if (!this._oneWay) {
|
415
|
+
SC.Observers.removeObserver(this._toPropertyPath, this, this.toPropertyDidChange, this._toRoot) ;
|
416
|
+
}
|
417
|
+
}
|
418
|
+
|
419
|
+
this.isConnected = NO ;
|
420
|
+
return this ;
|
421
|
+
},
|
422
|
+
|
423
|
+
/**
|
424
|
+
Invoked whenever the value of the "from" property changes. This will mark
|
425
|
+
the binding as dirty if the value has changed.
|
426
|
+
*/
|
427
|
+
fromPropertyDidChange: function(target, key) {
|
428
|
+
var v = target ? target.get(key) : null;
|
429
|
+
|
430
|
+
//console.log("fromPropertyDidChange: %@ v = %@".fmt(this, v)) ;
|
431
|
+
|
432
|
+
// if the new value is different from the current binding value, then
|
433
|
+
// schedule to register an update.
|
434
|
+
if (v !== this._bindingValue) {
|
435
|
+
|
436
|
+
this._setBindingValue(target, key) ;
|
437
|
+
this._changePending = YES ;
|
438
|
+
SC.Binding._changeQueue.add(this) ; // save for later.
|
439
|
+
}
|
440
|
+
},
|
441
|
+
|
442
|
+
/**
|
443
|
+
Invoked whenever the value of the "to" property changes. This will mark the
|
444
|
+
binding as dirty only if:
|
445
|
+
|
446
|
+
- the binding is not one way
|
447
|
+
- the value does not match the stored transformedBindingValue
|
448
|
+
|
449
|
+
if the value does not match the transformedBindingValue, then it will
|
450
|
+
become the new bindingValue.
|
451
|
+
*/
|
452
|
+
toPropertyDidChange: function(target, key) {
|
453
|
+
if (this._oneWay) return; // nothing to do
|
454
|
+
|
455
|
+
var v = target.get(key) ;
|
456
|
+
|
457
|
+
// if the new value is different from the current binding value, then
|
458
|
+
// schedule to register an update.
|
459
|
+
if (v !== this._transformedBindingValue) {
|
460
|
+
this._setBindingValue(target, key) ;
|
461
|
+
this._changePending = YES ;
|
462
|
+
SC.Binding._changeQueue.add(this) ; // save for later.
|
463
|
+
}
|
464
|
+
},
|
465
|
+
|
466
|
+
/**
|
467
|
+
Saves the source location for the binding value. This will be used later
|
468
|
+
to actually update the binding value.
|
469
|
+
*/
|
470
|
+
_setBindingValue: function(source, key) {
|
471
|
+
this._bindingSource = source;
|
472
|
+
this._bindingKey = key;
|
473
|
+
},
|
474
|
+
|
475
|
+
/**
|
476
|
+
Updates the binding value from the current binding source if needed. This
|
477
|
+
should be called just before using this._bindingValue.
|
478
|
+
*/
|
479
|
+
_computeBindingValue: function() {
|
480
|
+
var source = this._bindingSource,
|
481
|
+
key = this._bindingKey,
|
482
|
+
v;
|
483
|
+
|
484
|
+
if (!source) return ; // nothing to do
|
485
|
+
this._bindingValue = v = source.getPath(key);
|
486
|
+
|
487
|
+
// apply any transforms to get the to property value also
|
488
|
+
var transforms = this._transforms;
|
489
|
+
if (transforms) {
|
490
|
+
var len = transforms.length ;
|
491
|
+
for(var idx=0;idx<len;idx++) {
|
492
|
+
var transform = transforms[idx] ;
|
493
|
+
v = transform(v, this) ;
|
494
|
+
}
|
495
|
+
}
|
496
|
+
|
497
|
+
// if error objects are not allowed, and the value is an error, then
|
498
|
+
// change it to null.
|
499
|
+
if (this._noError && SC.typeOf(v) === SC.T_ERROR) v = null ;
|
500
|
+
|
501
|
+
this._transformedBindingValue = v;
|
502
|
+
},
|
503
|
+
|
504
|
+
_connectQueue: SC.CoreSet.create(),
|
505
|
+
_alternateConnectQueue: SC.CoreSet.create(),
|
506
|
+
_changeQueue: SC.CoreSet.create(),
|
507
|
+
_alternateChangeQueue: SC.CoreSet.create(),
|
508
|
+
_changePending: NO,
|
509
|
+
|
510
|
+
/**
|
511
|
+
Call this method on SC.Binding to flush all bindings with changed pending.
|
512
|
+
|
513
|
+
@returns {Boolean} YES if changes were flushed.
|
514
|
+
*/
|
515
|
+
flushPendingChanges: function() {
|
516
|
+
|
517
|
+
// don't allow flushing more than one at a time
|
518
|
+
if (this._isFlushing) return NO;
|
519
|
+
this._isFlushing = YES ;
|
520
|
+
SC.Observers.suspendPropertyObserving();
|
521
|
+
|
522
|
+
var didFlush = NO ;
|
523
|
+
var log = SC.LOG_BINDINGS ;
|
524
|
+
|
525
|
+
// connect any bindings
|
526
|
+
var queue, binding ;
|
527
|
+
while((queue = this._connectQueue).length >0) {
|
528
|
+
this._connectQueue = this._alternateConnectQueue ;
|
529
|
+
this._alternateConnectQueue = queue ;
|
530
|
+
while(binding = queue.pop()) binding._connect() ;
|
531
|
+
}
|
532
|
+
|
533
|
+
// loop through the changed queue...
|
534
|
+
while ((queue = this._changeQueue).length > 0) {
|
535
|
+
if (log) console.log("Begin: Trigger changed bindings") ;
|
536
|
+
|
537
|
+
didFlush = YES ;
|
538
|
+
|
539
|
+
// first, swap the change queues. This way any binding changes that
|
540
|
+
// happen while we flush the current queue can be queued up.
|
541
|
+
this._changeQueue = this._alternateChangeQueue ;
|
542
|
+
this._alternateChangeQueue = queue ;
|
543
|
+
|
544
|
+
// next, apply any bindings in the current queue. This may cause
|
545
|
+
// additional bindings to trigger, which will end up in the new active
|
546
|
+
// queue.
|
547
|
+
while(binding = queue.pop()) binding.applyBindingValue() ;
|
548
|
+
|
549
|
+
// now loop back and see if there are additional changes pending in the
|
550
|
+
// active queue. Repeat this until all bindings that need to trigger
|
551
|
+
// have triggered.
|
552
|
+
if (log) console.log("End: Trigger changed bindings") ;
|
553
|
+
}
|
554
|
+
|
555
|
+
// clean up
|
556
|
+
this._isFlushing = NO ;
|
557
|
+
SC.Observers.resumePropertyObserving();
|
558
|
+
|
559
|
+
return didFlush ;
|
560
|
+
},
|
561
|
+
|
562
|
+
/**
|
563
|
+
This method is called at the end of the Run Loop to relay the changed
|
564
|
+
binding value from one side to the other.
|
565
|
+
*/
|
566
|
+
applyBindingValue: function() {
|
567
|
+
this._changePending = NO ;
|
568
|
+
|
569
|
+
// compute the binding targets if needed.
|
570
|
+
this._computeBindingTargets() ;
|
571
|
+
this._computeBindingValue();
|
572
|
+
|
573
|
+
var v = this._bindingValue ;
|
574
|
+
var tv = this._transformedBindingValue ;
|
575
|
+
var bench = SC.BENCHMARK_BINDING_NOTIFICATIONS ;
|
576
|
+
var log = SC.LOG_BINDINGS ;
|
577
|
+
|
578
|
+
// the from property value will always be the binding value, update if
|
579
|
+
// needed.
|
580
|
+
if (!this._oneWay && this._fromTarget) {
|
581
|
+
if (log) console.log("%@: %@ -> %@".fmt(this, v, tv)) ;
|
582
|
+
if (bench) SC.Benchmark.start(this.toString() + "->") ;
|
583
|
+
this._fromTarget.setPathIfChanged(this._fromPropertyKey, v) ;
|
584
|
+
if (bench) SC.Benchmark.end(this.toString() + "->") ;
|
585
|
+
}
|
586
|
+
|
587
|
+
// update the to value with the transformed value if needed.
|
588
|
+
if (this._toTarget) {
|
589
|
+
if (log) console.log("%@: %@ <- %@".fmt(this, v, tv)) ;
|
590
|
+
if (bench) SC.Benchmark.start(this.toString() + "<-") ;
|
591
|
+
this._toTarget.setPathIfChanged(this._toPropertyKey, tv) ;
|
592
|
+
if (bench) SC.Benchmark.start(this.toString() + "<-") ;
|
593
|
+
}
|
594
|
+
},
|
595
|
+
|
596
|
+
/**
|
597
|
+
Calling this method on a binding will cause it to check the value of the
|
598
|
+
from side of the binding matches the current expected value of the
|
599
|
+
binding. If not, it will relay the change as if the from side's value has
|
600
|
+
just changed.
|
601
|
+
|
602
|
+
This method is useful when you are dynamically connecting bindings to a
|
603
|
+
network of objects that may have already been initialized.
|
604
|
+
*/
|
605
|
+
sync: function() {
|
606
|
+
|
607
|
+
// do nothing if not connected
|
608
|
+
if (!this.isConnected) return this;
|
609
|
+
|
610
|
+
// connection is pending, just note that we should sync also
|
611
|
+
if (this._connectionPending) {
|
612
|
+
this._syncOnConnect = YES ;
|
613
|
+
|
614
|
+
// we are connected, go ahead and sync
|
615
|
+
} else {
|
616
|
+
this._computeBindingTargets() ;
|
617
|
+
var target = this._fromTarget ;
|
618
|
+
var key = this._fromPropertyKey ;
|
619
|
+
if (!target || !key) return this ; // nothing to do
|
620
|
+
|
621
|
+
// get the new value
|
622
|
+
var v = target.getPath(key) ;
|
623
|
+
|
624
|
+
// if the new value is different from the current binding value, then
|
625
|
+
// schedule to register an update.
|
626
|
+
if (v !== this._bindingValue) {
|
627
|
+
this._setBindingValue(target, key) ;
|
628
|
+
this._changePending = YES ;
|
629
|
+
SC.Binding._changeQueue.add(this) ; // save for later.
|
630
|
+
}
|
631
|
+
}
|
632
|
+
|
633
|
+
return this ;
|
634
|
+
},
|
635
|
+
|
636
|
+
// set if you call sync() when the binding connection is still pending.
|
637
|
+
_syncOnConnect: NO,
|
638
|
+
|
639
|
+
_computeBindingTargets: function() {
|
640
|
+
if (!this._fromTarget) {
|
641
|
+
|
642
|
+
var path, root, tuple ;
|
643
|
+
|
644
|
+
// if the fromPropertyPath begins with a . or * then we may use the
|
645
|
+
// toRoot as the root object. Similar code exists in connect() so if
|
646
|
+
// you make a change to one be sure to update the other.
|
647
|
+
path = this._fromPropertyPath; root = this._fromRoot ;
|
648
|
+
if (SC.typeOf(path) === SC.T_STRING) {
|
649
|
+
|
650
|
+
// static path beginning with the toRoot
|
651
|
+
if (path.indexOf('.') === 0) {
|
652
|
+
path = path.slice(1) ; // remove the .
|
653
|
+
if (!root) root = this._toRoot; // use the toRoot optionally
|
654
|
+
|
655
|
+
// chained path beginning with toRoot. Setup a tuple
|
656
|
+
} else if (path.indexOf('*') === 0) {
|
657
|
+
path = [root || this._toRoot, path.slice(1)];
|
658
|
+
root = null ;
|
659
|
+
}
|
660
|
+
}
|
661
|
+
|
662
|
+
tuple = SC.tupleForPropertyPath(path, root) ;
|
663
|
+
if (tuple) {
|
664
|
+
this._fromTarget = tuple[0]; this._fromPropertyKey = tuple[1] ;
|
665
|
+
}
|
666
|
+
}
|
667
|
+
|
668
|
+
if (!this._toTarget) {
|
669
|
+
path = this._toPropertyPath; root = this._toRoot ;
|
670
|
+
tuple = SC.tupleForPropertyPath(path, root) ;
|
671
|
+
if (tuple) {
|
672
|
+
this._toTarget = tuple[0]; this._toPropertyKey = tuple[1] ;
|
673
|
+
}
|
674
|
+
}
|
675
|
+
},
|
676
|
+
|
677
|
+
/**
|
678
|
+
Configures the binding as one way. A one-way binding will relay changes
|
679
|
+
on the "from" side to the "to" side, but not the other way around. This
|
680
|
+
means that if you change the "to" side directly, the "from" side may have
|
681
|
+
a different value.
|
682
|
+
|
683
|
+
@param fromPath {String} optional from path to connect.
|
684
|
+
@param aFlag {Boolean} Optionally pass NO to set the binding back to two-way
|
685
|
+
@returns {SC.Binding} this
|
686
|
+
*/
|
687
|
+
oneWay: function(fromPath, aFlag) {
|
688
|
+
|
689
|
+
// If fromPath is a bool but aFlag is undefined, swap.
|
690
|
+
if ((aFlag === undefined) && (SC.typeOf(fromPath) === SC.T_BOOL)) {
|
691
|
+
aFlag = fromPath; fromPath = null ;
|
692
|
+
}
|
693
|
+
|
694
|
+
// beget if needed.
|
695
|
+
var binding = this.from(fromPath) ;
|
696
|
+
if (binding === SC.Binding) binding = binding.beget() ;
|
697
|
+
binding._oneWay = (aFlag === undefined) ? YES : aFlag ;
|
698
|
+
return binding ;
|
699
|
+
},
|
700
|
+
|
701
|
+
/**
|
702
|
+
Adds the specified transform function to the array of transform functions.
|
703
|
+
|
704
|
+
The function you pass must have the following signature:
|
705
|
+
|
706
|
+
{{{
|
707
|
+
function(value) {} ;
|
708
|
+
}}}
|
709
|
+
|
710
|
+
It must return either the transformed value or an error object.
|
711
|
+
|
712
|
+
Transform functions are chained, so they are called in order. If you are
|
713
|
+
extending a binding and want to reset the transforms, you can call
|
714
|
+
resetTransform() first.
|
715
|
+
|
716
|
+
@param transformFunc {Function} the transform function.
|
717
|
+
@returns {SC.Binding} this
|
718
|
+
*/
|
719
|
+
transform: function(transformFunc) {
|
720
|
+
var binding = (this === SC.Binding) ? this.beget() : this ;
|
721
|
+
var t = binding._transforms ;
|
722
|
+
|
723
|
+
// clone the transform array if this comes from the parent
|
724
|
+
if (t && (t === binding.parentBinding._transform)) {
|
725
|
+
t = binding._transforms = t.slice() ;
|
726
|
+
}
|
727
|
+
|
728
|
+
// create the transform array if needed.
|
729
|
+
if (!t) t = binding._transforms = [] ;
|
730
|
+
|
731
|
+
// add the transform function
|
732
|
+
t.push(transformFunc) ;
|
733
|
+
return binding;
|
734
|
+
},
|
735
|
+
|
736
|
+
/**
|
737
|
+
Resets the transforms for the binding. After calling this method the
|
738
|
+
binding will no longer transform values. You can then add new transforms
|
739
|
+
as needed.
|
740
|
+
|
741
|
+
@returns {SC.Binding} this
|
742
|
+
*/
|
743
|
+
resetTransforms: function() {
|
744
|
+
var binding = (this === SC.Binding) ? this.beget() : this ;
|
745
|
+
binding._transforms = null ; return binding ;
|
746
|
+
},
|
747
|
+
|
748
|
+
/**
|
749
|
+
Specifies that the binding should not return error objects. If the value
|
750
|
+
of a binding is an Error object, it will be transformed to a null value
|
751
|
+
instead.
|
752
|
+
|
753
|
+
Note that this is not a transform function since it will be called at the
|
754
|
+
end of the transform chain.
|
755
|
+
|
756
|
+
@param fromPath {String} optional from path to connect.
|
757
|
+
@param aFlag {Boolean} optionally pass NO to allow error objects again.
|
758
|
+
@returns {SC.Binding} this
|
759
|
+
*/
|
760
|
+
noError: function(fromPath, aFlag) {
|
761
|
+
// If fromPath is a bool but aFlag is undefined, swap.
|
762
|
+
if ((aFlag === undefined) && (SC.typeOf(fromPath) === SC.T_BOOL)) {
|
763
|
+
aFlag = fromPath; fromPath = null ;
|
764
|
+
}
|
765
|
+
|
766
|
+
// beget if needed.
|
767
|
+
var binding = this.from(fromPath) ;
|
768
|
+
if (binding === SC.Binding) binding = binding.beget() ;
|
769
|
+
binding._noError = (aFlag === undefined) ? YES : aFlag ;
|
770
|
+
return binding ;
|
771
|
+
},
|
772
|
+
|
773
|
+
/**
|
774
|
+
Adds a transform to the chain that will allow only single values to pass.
|
775
|
+
This will allow single values, nulls, and error values to pass through. If
|
776
|
+
you pass an array, it will be mapped as so:
|
777
|
+
|
778
|
+
{{{
|
779
|
+
[] => null
|
780
|
+
[a] => a
|
781
|
+
[a,b,c] => Multiple Placeholder
|
782
|
+
}}}
|
783
|
+
|
784
|
+
You can pass in an optional multiple placeholder or it will use the
|
785
|
+
default.
|
786
|
+
|
787
|
+
Note that this transform will only happen on forwarded valued. Reverse
|
788
|
+
values are send unchanged.
|
789
|
+
|
790
|
+
@param fromPath {String} from path or null
|
791
|
+
@param placeholder {Object} optional placeholder value.
|
792
|
+
@returns {SC.Binding} this
|
793
|
+
*/
|
794
|
+
single: function(fromPath, placeholder) {
|
795
|
+
if (placeholder === undefined) {
|
796
|
+
placeholder = SC.MULTIPLE_PLACEHOLDER ;
|
797
|
+
}
|
798
|
+
return this.from(fromPath).transform(function(value, isForward) {
|
799
|
+
if (value && value.isEnumerable) {
|
800
|
+
var len = value.get('length');
|
801
|
+
value = (len>1) ? placeholder : (len<=0) ? null : value.firstObject();
|
802
|
+
}
|
803
|
+
return value ;
|
804
|
+
}) ;
|
805
|
+
},
|
806
|
+
|
807
|
+
/**
|
808
|
+
Adds a transform that will return the placeholder value if the value is
|
809
|
+
null, undefined, an empty array or an empty string. See also notNull().
|
810
|
+
|
811
|
+
@param fromPath {String} from path or null
|
812
|
+
@param placeholder {Object} optional placeholder.
|
813
|
+
@returns {SC.Binding} this
|
814
|
+
*/
|
815
|
+
notEmpty: function(fromPath, placeholder) {
|
816
|
+
if (placeholder === undefined) placeholder = SC.EMPTY_PLACEHOLDER ;
|
817
|
+
return this.from(fromPath).transform(function(value, isForward) {
|
818
|
+
if (SC.none(value) || (value === '') || (SC.isArray(value) && value.length === 0)) {
|
819
|
+
value = placeholder ;
|
820
|
+
}
|
821
|
+
return value ;
|
822
|
+
}) ;
|
823
|
+
},
|
824
|
+
|
825
|
+
/**
|
826
|
+
Adds a transform that will return the placeholder value if the value is
|
827
|
+
null. Otherwise it will passthrough untouched. See also notEmpty().
|
828
|
+
|
829
|
+
@param fromPath {String} from path or null
|
830
|
+
@param placeholder {Object} optional placeholder;
|
831
|
+
@returns {SC.Binding} this
|
832
|
+
*/
|
833
|
+
notNull: function(fromPath, placeholder) {
|
834
|
+
if (placeholder === undefined) placeholder = SC.EMPTY_PLACEHOLDER ;
|
835
|
+
return this.from(fromPath).transform(function(value, isForward) {
|
836
|
+
if (SC.none(value)) value = placeholder ;
|
837
|
+
return value ;
|
838
|
+
}) ;
|
839
|
+
},
|
840
|
+
|
841
|
+
/**
|
842
|
+
Adds a transform that will convert the passed value to an array. If
|
843
|
+
the value is null or undefined, it will be converted to an empty array.
|
844
|
+
|
845
|
+
@param fromPath {String} optional from path
|
846
|
+
@returns {SC.Binding} this
|
847
|
+
*/
|
848
|
+
multiple: function(fromPath) {
|
849
|
+
return this.from(fromPath).transform(function(value) {
|
850
|
+
if (!SC.isArray(value)) value = (value == null) ? [] : [value] ;
|
851
|
+
return value ;
|
852
|
+
}) ;
|
853
|
+
},
|
854
|
+
|
855
|
+
/**
|
856
|
+
Adds a transform to convert the value to a bool value. If the value is
|
857
|
+
an array it will return YES if array is not empty. If the value is a string
|
858
|
+
it will return YES if the string is not empty.
|
859
|
+
|
860
|
+
@param fromPath {String} optional from path
|
861
|
+
@returns {SC.Binding} this
|
862
|
+
*/
|
863
|
+
bool: function(fromPath) {
|
864
|
+
return this.from(fromPath).transform(function(v) {
|
865
|
+
var t = SC.typeOf(v) ;
|
866
|
+
if (t === SC.T_ERROR) return v ;
|
867
|
+
return (t == SC.T_ARRAY) ? (v.length > 0) : (v === '') ? NO : !!v ;
|
868
|
+
}) ;
|
869
|
+
},
|
870
|
+
|
871
|
+
/**
|
872
|
+
Adds a transform to convert the value to the inverse of a bool value. This
|
873
|
+
uses the same transform as bool() but inverts it.
|
874
|
+
|
875
|
+
@param fromPath {String} optional from path
|
876
|
+
@returns {SC.Binding} this
|
877
|
+
*/
|
878
|
+
not: function(fromPath) {
|
879
|
+
return this.from(fromPath).transform(function(v) {
|
880
|
+
var t = SC.typeOf(v) ;
|
881
|
+
if (t === SC.T_ERROR) return v ;
|
882
|
+
return !((t == SC.T_ARRAY) ? (v.length > 0) : (v === '') ? NO : !!v) ;
|
883
|
+
}) ;
|
884
|
+
},
|
885
|
+
|
886
|
+
/**
|
887
|
+
Adds a transform that will return YES if the value is null, NO otherwise.
|
888
|
+
|
889
|
+
@returns {SC.Binding} this
|
890
|
+
*/
|
891
|
+
isNull: function(fromPath) {
|
892
|
+
return this.from(fromPath).transform(function(v) {
|
893
|
+
var t = SC.typeOf(v) ;
|
894
|
+
return (t === SC.T_ERROR) ? v : SC.none(v) ;
|
895
|
+
});
|
896
|
+
},
|
897
|
+
|
898
|
+
toString: function() {
|
899
|
+
var from = this._fromRoot ? "<%@>:%@".fmt(this._fromRoot,this._fromPropertyPath) : this._fromPropertyPath;
|
900
|
+
|
901
|
+
var to = this._toRoot ? "<%@>:%@".fmt(this._toRoot,this._toPropertyPath) : this._toPropertyPath;
|
902
|
+
|
903
|
+
return "SC.Binding%@(%@ -> %@)".fmt(SC.guidFor(this), from, to) ;
|
904
|
+
}
|
905
|
+
} ;
|
906
|
+
|
907
|
+
/**
|
908
|
+
Shorthand method to define a binding. This is the same as calling:
|
909
|
+
|
910
|
+
{{{
|
911
|
+
SC.binding(path) = SC.Binding.from(path)
|
912
|
+
}}}
|
913
|
+
*/
|
914
|
+
SC.binding = function(path, root) { return SC.Binding.from(path,root); } ;
|
915
|
+
|