sproutcore 0.9.23 → 1.0.1003
Sign up to get free protection for your applications and to get access to all the features.
- data/Buildfile +125 -0
- data/History.txt +5 -569
- data/README.txt +99 -64
- data/Rakefile +236 -6
- data/Todo.txt +1 -0
- data/VERSION.yml +5 -0
- data/bin/sc-build +9 -210
- data/bin/sc-build-number +13 -0
- data/bin/sc-docs +14 -0
- data/bin/sc-gen +9 -23
- data/bin/sc-init +9 -34
- data/bin/sc-manifest +13 -0
- data/bin/sc-server +9 -82
- data/bin/sproutcore +10 -24
- data/buildtasks/build.rake +82 -0
- data/buildtasks/entry.rake +62 -0
- data/buildtasks/manifest.rake +565 -0
- data/buildtasks/render.rake +21 -0
- data/buildtasks/target.rake +61 -0
- data/design/Technical Notes.graffle/QuickLook/Preview.pdf +0 -0
- data/design/Technical Notes.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/design/Technical Notes.graffle/data.plist +5534 -0
- data/design/Technical Notes.graffle/image8.png +0 -0
- data/doc_templates/jsdoc/publish.js +170 -0
- data/doc_templates/jsdoc/static/default.css +162 -0
- data/{jsdoc/templates/sproutcore → doc_templates/jsdoc}/static/header.html +0 -0
- data/doc_templates/jsdoc/static/index.html +19 -0
- data/doc_templates/sproutcore/publish.js +345 -0
- data/doc_templates/sproutcore/static/default.css +258 -0
- data/doc_templates/sproutcore/static/header.html +2 -0
- data/doc_templates/sproutcore/static/index.html +19 -0
- data/frameworks/sproutcore/Buildfile +88 -0
- data/frameworks/sproutcore/HISTORY +10 -10
- data/frameworks/sproutcore/README +8 -1
- data/frameworks/sproutcore/apps/docs/core.js +27 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Preview.pdf +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/data.plist +14378 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image10.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image11.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image13.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image14.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image8.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image9.tiff +0 -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 +25 -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/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/main.js +28 -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/controllers/targets.js +49 -0
- data/frameworks/sproutcore/apps/welcome/core.js +30 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/loading.rhtml +10 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +7 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +77 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/apps/welcome/main.js +19 -0
- data/frameworks/sproutcore/apps/welcome/tests/controllers/targets.js +15 -0
- data/frameworks/sproutcore/design/CollectionView State Charts.graffle +4848 -0
- data/frameworks/sproutcore/design/Design Charts.graffle +18232 -0
- data/frameworks/sproutcore/design/Record State Table.numbers +0 -0
- data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Preview.pdf +0 -0
- data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/data.plist +19588 -0
- data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/image8.png +0 -0
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Preview.pdf +0 -0
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/data.plist +1452 -0
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/image8.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Preview.pdf +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/data.plist +24187 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image10.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image11.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image13.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image15.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image16.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image17.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image18.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image19.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image22.tiff +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image23.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image24.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image25.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image30.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image31.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image8.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image9.png +0 -0
- data/frameworks/sproutcore/frameworks/core_tools/core.js +20 -0
- data/frameworks/sproutcore/frameworks/core_tools/data_source.js +99 -0
- data/frameworks/sproutcore/frameworks/core_tools/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/frameworks/core_tools/fixtures/target.js +87 -0
- data/frameworks/sproutcore/frameworks/core_tools/fixtures/test.js +44 -0
- data/frameworks/sproutcore/frameworks/core_tools/models/target.js +108 -0
- data/frameworks/sproutcore/frameworks/core_tools/models/test.js +48 -0
- data/frameworks/sproutcore/frameworks/datastore/core.js +8 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +180 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +340 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +393 -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 +100 -0
- data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +152 -0
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +898 -0
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +462 -0
- data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +158 -0
- data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +411 -0
- data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +499 -0
- data/frameworks/sproutcore/frameworks/datastore/system/query.js +1488 -0
- data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +568 -0
- data/frameworks/sproutcore/frameworks/datastore/system/store.js +2407 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +117 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +131 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +119 -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 +384 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +55 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +81 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +245 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +53 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +48 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +169 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +51 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +97 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +178 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +216 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +204 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +149 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +171 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +154 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +113 -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/builders.js +219 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare.js +131 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/contains.js +131 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/containsRecordTypes.js +81 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/copy.js +30 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +185 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +92 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/expandedRecordTypes.js +64 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +202 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/queryWithScope.js +57 -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 +66 -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 +177 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +134 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +54 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +133 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +211 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +136 -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 +254 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +106 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +530 -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 +73 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +144 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +184 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +125 -0
- data/frameworks/sproutcore/frameworks/datejs/core.js +865 -0
- data/frameworks/sproutcore/frameworks/datejs/english.lproj/en-US.js +186 -0
- data/frameworks/sproutcore/frameworks/datejs/extras.js +332 -0
- data/frameworks/sproutcore/frameworks/datejs/license.js +25 -0
- data/frameworks/sproutcore/frameworks/datejs/parser.js +1116 -0
- data/frameworks/sproutcore/frameworks/datejs/spanish.lproj/es-CO.js +186 -0
- data/frameworks/sproutcore/frameworks/datejs/sugarpak.js +475 -0
- data/frameworks/sproutcore/frameworks/datejs/time.js +269 -0
- data/frameworks/sproutcore/frameworks/datejs/validators/datejs.js +34 -0
- data/frameworks/sproutcore/frameworks/debug/core.js +99 -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 +78 -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/{english.lproj/images/shared-icons.png → frameworks/desktop/english.lproj/images/icons/shared.png} +0 -0
- data/{clients/sc_test_runner → 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/{english.lproj → 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 +113 -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 +292 -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/drop_down.js +665 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +680 -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 +403 -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 +290 -0
- data/frameworks/sproutcore/frameworks/desktop/system/drag.js +869 -0
- data/frameworks/sproutcore/frameworks/desktop/system/key_bindings.js +40 -0
- data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +647 -0
- data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +187 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/datetime_recordattribute.js +73 -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/dropDown/methods.js +161 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/dropDown/ui.js +199 -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 +163 -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/displayProperties.js +31 -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 +174 -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/render.js +92 -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 +131 -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 +200 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +142 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +169 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +72 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +71 -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 +132 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +110 -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 +60 -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 +375 -0
- data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +126 -0
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +2775 -0
- data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +60 -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 +549 -0
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +657 -0
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +608 -0
- data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +20 -0
- data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +68 -0
- data/frameworks/sproutcore/frameworks/desktop/views/progress.js +233 -0
- data/frameworks/sproutcore/frameworks/desktop/views/radio.js +357 -0
- data/frameworks/sproutcore/frameworks/desktop/views/scene.js +204 -0
- data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +689 -0
- data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +227 -0
- data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +587 -0
- data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +311 -0
- data/frameworks/sproutcore/frameworks/desktop/views/separator.js +37 -0
- data/frameworks/sproutcore/frameworks/desktop/views/slider.js +261 -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 +684 -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 +87 -0
- data/frameworks/sproutcore/frameworks/foundation/TESTING +46 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +504 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +44 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +322 -0
- data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +105 -0
- data/frameworks/sproutcore/frameworks/foundation/core.js +144 -0
- data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +194 -0
- data/frameworks/sproutcore/{english.lproj → frameworks/foundation/english.lproj}/blank.gif +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +81 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +33 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +438 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +9 -0
- data/frameworks/sproutcore/{english.lproj → frameworks/foundation/english.lproj}/images/sproutcore-logo.png +0 -0
- data/{clients/sc_test_runner/english.lproj/controls.css → frameworks/sproutcore/frameworks/foundation/english.lproj/inline_editor.css} +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +31 -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 +133 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +51 -0
- data/frameworks/sproutcore/frameworks/foundation/ext/object.js +83 -0
- data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +161 -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 +355 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +179 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +91 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +386 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +150 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +491 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +233 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +148 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +334 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +160 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +189 -0
- data/frameworks/sproutcore/frameworks/foundation/panes/main.js +51 -0
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +661 -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 +502 -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/bundle.js +267 -0
- data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +2028 -0
- data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +129 -0
- data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +915 -0
- data/frameworks/sproutcore/frameworks/foundation/system/event.js +849 -0
- data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +432 -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 +905 -0
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +386 -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 +525 -0
- data/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +103 -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 +233 -0
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +482 -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 +56 -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 +252 -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 +24 -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/validators/validator.js +20 -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 +52 -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 +113 -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 +446 -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 +116 -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 +223 -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 +314 -0
- data/frameworks/sproutcore/frameworks/foundation/views/container.js +136 -0
- data/frameworks/sproutcore/frameworks/foundation/views/field.js +347 -0
- data/frameworks/sproutcore/frameworks/foundation/views/image.js +178 -0
- data/frameworks/sproutcore/frameworks/foundation/views/label.js +285 -0
- data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +662 -0
- data/frameworks/sproutcore/frameworks/foundation/views/view.js +2521 -0
- data/frameworks/sproutcore/frameworks/mini/license.js +28 -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 +950 -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/comparable.js +45 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +64 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +110 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1238 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +110 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1315 -0
- data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +141 -0
- data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +173 -0
- data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +172 -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 +943 -0
- data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +106 -0
- data/frameworks/sproutcore/frameworks/runtime/system/error.js +157 -0
- data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +1193 -0
- data/frameworks/sproutcore/frameworks/runtime/system/object.js +834 -0
- data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +271 -0
- data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +245 -0
- data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +669 -0
- data/frameworks/sproutcore/frameworks/runtime/system/set.js +425 -0
- data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +379 -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 +84 -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/inspect.js +27 -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/comparable.js +44 -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/error.js +52 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +195 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/addEach.js +49 -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/removeEach.js +49 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +89 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +148 -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 +175 -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 +128 -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 +695 -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 +81 -33
- data/frameworks/sproutcore/license.js +28 -28
- 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/Source/Panel.drawit/Data +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Preview.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Thumbnail.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/Data +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Preview.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Thumbnail.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/100.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/102.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/110.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/120.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/127.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/24.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/26.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/27.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/28.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/29.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/30.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/31.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/33.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/37.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/41.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/99.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/100.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/102.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/110.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/120.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/127.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/24.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/26.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/27.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/28.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/29.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/30.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/31.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/33.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/37.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/41.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/99.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/100.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/102.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/110.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/120.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/127.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/24.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/26.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/27.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/28.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/29.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/30.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/31.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/33.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/37.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/41.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/99.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/Data +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Preview.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Thumbnail.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/Data +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Preview.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Thumbnail.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x-2.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-sprite.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-ysprite.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/shared-icons.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sproutcore-logo.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sticky-note.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +327 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +93 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +126 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/core.css +76 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +57 -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/{english.lproj → 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/menu_item_view.css +3 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/pane.css +8 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/background-fat.jpg +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/background-thin.jpg +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-edge.png +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-left-corner.png +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-right-corner.png +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/left-edge.png +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/overlay.png +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/right-edge.png +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-edge.png +0 -0
- data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-left-corner.png +0 -0
- data/frameworks/sproutcore/{english.lproj → 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 +149 -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 +19 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +20 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/toolbar.css +7 -0
- data/gen/Buildfile +16 -0
- data/gen/app/Buildfile +36 -0
- data/gen/app/README +1 -0
- data/gen/app/USAGE +13 -0
- data/gen/app/templates/apps/@target_name@/core.js +27 -0
- data/gen/app/templates/apps/@target_name@/main.js +30 -0
- data/gen/app/templates/apps/@target_name@/resources/loading.rhtml +9 -0
- data/gen/app/templates/apps/@target_name@/resources/main_page.js +24 -0
- data/gen/controller/Buildfile +18 -0
- data/gen/controller/README +1 -0
- data/gen/controller/USAGE +13 -0
- data/gen/controller/templates/controllers/@filename@.js +18 -0
- data/gen/controller/templates/tests/controllers/@filename@.js +15 -0
- data/gen/design/Buildfile +23 -0
- data/gen/design/README +1 -0
- data/gen/design/USAGE +10 -0
- data/gen/design/templates/resources/@filename@.js +16 -0
- data/gen/framework/Buildfile +36 -0
- data/gen/framework/README +1 -0
- data/gen/framework/USAGE +13 -0
- data/gen/framework/templates/frameworks/@target_name@/core.js +21 -0
- data/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +15 -0
- data/gen/language/Buildfile +26 -0
- data/gen/language/README +1 -0
- data/gen/language/USAGE +13 -0
- data/gen/language/templates/@filename@/strings.js +14 -0
- data/gen/model/Buildfile +16 -0
- data/gen/model/README +1 -0
- data/gen/model/USAGE +15 -0
- data/gen/model/templates/fixtures/@filename@.js +35 -0
- data/gen/model/templates/models/@filename@.js +19 -0
- data/gen/model/templates/tests/models/@filename@.js +15 -0
- data/gen/page/Buildfile +36 -0
- data/gen/page/README +1 -0
- data/gen/page/USAGE +15 -0
- data/gen/page/templates/pages/@target_name@/Buildfile +16 -0
- data/gen/page/templates/pages/@target_name@/core.js +22 -0
- data/gen/page/templates/pages/@target_name@/en.lproj/strings.js +14 -0
- data/gen/page/templates/pages/@target_name@/resources/body.css +1 -0
- data/gen/page/templates/pages/@target_name@/resources/body.rhtml +7 -0
- data/gen/project/Buildfile +45 -0
- data/gen/project/INIT +3 -0
- data/gen/project/README +1 -0
- data/gen/project/USAGE +2 -0
- data/gen/project/templates/@filename@/Buildfile +7 -0
- data/gen/project/templates/@filename@/README +7 -0
- data/gen/test/Buildfile +25 -0
- data/gen/test/README +1 -0
- data/gen/test/USAGE +12 -0
- data/gen/test/templates/tests/@filename@.js +15 -0
- data/gen/theme/Buildfile +36 -0
- data/gen/theme/README +1 -0
- data/gen/theme/USAGE +13 -0
- data/gen/theme/templates/themes/@target_name@/resources/theme_styles.css +11 -0
- data/gen/view/Buildfile +18 -0
- data/gen/view/README +1 -0
- data/gen/view/USAGE +13 -0
- data/gen/view/templates/tests/views/@filename@.js +15 -0
- data/gen/view/templates/views/@filename@.js +18 -0
- data/lib/sproutcore/builders/base.rb +91 -0
- data/lib/sproutcore/builders/bundle.rb +63 -0
- data/lib/sproutcore/builders/combine.rb +37 -0
- data/lib/sproutcore/builders/html.rb +205 -0
- data/lib/sproutcore/builders/javascript.rb +62 -0
- data/lib/sproutcore/builders/minify.rb +133 -0
- data/lib/sproutcore/builders/sass.rb +55 -0
- data/lib/sproutcore/builders/strings.rb +44 -0
- data/lib/sproutcore/builders/stylesheet.rb +40 -0
- data/lib/sproutcore/builders/test.rb +59 -0
- data/lib/sproutcore/builders/test_index.rb +26 -0
- data/lib/sproutcore/buildfile/build_task.rb +33 -0
- data/lib/sproutcore/buildfile/buildfile_dsl.rb +162 -0
- data/lib/sproutcore/buildfile/cloneable.rb +34 -0
- data/lib/sproutcore/buildfile/early_time.rb +30 -0
- data/lib/sproutcore/buildfile/invocation_chain.rb +64 -0
- data/lib/sproutcore/buildfile/namespace.rb +33 -0
- data/lib/sproutcore/buildfile/string_ext.rb +198 -0
- data/lib/sproutcore/buildfile/task.rb +304 -0
- data/lib/sproutcore/buildfile/task_arguments.rb +86 -0
- data/lib/sproutcore/buildfile/task_manager.rb +193 -0
- data/lib/sproutcore/buildfile.rb +484 -0
- data/lib/sproutcore/deprecated/view_helper.rb +662 -0
- data/lib/sproutcore/helpers/capture_helper.rb +9 -1
- data/lib/sproutcore/helpers/cssmin.rb +202 -0
- data/lib/sproutcore/helpers/dom_id_helper.rb +8 -1
- data/lib/sproutcore/helpers/entry_sorter.rb +139 -0
- data/lib/sproutcore/helpers/packed_optimizer.rb +102 -0
- data/lib/sproutcore/helpers/static_helper.rb +223 -41
- data/lib/sproutcore/helpers/tag_helper.rb +73 -1
- data/lib/sproutcore/helpers/text_helper.rb +24 -57
- data/lib/sproutcore/models/generator.rb +493 -0
- data/lib/sproutcore/models/hash_struct.rb +109 -0
- data/lib/sproutcore/models/manifest.rb +376 -0
- data/lib/sproutcore/models/manifest_entry.rb +252 -0
- data/lib/sproutcore/models/project.rb +267 -0
- data/lib/sproutcore/models/target.rb +664 -0
- data/lib/sproutcore/rack/builder.rb +331 -0
- data/lib/sproutcore/rack/dev.rb +51 -0
- data/lib/sproutcore/rack/docs.rb +24 -0
- data/lib/sproutcore/rack/filesystem.rb +265 -0
- data/lib/sproutcore/rack/proxy.rb +100 -0
- data/lib/sproutcore/rack/service.rb +155 -0
- data/lib/sproutcore/rack/test_runner.rb +24 -0
- data/lib/sproutcore/render_engines/erubis.rb +55 -0
- data/lib/sproutcore/render_engines/haml.rb +39 -0
- data/lib/sproutcore/tools/build.rb +80 -0
- data/lib/sproutcore/tools/build_number.rb +23 -0
- data/lib/sproutcore/tools/docs.rb +53 -0
- data/lib/sproutcore/tools/gen.rb +99 -0
- data/lib/sproutcore/tools/init.rb +40 -0
- data/lib/sproutcore/tools/manifest.rb +85 -0
- data/lib/sproutcore/tools/server.rb +48 -0
- data/lib/sproutcore/tools.rb +341 -0
- data/lib/sproutcore.rb +141 -18
- 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/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/package.rb +18 -0
- data/lib/thor/lib/thor/tasks.rb +77 -0
- data/lib/thor/lib/thor/util.rb +75 -0
- data/lib/thor/lib/thor.rb +170 -0
- data/lib/thor/script/destroy +14 -0
- data/lib/thor/script/generate +14 -0
- data/lib/thor/spec/fixtures/task.thor +10 -0
- data/lib/thor/spec/options_spec.rb +271 -0
- data/lib/thor/spec/ordered_hash_spec.rb +84 -0
- data/lib/thor/spec/spec.opts +1 -0
- data/lib/thor/spec/spec_helper.rb +30 -0
- data/lib/thor/spec/task_spec.rb +11 -0
- data/lib/thor/spec/tasks_spec.rb +28 -0
- data/lib/thor/spec/thor_runner_spec.rb +194 -0
- data/lib/thor/spec/thor_spec.rb +206 -0
- data/lib/thor/spec/util_spec.rb +99 -0
- data/lib/thor/task.thor +15 -0
- data/lib/thor/thor.gemspec +29 -0
- data/spec/buildtasks/build/copy_spec.rb +60 -0
- data/spec/buildtasks/build/spec_helper.rb +36 -0
- data/spec/buildtasks/manifest/catalog_spec.rb +48 -0
- data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +126 -0
- data/spec/buildtasks/manifest/localize_spec.rb +97 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/bundle_spec.rb +254 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +246 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +87 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +175 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +65 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +70 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +152 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +98 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +64 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +163 -0
- data/spec/buildtasks/manifest/prepare_spec.rb +43 -0
- data/spec/buildtasks/manifest/spec_helper.rb +35 -0
- data/spec/buildtasks/target_spec.rb +270 -0
- data/spec/fixtures/builder_tests/Buildfile +20 -0
- data/spec/fixtures/builder_tests/apps/bundle_test/bundle.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/a.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/b.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/c.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +2 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +1 -0
- 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 +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +4 -0
- 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 +4 -0
- data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +15 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +4 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +7 -0
- data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +3 -0
- data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +8 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +9 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +12 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +3 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +4 -0
- 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/dynamic_req_target_1/dynamic_req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/dynamic_req_target_1/english.lproj/dynamic_req_style_1.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 +4 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +1 -0
- 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 +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +1 -0
- 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 +1 -0
- data/spec/fixtures/buildfiles/basic/Buildfile +16 -0
- data/spec/fixtures/buildfiles/basic/task_module.rake +6 -0
- data/spec/fixtures/buildfiles/installed/Buildfile +7 -0
- data/spec/fixtures/buildfiles/installed/Buildfile2 +5 -0
- data/spec/fixtures/buildfiles/project_test/Buildfile +4 -0
- data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +2 -0
- data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/Buildfile +1 -0
- 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 +8 -0
- 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 +5 -0
- 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 +8 -0
- data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +1 -0
- 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 +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/B.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/c.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/core.js +1 -0
- 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/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/a.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 +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +1 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/a.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/b.js +3 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/c.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +1 -0
- data/spec/fixtures/real_world/Buildfile +12 -0
- data/spec/fixtures/real_world/apps/account/README +1 -0
- data/spec/fixtures/real_world/apps/calendar/README +1 -0
- data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +1 -0
- data/spec/fixtures/real_world/apps/files/README +1 -0
- data/spec/fixtures/real_world/apps/mail/README +1 -0
- data/spec/fixtures/real_world/apps/mobile_photos/README +1 -0
- data/spec/fixtures/real_world/apps/photos/README +1 -0
- data/spec/fixtures/real_world/apps/uploader/README +1 -0
- 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 +26 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/README +1 -0
- 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 +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +1 -0
- 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 +1 -0
- 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 +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +1 -0
- 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 +6 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +3 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/resources/boo.png +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +6 -0
- 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 +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +1 -0
- data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
- data/spec/fixtures/recursive_project/Buildfile +8 -0
- data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
- data/spec/lib/builders/bundle_spec.rb +294 -0
- data/spec/lib/builders/combine_spec.rb +67 -0
- data/spec/lib/builders/html_spec.rb +579 -0
- data/spec/lib/builders/javascript_spec.rb +81 -0
- data/spec/lib/builders/sass_spec.rb +43 -0
- data/spec/lib/builders/spec_helper.rb +30 -0
- data/spec/lib/builders/strings_spec.rb +52 -0
- data/spec/lib/builders/stylesheet_spec.rb +63 -0
- data/spec/lib/builders/test_index_spec.rb +44 -0
- data/spec/lib/builders/test_spec.rb +136 -0
- data/spec/lib/buildfile/config_for_spec.rb +81 -0
- data/spec/lib/buildfile/define_spec.rb +59 -0
- data/spec/lib/buildfile/dup_spec.rb +65 -0
- data/spec/lib/buildfile/invoke_spec.rb +130 -0
- data/spec/lib/buildfile/load_spec.rb +49 -0
- data/spec/lib/buildfile/task/dup_spec.rb +55 -0
- data/spec/lib/buildfile/task_defined_spec.rb +17 -0
- data/spec/lib/buildfile_commands/build_task_spec.rb +19 -0
- data/spec/lib/buildfile_commands/config_spec.rb +97 -0
- data/spec/lib/buildfile_commands/import_spec.rb +17 -0
- data/spec/lib/buildfile_commands/namespace_spec.rb +18 -0
- data/spec/lib/buildfile_commands/proxies_spec.rb +38 -0
- data/spec/lib/buildfile_commands/replace_task_spec.rb +29 -0
- data/spec/lib/buildfile_commands/task_spec.rb +36 -0
- data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +26 -0
- data/spec/lib/models/hash_struct/deep_clone_spec.rb +27 -0
- data/spec/lib/models/hash_struct/has_options_spec.rb +32 -0
- data/spec/lib/models/hash_struct/hash_spec.rb +64 -0
- data/spec/lib/models/hash_struct/merge_spec.rb +26 -0
- data/spec/lib/models/hash_struct/method_missing.rb +41 -0
- data/spec/lib/models/manifest/add_entry_spec.rb +36 -0
- data/spec/lib/models/manifest/add_transform_spec.rb +91 -0
- data/spec/lib/models/manifest/build_spec.rb +78 -0
- data/spec/lib/models/manifest/entry_for_spec.rb +94 -0
- data/spec/lib/models/manifest/find_entry.rb +97 -0
- data/spec/lib/models/manifest/prepare_spec.rb +62 -0
- data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +31 -0
- data/spec/lib/models/manifest_entry/prepare_spec.rb +54 -0
- data/spec/lib/models/project/add_target_spec.rb +44 -0
- data/spec/lib/models/project/buildfile_spec.rb +35 -0
- data/spec/lib/models/project/find_targets_for_spec.rb +78 -0
- data/spec/lib/models/project/load_nearest_project_spec.rb +23 -0
- data/spec/lib/models/project/target_for_spec.rb +33 -0
- data/spec/lib/models/project/targets_spec.rb +62 -0
- data/spec/lib/models/target/compute_build_number_spec.rb +125 -0
- data/spec/lib/models/target/config_spec.rb +30 -0
- data/spec/lib/models/target/expand_required_targets_spec.rb +48 -0
- data/spec/lib/models/target/installed_languages_spec.rb +47 -0
- data/spec/lib/models/target/lproj_for_spec.rb +38 -0
- data/spec/lib/models/target/manifest_for_spec.rb +42 -0
- data/spec/lib/models/target/parent_target_spec.rb +21 -0
- data/spec/lib/models/target/prepare_spec.rb +53 -0
- data/spec/lib/models/target/required_targets_spec.rb +119 -0
- data/spec/lib/models/target/target_for_spec.rb +56 -0
- data/spec/lib/tools/build_number_spec.rb +28 -0
- data/spec/lib/tools/gen_spec.rb +207 -0
- data/spec/lib/tools/tools_spec.rb +78 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +137 -6
- data/sproutcore-abbot.gemspec +1582 -0
- data/vendor/github_gem_lint.rb +22 -0
- data/{jsdoc → vendor/jsdoc}/README.txt +0 -0
- data/vendor/jsdoc/app/frame/Chain.js +102 -0
- data/vendor/jsdoc/app/frame/Dumper.js +144 -0
- data/vendor/jsdoc/app/frame/Hash.js +47 -0
- data/vendor/jsdoc/app/frame/Link.js +142 -0
- data/vendor/jsdoc/app/frame/Namespace.js +10 -0
- data/vendor/jsdoc/app/frame/Opt.js +134 -0
- data/vendor/jsdoc/app/frame/Reflection.js +26 -0
- data/vendor/jsdoc/app/frame/String.js +93 -0
- data/vendor/jsdoc/app/frame/Testrun.js +129 -0
- data/vendor/jsdoc/app/frame.js +33 -0
- data/vendor/jsdoc/app/handlers/FOODOC.js +26 -0
- data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/DomReader.js +0 -0
- data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/XMLDoc.js +0 -0
- data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/XMLParse.js +0 -0
- data/vendor/jsdoc/app/handlers/XMLDOC.js +26 -0
- data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +200 -0
- data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +294 -0
- data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +162 -0
- data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +100 -0
- data/vendor/jsdoc/app/lib/JSDOC/Lang.js +144 -0
- data/vendor/jsdoc/app/lib/JSDOC/Parser.js +109 -0
- data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +33 -0
- data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +681 -0
- data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +226 -0
- data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +41 -0
- data/vendor/jsdoc/app/lib/JSDOC/Token.js +18 -0
- data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +332 -0
- data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +133 -0
- data/vendor/jsdoc/app/lib/JSDOC/Util.js +32 -0
- data/vendor/jsdoc/app/lib/JSDOC/Walker.js +453 -0
- data/vendor/jsdoc/app/lib/JSDOC.js +98 -0
- data/vendor/jsdoc/app/main.js +74 -0
- data/vendor/jsdoc/app/plugins/commentSrcJson.js +19 -0
- data/vendor/jsdoc/app/plugins/frameworkPrototype.js +16 -0
- data/vendor/jsdoc/app/plugins/functionCall.js +10 -0
- data/vendor/jsdoc/app/plugins/publishSrcHilite.js +62 -0
- data/{jsdoc → vendor/jsdoc}/app/plugins/sproutcoreTags.js +0 -0
- data/vendor/jsdoc/app/plugins/symbolLink.js +9 -0
- data/vendor/jsdoc/app/plugins/tagParamConfig.js +31 -0
- data/vendor/jsdoc/app/plugins/tagSynonyms.js +43 -0
- data/vendor/jsdoc/app/run.js +346 -0
- data/vendor/jsdoc/app/t/TestDoc.js +144 -0
- data/{jsdoc → vendor/jsdoc/app}/t/runner.js +0 -0
- data/{jsdoc → vendor/jsdoc/app}/test/addon.js +0 -0
- data/{jsdoc → vendor/jsdoc/app}/test/anon_inner.js +0 -0
- data/vendor/jsdoc/app/test/augments.js +31 -0
- data/vendor/jsdoc/app/test/augments2.js +26 -0
- data/vendor/jsdoc/app/test/borrows.js +41 -0
- data/vendor/jsdoc/app/test/borrows2.js +23 -0
- data/{jsdoc → vendor/jsdoc/app}/test/config.js +0 -0
- data/vendor/jsdoc/app/test/constructs.js +18 -0
- data/{jsdoc → vendor/jsdoc/app}/test/encoding.js +0 -0
- data/{jsdoc → vendor/jsdoc/app}/test/encoding_other.js +0 -0
- data/vendor/jsdoc/app/test/functions_anon.js +39 -0
- data/vendor/jsdoc/app/test/functions_nested.js +33 -0
- data/vendor/jsdoc/app/test/global.js +13 -0
- data/vendor/jsdoc/app/test/globals.js +25 -0
- data/vendor/jsdoc/app/test/ignore.js +10 -0
- data/{jsdoc → vendor/jsdoc/app}/test/inner.js +0 -0
- data/vendor/jsdoc/app/test/jsdoc_test.js +477 -0
- data/vendor/jsdoc/app/test/lend.js +33 -0
- data/vendor/jsdoc/app/test/memberof.js +20 -0
- data/vendor/jsdoc/app/test/memberof_constructor.js +15 -0
- data/vendor/jsdoc/app/test/name.js +19 -0
- data/vendor/jsdoc/app/test/namespace_nested.js +23 -0
- data/{jsdoc → vendor/jsdoc/app}/test/nocode.js +0 -0
- data/vendor/jsdoc/app/test/oblit_anon.js +20 -0
- data/vendor/jsdoc/app/test/overview.js +20 -0
- data/vendor/jsdoc/app/test/param_inline.js +37 -0
- data/{jsdoc → vendor/jsdoc/app}/test/params_optional.js +0 -0
- data/vendor/jsdoc/app/test/prototype.js +17 -0
- data/{jsdoc → vendor/jsdoc/app}/test/prototype_nested.js +0 -0
- data/vendor/jsdoc/app/test/prototype_oblit.js +13 -0
- data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +24 -0
- data/vendor/jsdoc/app/test/public.js +10 -0
- data/{jsdoc → vendor/jsdoc/app}/test/shared.js +0 -0
- data/{jsdoc → vendor/jsdoc/app}/test/shared2.js +0 -0
- data/vendor/jsdoc/app/test/shortcuts.js +22 -0
- data/vendor/jsdoc/app/test/static_this.js +13 -0
- data/vendor/jsdoc/app/test/synonyms.js +23 -0
- data/{jsdoc → vendor/jsdoc/app}/test/tosource.js +0 -0
- data/vendor/jsdoc/app/test/variable_redefine.js +14 -0
- data/vendor/jsdoc/app/test.js +304 -0
- data/{jsdoc → vendor/jsdoc}/changes.txt +0 -0
- data/{jsdoc → vendor/jsdoc}/conf/sample.conf +0 -0
- data/{jsdoc → vendor/jsdoc}/java/build.xml +0 -0
- data/{jsdoc → vendor/jsdoc}/java/build_1.4.xml +0 -0
- data/{jsdoc → vendor/jsdoc}/java/classes/js.jar +0 -0
- data/{jsdoc → vendor/jsdoc}/java/src/JsDebugRun.java +0 -0
- data/{jsdoc → vendor/jsdoc}/java/src/JsRun.java +0 -0
- data/{jsdoc → vendor/jsdoc}/jsdebug.jar +0 -0
- data/{jsdoc → vendor/jsdoc}/jsrun.jar +0 -0
- data/{jsdoc → vendor/jsdoc}/t/TestDoc.js +0 -0
- data/vendor/jsdoc/t/runner.js +13 -0
- data/vendor/jsdoc/test/addon.js +24 -0
- data/vendor/jsdoc/test/anon_inner.js +14 -0
- data/{jsdoc → vendor/jsdoc}/test/augments.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/augments2.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/borrows.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/borrows2.js +0 -0
- data/vendor/jsdoc/test/config.js +22 -0
- data/{jsdoc → vendor/jsdoc}/test/constructs.js +0 -0
- data/vendor/jsdoc/test/encoding.js +10 -0
- data/vendor/jsdoc/test/encoding_other.js +12 -0
- data/{jsdoc → vendor/jsdoc}/test/functions_anon.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/functions_nested.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/global.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/globals.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/ignore.js +0 -0
- data/vendor/jsdoc/test/inner.js +16 -0
- data/{jsdoc → vendor/jsdoc}/test/jsdoc_test.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/lend.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/memberof.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/memberof_constructor.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/name.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/namespace_nested.js +0 -0
- data/vendor/jsdoc/test/nocode.js +13 -0
- data/{jsdoc → vendor/jsdoc}/test/oblit_anon.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/overview.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/param_inline.js +0 -0
- data/vendor/jsdoc/test/params_optional.js +8 -0
- data/{jsdoc → vendor/jsdoc}/test/prototype.js +0 -0
- data/vendor/jsdoc/test/prototype_nested.js +9 -0
- data/{jsdoc → vendor/jsdoc}/test/prototype_oblit.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/prototype_oblit_constructor.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/public.js +0 -0
- data/vendor/jsdoc/test/shared.js +42 -0
- data/vendor/jsdoc/test/shared2.js +2 -0
- data/{jsdoc → vendor/jsdoc}/test/shortcuts.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/static_this.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test/synonyms.js +0 -0
- data/vendor/jsdoc/test/tosource.js +23 -0
- data/{jsdoc → vendor/jsdoc}/test/variable_redefine.js +0 -0
- data/{jsdoc → vendor/jsdoc}/test.js +0 -0
- data/{yui_compressor → vendor/yui-compressor}/yuicompressor-2.4.2.jar +0 -0
- metadata +1537 -431
- data/License.txt +0 -20
- data/Manifest.txt +0 -415
- data/app_generators/sproutcore/USAGE +0 -4
- data/app_generators/sproutcore/sproutcore_generator.rb +0 -68
- data/app_generators/sproutcore/templates/README +0 -80
- data/app_generators/sproutcore/templates/sc-config +0 -93
- data/bin/sc-ide +0 -278
- data/bin/sc-install +0 -101
- data/bin/sc-remove +0 -99
- data/bin/sc-update +0 -99
- data/clients/sc_docs/HISTORY +0 -3
- data/clients/sc_docs/README +0 -6
- data/clients/sc_docs/controllers/docs.js +0 -150
- data/clients/sc_docs/core.js +0 -19
- data/clients/sc_docs/english.lproj/body.css +0 -112
- data/clients/sc_docs/english.lproj/body.rhtml +0 -58
- data/clients/sc_docs/english.lproj/no_docs.rhtml +0 -8
- data/clients/sc_docs/english.lproj/strings.js +0 -14
- data/clients/sc_docs/english.lproj/tabs.rhtml +0 -16
- data/clients/sc_docs/fixtures/doc.js +0 -11
- data/clients/sc_docs/main.js +0 -26
- data/clients/sc_docs/models/doc.js +0 -15
- data/clients/sc_docs/tests/controllers/docs.rhtml +0 -20
- data/clients/sc_docs/tests/models/doc.rhtml +0 -20
- data/clients/sc_docs/tests/views/doc_frame.rhtml +0 -20
- data/clients/sc_docs/tests/views/doc_label_view.rhtml +0 -20
- data/clients/sc_docs/views/doc_frame.js +0 -33
- data/clients/sc_docs/views/doc_label.js +0 -20
- data/clients/sc_test_runner/HISTORY +0 -3
- data/clients/sc_test_runner/README +0 -4
- data/clients/sc_test_runner/controllers/runner.js +0 -203
- data/clients/sc_test_runner/core.js +0 -19
- data/clients/sc_test_runner/english.lproj/body.css +0 -91
- data/clients/sc_test_runner/english.lproj/body.rhtml +0 -76
- data/clients/sc_test_runner/english.lproj/icons/small/next.png +0 -0
- data/clients/sc_test_runner/english.lproj/icons/small/reset.png +0 -0
- data/clients/sc_test_runner/english.lproj/images/gradients.png +0 -0
- data/clients/sc_test_runner/english.lproj/images/toolbar.png +0 -0
- data/clients/sc_test_runner/english.lproj/no_tests.rhtml +0 -5
- data/clients/sc_test_runner/english.lproj/strings.js +0 -14
- data/clients/sc_test_runner/fixtures/test.js +0 -12
- data/clients/sc_test_runner/main.js +0 -21
- data/clients/sc_test_runner/models/test.js +0 -27
- data/clients/sc_test_runner/views/runner_frame.js +0 -74
- data/clients/sc_test_runner/views/test_label.js +0 -20
- data/config/hoe.rb +0 -72
- data/config/requirements.rb +0 -17
- data/frameworks/prototype/HISTORY +0 -3
- data/frameworks/prototype/README +0 -2
- data/frameworks/prototype/prototype.js +0 -4223
- data/frameworks/sproutcore/controllers/array.js +0 -409
- data/frameworks/sproutcore/controllers/collection.js +0 -203
- data/frameworks/sproutcore/controllers/controller.js +0 -323
- data/frameworks/sproutcore/controllers/object.js +0 -401
- data/frameworks/sproutcore/core.js +0 -636
- data/frameworks/sproutcore/debug/trace.js +0 -81
- data/frameworks/sproutcore/debug/unittest.js +0 -626
- data/frameworks/sproutcore/drag/drag.js +0 -788
- data/frameworks/sproutcore/drag/drag_data_source.js +0 -40
- data/frameworks/sproutcore/drag/drag_source.js +0 -75
- data/frameworks/sproutcore/drag/drop_target.js +0 -160
- data/frameworks/sproutcore/english.lproj/buttons.css +0 -694
- data/frameworks/sproutcore/english.lproj/core.css +0 -145
- data/frameworks/sproutcore/english.lproj/detect-browser +0 -44
- data/frameworks/sproutcore/english.lproj/icons.css +0 -227
- data/frameworks/sproutcore/english.lproj/images/indicator.gif +0 -0
- data/frameworks/sproutcore/english.lproj/images/sc-theme-sprite.png +0 -0
- data/frameworks/sproutcore/english.lproj/menu.css +0 -122
- data/frameworks/sproutcore/english.lproj/panes.css +0 -136
- data/frameworks/sproutcore/english.lproj/picker.css +0 -22
- data/frameworks/sproutcore/english.lproj/splitview.css +0 -83
- data/frameworks/sproutcore/english.lproj/strings.js +0 -20
- data/frameworks/sproutcore/english.lproj/tab.css +0 -23
- data/frameworks/sproutcore/english.lproj/tests.css +0 -67
- data/frameworks/sproutcore/english.lproj/theme.css +0 -502
- data/frameworks/sproutcore/foundation/animator.js +0 -679
- data/frameworks/sproutcore/foundation/application.js +0 -228
- data/frameworks/sproutcore/foundation/benchmark.js +0 -244
- data/frameworks/sproutcore/foundation/binding.js +0 -385
- data/frameworks/sproutcore/foundation/date.js +0 -357
- data/frameworks/sproutcore/foundation/enumerator.js +0 -105
- data/frameworks/sproutcore/foundation/error.js +0 -84
- data/frameworks/sproutcore/foundation/input_manager.js +0 -165
- data/frameworks/sproutcore/foundation/json.js +0 -296
- data/frameworks/sproutcore/foundation/mock.js +0 -42
- data/frameworks/sproutcore/foundation/node_descriptor.js +0 -71
- data/frameworks/sproutcore/foundation/object.js +0 -875
- data/frameworks/sproutcore/foundation/page.js +0 -67
- data/frameworks/sproutcore/foundation/path_module.js +0 -431
- data/frameworks/sproutcore/foundation/responder.js +0 -313
- data/frameworks/sproutcore/foundation/routes.js +0 -375
- data/frameworks/sproutcore/foundation/run_loop.js +0 -322
- data/frameworks/sproutcore/foundation/set.js +0 -222
- data/frameworks/sproutcore/foundation/string.js +0 -319
- data/frameworks/sproutcore/foundation/timer.js +0 -405
- data/frameworks/sproutcore/foundation/undo_manager.js +0 -186
- data/frameworks/sproutcore/foundation/utils.js +0 -320
- data/frameworks/sproutcore/globals/panels.js +0 -182
- data/frameworks/sproutcore/globals/popups.js +0 -61
- data/frameworks/sproutcore/globals/window.js +0 -498
- data/frameworks/sproutcore/lib/button_views.rb +0 -330
- data/frameworks/sproutcore/lib/collection_view.rb +0 -83
- data/frameworks/sproutcore/lib/core_views.rb +0 -326
- data/frameworks/sproutcore/lib/form_views.rb +0 -253
- data/frameworks/sproutcore/lib/menu_views.rb +0 -93
- data/frameworks/sproutcore/mixins/array.js +0 -265
- data/frameworks/sproutcore/mixins/collection_view_delegate.js +0 -201
- data/frameworks/sproutcore/mixins/control.js +0 -265
- data/frameworks/sproutcore/mixins/delegate_support.js +0 -66
- data/frameworks/sproutcore/mixins/editable.js +0 -144
- data/frameworks/sproutcore/mixins/enumerable.js +0 -1002
- data/frameworks/sproutcore/mixins/inline_editor_delegate.js +0 -82
- data/frameworks/sproutcore/mixins/observable.js +0 -1060
- data/frameworks/sproutcore/mixins/scrollable.js +0 -246
- data/frameworks/sproutcore/mixins/selection_support.js +0 -160
- data/frameworks/sproutcore/mixins/validatable.js +0 -152
- data/frameworks/sproutcore/models/collection.js +0 -421
- data/frameworks/sproutcore/models/record.js +0 -811
- data/frameworks/sproutcore/models/store.js +0 -352
- data/frameworks/sproutcore/panes/dialog.js +0 -16
- data/frameworks/sproutcore/panes/manager.js +0 -164
- data/frameworks/sproutcore/panes/menu.js +0 -45
- data/frameworks/sproutcore/panes/overlay.js +0 -235
- data/frameworks/sproutcore/panes/pane.js +0 -117
- data/frameworks/sproutcore/panes/panel.js +0 -19
- data/frameworks/sproutcore/panes/picker.js +0 -46
- data/frameworks/sproutcore/server/rails_server.js +0 -79
- data/frameworks/sproutcore/server/rest_server.js +0 -177
- data/frameworks/sproutcore/server/server.js +0 -629
- data/frameworks/sproutcore/tests/controllers/array.rhtml +0 -126
- data/frameworks/sproutcore/tests/controllers/controller.rhtml +0 -273
- data/frameworks/sproutcore/tests/controllers/object.rhtml +0 -353
- data/frameworks/sproutcore/tests/core/guidFor.rhtml +0 -114
- data/frameworks/sproutcore/tests/foundation/application.rhtml +0 -125
- data/frameworks/sproutcore/tests/foundation/array.rhtml +0 -220
- data/frameworks/sproutcore/tests/foundation/object.rhtml +0 -69
- data/frameworks/sproutcore/tests/foundation/set.rhtml +0 -254
- data/frameworks/sproutcore/tests/foundation/timer/invalidate.rhtml +0 -33
- data/frameworks/sproutcore/tests/foundation/timer/invokeLater.rhtml +0 -145
- data/frameworks/sproutcore/tests/foundation/timer/isPaused.rhtml +0 -70
- data/frameworks/sproutcore/tests/foundation/timer/schedule.rhtml +0 -145
- data/frameworks/sproutcore/tests/globals/window.rhtml +0 -45
- data/frameworks/sproutcore/tests/mixins/enumerable.rhtml +0 -421
- data/frameworks/sproutcore/tests/mixins/observable.rhtml +0 -127
- data/frameworks/sproutcore/tests/models/collection.rhtml +0 -160
- data/frameworks/sproutcore/tests/models/model.rhtml +0 -373
- data/frameworks/sproutcore/tests/panes/pane.rhtml +0 -88
- data/frameworks/sproutcore/tests/views/checkbox.rhtml +0 -21
- data/frameworks/sproutcore/tests/views/collection/base.rhtml +0 -211
- data/frameworks/sproutcore/tests/views/collection/incremental_rendering.rhtml +0 -260
- data/frameworks/sproutcore/tests/views/collection/source_list_rendering.rhtml +0 -232
- data/frameworks/sproutcore/tests/views/image_cell.rhtml +0 -19
- data/frameworks/sproutcore/tests/views/label_item.rhtml +0 -19
- data/frameworks/sproutcore/tests/views/list.rhtml +0 -20
- data/frameworks/sproutcore/tests/views/list_item.rhtml +0 -20
- data/frameworks/sproutcore/tests/views/popup_button.rhtml +0 -116
- data/frameworks/sproutcore/tests/views/slider.rhtml +0 -20
- data/frameworks/sproutcore/tests/views/text_cell.rhtml +0 -19
- data/frameworks/sproutcore/tests/views/text_field.rhtml +0 -37
- data/frameworks/sproutcore/tests/views/view/clippingFrame.rhtml +0 -401
- data/frameworks/sproutcore/tests/views/view/frame.rhtml +0 -357
- data/frameworks/sproutcore/tests/views/view/innerFrame.rhtml +0 -366
- data/frameworks/sproutcore/tests/views/view/isVisibleInWindow.rhtml +0 -148
- data/frameworks/sproutcore/tests/views/view/scrollFrame.rhtml +0 -467
- data/frameworks/sproutcore/validators/credit_card.js +0 -112
- data/frameworks/sproutcore/validators/date.js +0 -50
- data/frameworks/sproutcore/validators/email.js +0 -47
- data/frameworks/sproutcore/validators/not_empty.js +0 -34
- data/frameworks/sproutcore/validators/number.js +0 -69
- data/frameworks/sproutcore/validators/password.js +0 -89
- data/frameworks/sproutcore/validators/validator.js +0 -314
- data/frameworks/sproutcore/views/button/button.js +0 -478
- data/frameworks/sproutcore/views/button/checkbox.js +0 -29
- data/frameworks/sproutcore/views/button/disclosure.js +0 -42
- data/frameworks/sproutcore/views/button/radio.js +0 -29
- data/frameworks/sproutcore/views/collection/collection.js +0 -2764
- data/frameworks/sproutcore/views/collection/grid.js +0 -251
- data/frameworks/sproutcore/views/collection/image_cell.js +0 -125
- data/frameworks/sproutcore/views/collection/list.js +0 -162
- data/frameworks/sproutcore/views/collection/source_list.js +0 -458
- data/frameworks/sproutcore/views/collection/table.js +0 -118
- data/frameworks/sproutcore/views/container.js +0 -67
- data/frameworks/sproutcore/views/error_explanation.js +0 -58
- data/frameworks/sproutcore/views/field/checkbox_field.js +0 -40
- data/frameworks/sproutcore/views/field/field.js +0 -218
- data/frameworks/sproutcore/views/field/radio_field.js +0 -122
- data/frameworks/sproutcore/views/field/select_field.js +0 -307
- data/frameworks/sproutcore/views/field/text_field.js +0 -251
- data/frameworks/sproutcore/views/field/textarea_field.js +0 -32
- data/frameworks/sproutcore/views/filter_button.js +0 -29
- data/frameworks/sproutcore/views/form.js +0 -597
- data/frameworks/sproutcore/views/image.js +0 -255
- data/frameworks/sproutcore/views/inline_text_field.js +0 -427
- data/frameworks/sproutcore/views/label.js +0 -243
- data/frameworks/sproutcore/views/list_item.js +0 -516
- data/frameworks/sproutcore/views/menu_item.js +0 -97
- data/frameworks/sproutcore/views/pagination.js +0 -62
- data/frameworks/sproutcore/views/popup_button.js +0 -90
- data/frameworks/sproutcore/views/popup_menu.js +0 -139
- data/frameworks/sproutcore/views/progress.js +0 -125
- data/frameworks/sproutcore/views/radio_group.js +0 -48
- data/frameworks/sproutcore/views/scroll.js +0 -74
- data/frameworks/sproutcore/views/segmented.js +0 -105
- data/frameworks/sproutcore/views/slider.js +0 -134
- data/frameworks/sproutcore/views/source_list_group.js +0 -130
- data/frameworks/sproutcore/views/spinner.js +0 -11
- data/frameworks/sproutcore/views/split.js +0 -312
- data/frameworks/sproutcore/views/split_divider.js +0 -112
- data/frameworks/sproutcore/views/tab.js +0 -128
- data/frameworks/sproutcore/views/toolbar.js +0 -29
- data/frameworks/sproutcore/views/view.js +0 -2301
- data/jsdoc/app/frame/Chain.js +0 -102
- data/jsdoc/app/frame/Dumper.js +0 -144
- data/jsdoc/app/frame/Hash.js +0 -47
- data/jsdoc/app/frame/Link.js +0 -142
- data/jsdoc/app/frame/Namespace.js +0 -10
- data/jsdoc/app/frame/Opt.js +0 -134
- data/jsdoc/app/frame/Reflection.js +0 -26
- data/jsdoc/app/frame/String.js +0 -93
- data/jsdoc/app/frame/Testrun.js +0 -129
- data/jsdoc/app/frame.js +0 -33
- data/jsdoc/app/handlers/FOODOC.js +0 -26
- data/jsdoc/app/handlers/XMLDOC.js +0 -26
- data/jsdoc/app/lib/JSDOC/DocComment.js +0 -200
- data/jsdoc/app/lib/JSDOC/DocTag.js +0 -294
- data/jsdoc/app/lib/JSDOC/JsDoc.js +0 -180
- data/jsdoc/app/lib/JSDOC/JsPlate.js +0 -100
- data/jsdoc/app/lib/JSDOC/Lang.js +0 -144
- data/jsdoc/app/lib/JSDOC/Parser.js +0 -109
- data/jsdoc/app/lib/JSDOC/PluginManager.js +0 -33
- data/jsdoc/app/lib/JSDOC/Symbol.js +0 -600
- data/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -220
- data/jsdoc/app/lib/JSDOC/TextStream.js +0 -41
- data/jsdoc/app/lib/JSDOC/Token.js +0 -18
- data/jsdoc/app/lib/JSDOC/TokenReader.js +0 -323
- data/jsdoc/app/lib/JSDOC/TokenStream.js +0 -133
- data/jsdoc/app/lib/JSDOC/Util.js +0 -32
- data/jsdoc/app/lib/JSDOC/Walker.js +0 -416
- data/jsdoc/app/lib/JSDOC.js +0 -97
- data/jsdoc/app/main.js +0 -74
- data/jsdoc/app/plugins/commentSrcJson.js +0 -19
- data/jsdoc/app/plugins/frameworkPrototype.js +0 -16
- data/jsdoc/app/plugins/functionCall.js +0 -10
- data/jsdoc/app/plugins/publishSrcHilite.js +0 -62
- data/jsdoc/app/plugins/symbolLink.js +0 -9
- data/jsdoc/app/plugins/tagParamConfig.js +0 -31
- data/jsdoc/app/plugins/tagSynonyms.js +0 -43
- data/jsdoc/app/run.js +0 -346
- data/jsdoc/templates/sproutcore/allclasses.tmpl +0 -17
- data/jsdoc/templates/sproutcore/allfiles.tmpl +0 -56
- data/jsdoc/templates/sproutcore/class.tmpl +0 -423
- data/jsdoc/templates/sproutcore/index.tmpl +0 -55
- data/jsdoc/templates/sproutcore/publish.js +0 -333
- data/jsdoc/templates/sproutcore/static/default.css +0 -191
- data/jsdoc/templates/sproutcore/static/index.html +0 -19
- data/jsdoc/templates/sproutcore/symbol.tmpl +0 -35
- data/lib/sproutcore/build_tools/html_builder.rb +0 -163
- data/lib/sproutcore/build_tools/resource_builder.rb +0 -256
- data/lib/sproutcore/build_tools/test_template.rhtml +0 -12
- data/lib/sproutcore/build_tools.rb +0 -44
- data/lib/sproutcore/bundle.rb +0 -802
- data/lib/sproutcore/bundle_installer.rb +0 -270
- data/lib/sproutcore/bundle_manifest.rb +0 -574
- data/lib/sproutcore/cssmin.rb +0 -195
- data/lib/sproutcore/generator_helper.rb +0 -185
- data/lib/sproutcore/helpers.rb +0 -3
- data/lib/sproutcore/jsdoc.rb +0 -45
- data/lib/sproutcore/jsmin.rb +0 -247
- data/lib/sproutcore/library.rb +0 -479
- data/lib/sproutcore/merb/bundle_controller.rb +0 -297
- data/lib/sproutcore/merb/router.rb +0 -50
- data/lib/sproutcore/merb.rb +0 -22
- data/lib/sproutcore/renderers/erubis.rb +0 -43
- data/lib/sproutcore/renderers/haml.rb +0 -28
- data/lib/sproutcore/renderers/sass.rb +0 -42
- data/lib/sproutcore/version.rb +0 -9
- data/lib/sproutcore/view_helpers.rb +0 -656
- data/sc-config +0 -16
- data/sc_generators/client/README +0 -3
- data/sc_generators/client/USAGE +0 -11
- data/sc_generators/client/client_generator.rb +0 -45
- data/sc_generators/client/templates/core.js +0 -16
- data/sc_generators/client/templates/english.lproj/body.css +0 -147
- data/sc_generators/client/templates/english.lproj/body.rhtml +0 -18
- data/sc_generators/client/templates/english.lproj/strings.js +0 -13
- data/sc_generators/client/templates/main.js +0 -35
- data/sc_generators/controller/USAGE +0 -15
- data/sc_generators/controller/controller_generator.rb +0 -51
- data/sc_generators/controller/templates/controller.js +0 -21
- data/sc_generators/controller/templates/test.rhtml +0 -22
- data/sc_generators/framework/README +0 -6
- data/sc_generators/framework/USAGE +0 -11
- data/sc_generators/framework/framework_generator.rb +0 -53
- data/sc_generators/framework/templates/core.js +0 -20
- data/sc_generators/framework/templates/english.lproj/strings.js +0 -13
- data/sc_generators/language/USAGE +0 -13
- data/sc_generators/language/language_generator.rb +0 -47
- data/sc_generators/language/templates/strings.js +0 -13
- data/sc_generators/model/USAGE +0 -23
- data/sc_generators/model/model_generator.rb +0 -55
- data/sc_generators/model/templates/fixture.js +0 -43
- data/sc_generators/model/templates/model.js +0 -20
- data/sc_generators/model/templates/test.rhtml +0 -21
- data/sc_generators/test/USAGE +0 -15
- data/sc_generators/test/templates/test.rhtml +0 -21
- data/sc_generators/test/test_generator.rb +0 -47
- data/sc_generators/view/USAGE +0 -15
- data/sc_generators/view/templates/test.rhtml +0 -21
- data/sc_generators/view/templates/view.js +0 -20
- data/sc_generators/view/view_generator.rb +0 -51
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -74
- data/setup.rb +0 -1585
- data/spec/sproutcore_spec.rb +0 -11
- data/tasks/deployment.rake +0 -47
- data/tasks/environment.rake +0 -7
- data/tasks/rspec.rake +0 -21
- data/tasks/website.rake +0 -17
@@ -1,2764 +0,0 @@
|
|
1
|
-
// ========================================================================
|
2
|
-
// SproutCore
|
3
|
-
// copyright 2006-2008 Sprout Systems, Inc.
|
4
|
-
// ========================================================================
|
5
|
-
|
6
|
-
require('views/view') ;
|
7
|
-
require('views/label') ;
|
8
|
-
require('mixins/collection_view_delegate') ;
|
9
|
-
|
10
|
-
SC.BENCHMARK_UPDATE_CHILDREN = NO ;
|
11
|
-
SC.VALIDATE_COLLECTION_CONSISTANCY = NO ;
|
12
|
-
|
13
|
-
/**
|
14
|
-
Special drag operation passed to delegate if the collection view proposes
|
15
|
-
to perform a reorder event.
|
16
|
-
*/
|
17
|
-
SC.DRAG_REORDER = 0xfff0001 ;
|
18
|
-
|
19
|
-
/** Indicates that selection points should be selected using horizontal
|
20
|
-
orientation.
|
21
|
-
*/
|
22
|
-
SC.HORIZONTAL_ORIENTATION = 'horizontal';
|
23
|
-
|
24
|
-
/** Selection points should be selected using vertical orientation. */
|
25
|
-
SC.VERTICAL_ORIENTATION = 'vertical' ;
|
26
|
-
|
27
|
-
/** Enables an optimization using zombie group views. This option is configurable for perf testing purposes. You should not change it. */
|
28
|
-
SC.ZOMBIE_GROUPS_ENABLED = YES ;
|
29
|
-
|
30
|
-
/** Enables an optimization that removes the root element from the DOM during
|
31
|
-
a render and then readds it when complete. This option is configurable for
|
32
|
-
perf testing purposes. You should not change it. */
|
33
|
-
SC.REMOVE_COLLECTION_ROOT_ELEMENT_DURING_RENDER = NO ;
|
34
|
-
|
35
|
-
/**
|
36
|
-
@class
|
37
|
-
|
38
|
-
Renders a collection of views from a source array of model objects.
|
39
|
-
|
40
|
-
The CollectionView is the root view class for rendering collections of
|
41
|
-
views based on a source array of objects. It can automatically create the
|
42
|
-
and layout the views, including displaying them in groups. It also
|
43
|
-
handles event input for the entire collection.
|
44
|
-
|
45
|
-
To use CollectionView, just create the view and set the 'content' property
|
46
|
-
to an array of objects. (Note that if you setup a binding, it will
|
47
|
-
always transform content to an array.) The view will create instances of
|
48
|
-
exampleView to render the array. You can also bind to the selection
|
49
|
-
property if you want to monitor selection. (be sure to set the isEnabled
|
50
|
-
property to allow selection.)
|
51
|
-
|
52
|
-
@extends SC.View
|
53
|
-
@extends SC.CollectionViewDelegate
|
54
|
-
|
55
|
-
*/
|
56
|
-
SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate,
|
57
|
-
/** @scope SC.CollectionView.prototype */
|
58
|
-
{
|
59
|
-
|
60
|
-
// ......................................
|
61
|
-
// PROPERTIES
|
62
|
-
//
|
63
|
-
|
64
|
-
/**
|
65
|
-
An array of content objects
|
66
|
-
|
67
|
-
This array should contain the content objects you want the collection view
|
68
|
-
to display. An item view (based on the exampleView view class) will be
|
69
|
-
created for each content object, in the order the content objects appear
|
70
|
-
in this array.
|
71
|
-
|
72
|
-
If you make the collection editable, the collection view will also modify
|
73
|
-
this array using the observable array methods of SC.Array.
|
74
|
-
|
75
|
-
Usually you will want to bind this property to a controller property
|
76
|
-
that actually contains the array of objects you to display.
|
77
|
-
|
78
|
-
@type Array
|
79
|
-
*/
|
80
|
-
content: [],
|
81
|
-
|
82
|
-
/** @private */
|
83
|
-
contentBindingDefault: SC.Binding.MultipleNotEmpty,
|
84
|
-
|
85
|
-
/**
|
86
|
-
The array of currently selected objects.
|
87
|
-
|
88
|
-
This array should contain the currently selected content objects. It is
|
89
|
-
modified automatically by the collection view when the user changes the
|
90
|
-
selection on the collection.
|
91
|
-
|
92
|
-
Any item views representing content objects in this array will have their
|
93
|
-
isSelected property set to YES automatically.
|
94
|
-
|
95
|
-
The CollectionView can deal with selection arrays that contain content
|
96
|
-
objects that do not belong to the content array itself. Sometimes this
|
97
|
-
will happen if you share the same selection across multiple collection
|
98
|
-
views.
|
99
|
-
|
100
|
-
Usually you will want to bind this property to a controller property that
|
101
|
-
actually manages the selection for your display.
|
102
|
-
|
103
|
-
@type Array
|
104
|
-
*/
|
105
|
-
selection: [],
|
106
|
-
|
107
|
-
/** @private */
|
108
|
-
selectionBindingDefault: SC.Binding.Multiple,
|
109
|
-
|
110
|
-
/**
|
111
|
-
Delegate used to implement fine-grained control over collection view
|
112
|
-
behaviors.
|
113
|
-
|
114
|
-
You can assign a delegate object to this property that will be consulted
|
115
|
-
for various decisions regarding drag and drop, selection behavior, and
|
116
|
-
even rendering. The object you place here must implement some or all of
|
117
|
-
the SC.CollectionViewDelegate mixin.
|
118
|
-
*/
|
119
|
-
delegate: null,
|
120
|
-
|
121
|
-
/**
|
122
|
-
Allow user to select content using the mouse and keyboard
|
123
|
-
|
124
|
-
Set this property to NO to disallow the user from selecting items.
|
125
|
-
If you have items in your selection property, they will still be reflected
|
126
|
-
visually.
|
127
|
-
|
128
|
-
@type {Bool}
|
129
|
-
*/
|
130
|
-
isSelectable: true,
|
131
|
-
|
132
|
-
/** @private */
|
133
|
-
isSelectableBindingDefault: SC.Binding.Bool,
|
134
|
-
|
135
|
-
/**
|
136
|
-
Enable or disable the view.
|
137
|
-
|
138
|
-
The collection view will set the isEnabled property of its item views to
|
139
|
-
reflect the same view of this property. Whenever isEnabled is false,
|
140
|
-
the collection view will also be not selectable or editable, regardless of the
|
141
|
-
settings for isEditable & isSelectable.
|
142
|
-
|
143
|
-
@type {Bool}
|
144
|
-
*/
|
145
|
-
isEnabled: true,
|
146
|
-
|
147
|
-
/** @private */
|
148
|
-
isEnabledBindingDefault: SC.Binding.Bool,
|
149
|
-
|
150
|
-
/**
|
151
|
-
Allow user to edit content views.
|
152
|
-
|
153
|
-
The collection view will set the isEditable property on its item views to
|
154
|
-
reflect the same value of this property. Whenever isEditable is false,
|
155
|
-
the user will not be able to reorder, add, or delete items regardless of
|
156
|
-
the canReorderContent and canDeleteContent and isDropTarget properties.
|
157
|
-
*/
|
158
|
-
isEditable: true,
|
159
|
-
|
160
|
-
/** @private */
|
161
|
-
isEditableBindingDefault: SC.Binding.Bool,
|
162
|
-
|
163
|
-
/**
|
164
|
-
Allow user to reorder items using drag and drop.
|
165
|
-
|
166
|
-
If true, the user will can use drag and drop to reorder items in the list.
|
167
|
-
If you also accept drops, this will allow the user to drop items into
|
168
|
-
specific points in the list. Otherwise items will be added to the end.
|
169
|
-
*/
|
170
|
-
canReorderContent: false,
|
171
|
-
|
172
|
-
/** @private */
|
173
|
-
canReorderContentBindingDefault: SC.Binding.Bool,
|
174
|
-
|
175
|
-
/**
|
176
|
-
Allow the user to delete items using the delete key
|
177
|
-
|
178
|
-
If true the user will be allowed to delete selected items using the delete
|
179
|
-
key. Otherwise deletes will not be permitted.
|
180
|
-
*/
|
181
|
-
canDeleteContent: NO,
|
182
|
-
|
183
|
-
/** @private */
|
184
|
-
canDeleteContentBindingDefault: SC.Binding.Bool,
|
185
|
-
|
186
|
-
/**
|
187
|
-
Accept drops for data other than reordering.
|
188
|
-
|
189
|
-
Setting this property to return true when the view is instantiated will
|
190
|
-
cause it to be registered as a drop target, activating the other drop
|
191
|
-
machinery.
|
192
|
-
*/
|
193
|
-
isDropTarget: NO,
|
194
|
-
|
195
|
-
/**
|
196
|
-
Use toggle selection instead of normal click behavior.
|
197
|
-
|
198
|
-
If set to true, then selection will use a toggle instead of the normal
|
199
|
-
click behavior. Command modifiers will be ignored and instead clicking
|
200
|
-
once will enable an item and clicking on it again will disable it.
|
201
|
-
|
202
|
-
@type Boolean
|
203
|
-
*/
|
204
|
-
useToggleSelection: NO,
|
205
|
-
|
206
|
-
/**
|
207
|
-
Trigger the action method on a single click.
|
208
|
-
|
209
|
-
Normally, clicking on an item view in a collection will select the content
|
210
|
-
object and double clicking will trigger the action method on the
|
211
|
-
collection view.
|
212
|
-
|
213
|
-
If you set this property to true, then clicking on a view will both select
|
214
|
-
it (if isSelected is true) and trigger the action method.
|
215
|
-
|
216
|
-
Use this if you are using the collection view as a menu of items.
|
217
|
-
|
218
|
-
@type {Boolean}
|
219
|
-
*/
|
220
|
-
actOnSelect: false,
|
221
|
-
|
222
|
-
|
223
|
-
/**
|
224
|
-
Select an item immediately on mouse down
|
225
|
-
|
226
|
-
Normally as soon as you begin a click the item will be selected.
|
227
|
-
|
228
|
-
In some UI scenarios, you might want to prevent selection until
|
229
|
-
the mouse is released, so you can perform, for instance, a drag operation
|
230
|
-
without actually selecting the target item.
|
231
|
-
|
232
|
-
@type {Boolean}
|
233
|
-
*/
|
234
|
-
selectOnMouseDown: true,
|
235
|
-
|
236
|
-
/**
|
237
|
-
Property key to use to group objects.
|
238
|
-
|
239
|
-
If groupBy is set to a non-null value, then the collection view will
|
240
|
-
automatically display item views in groups based on the value of the
|
241
|
-
passed property key. The exampleGroupView will be used to display the
|
242
|
-
items in groups.
|
243
|
-
|
244
|
-
If this property is set, you MUST ensure the items in the content array
|
245
|
-
are already sorted by the group key. Otherwise item view groups might
|
246
|
-
appear more than once.
|
247
|
-
|
248
|
-
@type {String}
|
249
|
-
*/
|
250
|
-
groupBy: null,
|
251
|
-
|
252
|
-
/**
|
253
|
-
The view class to use when creating new item views.
|
254
|
-
|
255
|
-
The collection view will automatically create an instance of the view
|
256
|
-
class you set here for each item in its content array. You should provide
|
257
|
-
your own subclass for this property to display the type of content you
|
258
|
-
want.
|
259
|
-
|
260
|
-
For best results, the view you set here should understand the following
|
261
|
-
properties:
|
262
|
-
|
263
|
-
- *content* The content object from the content array your view should display
|
264
|
-
- *isEnabled* True if the view should appear enabled
|
265
|
-
- *isSelected* True if the view should appear selected
|
266
|
-
|
267
|
-
In general you do not want your child views to actually respond to mouse
|
268
|
-
and keyboard events themselves. It is better to let the collection view
|
269
|
-
do that.
|
270
|
-
|
271
|
-
If you do implement your own event handlers such as mouseDown or mouseUp,
|
272
|
-
you should be sure to actually call the same method on the collection view
|
273
|
-
to give it the chance to perform its own selection housekeeping.
|
274
|
-
|
275
|
-
@type {SC.View}
|
276
|
-
*/
|
277
|
-
exampleView: SC.View,
|
278
|
-
|
279
|
-
/**
|
280
|
-
The view class to use when displaying item views in groups.
|
281
|
-
|
282
|
-
If the groupBy property is not null, then the collection view will create
|
283
|
-
an instance of this view class with the item views that belong to the
|
284
|
-
group as child nodes for each distinct group value it encounters.
|
285
|
-
|
286
|
-
Your groupView should have two outlets:
|
287
|
-
|
288
|
-
{{{
|
289
|
-
labelView: The view to display the group label. The group value will be
|
290
|
-
set as the content property of this view.
|
291
|
-
|
292
|
-
itemView: This is the view the item views will be added to as children
|
293
|
-
to this view.
|
294
|
-
}}}
|
295
|
-
|
296
|
-
If groupBy is null, then this property will not be used. The default
|
297
|
-
class provided here simply displays the group value in an H1 tag.
|
298
|
-
|
299
|
-
@type {SC.View}
|
300
|
-
*/
|
301
|
-
exampleGroupView: SC.View.extend({
|
302
|
-
emptyElement: '<div><h1></h1><div class="well"></div></div>',
|
303
|
-
outlets: ['labelView','itemView'],
|
304
|
-
labelView: SC.LabelView.outletFor('h1?'),
|
305
|
-
itemView: SC.View.outletFor('.well?')
|
306
|
-
}),
|
307
|
-
|
308
|
-
/**
|
309
|
-
Invoked when the user double clicks on an item (or single clicks of
|
310
|
-
actOnSelect is true)
|
311
|
-
|
312
|
-
Set this to the name of the action you want to send down the
|
313
|
-
responder chain when the user double clicks on an item (or single clicks
|
314
|
-
if actOnSelect is true). You can optionally specify a specific target as
|
315
|
-
well using the target property.
|
316
|
-
|
317
|
-
If you do not specify an action, then the collection view will also try to
|
318
|
-
invoke the action named on the target item view.
|
319
|
-
|
320
|
-
Older versions of SproutCore expected the action property to contain an
|
321
|
-
actual function that would be run. This format is still supported but is
|
322
|
-
deprecated for future use. You should generally use the responder chain
|
323
|
-
to handle your action for you.
|
324
|
-
|
325
|
-
@type {String}
|
326
|
-
*/
|
327
|
-
action: null,
|
328
|
-
|
329
|
-
/**
|
330
|
-
Optional target to send the action to when the user double clicks.
|
331
|
-
|
332
|
-
If you set the action property to the name of an action, you can
|
333
|
-
optionally specify the target object you want the action to be sent to.
|
334
|
-
This can be either an actual object or a property path that will resolve
|
335
|
-
to an object at the time that the action is invoked.
|
336
|
-
|
337
|
-
This property is ignored if you use the deprecated approach of making the
|
338
|
-
action property a function.
|
339
|
-
|
340
|
-
@type {String|Object}
|
341
|
-
*/
|
342
|
-
target: null,
|
343
|
-
|
344
|
-
/**
|
345
|
-
Set to true whenever the content changes and remains true until
|
346
|
-
the content has been rerendered.
|
347
|
-
|
348
|
-
You can also set this to true yourself to be notified when it is
|
349
|
-
completed.
|
350
|
-
*/
|
351
|
-
isDirty: false,
|
352
|
-
|
353
|
-
/**
|
354
|
-
The maximum time the collection view will spend updating its
|
355
|
-
views before it takes a break from the update.
|
356
|
-
|
357
|
-
This keeps your browser from freezing or displaying a slow script
|
358
|
-
warning while the render code works. Number is in msec.
|
359
|
-
|
360
|
-
Future versions of CollectionView may ignore this property as newer
|
361
|
-
rendering techniques make it no longer necessary.
|
362
|
-
*/
|
363
|
-
maxRenderTime: 0,
|
364
|
-
|
365
|
-
/**
|
366
|
-
Property to on content items to use for display.
|
367
|
-
|
368
|
-
Built-in item views such as the LabelViews and ImageViews will use the
|
369
|
-
value of this property as a key on the content object to determine the
|
370
|
-
value they should display.
|
371
|
-
|
372
|
-
For example, if you set contentValueKey to 'name' and set the
|
373
|
-
exampleView to an SC.LabelView, then the label views created by the
|
374
|
-
colleciton view will display the value of the content.name.
|
375
|
-
|
376
|
-
If you are writing your own custom item view for a collection, you can
|
377
|
-
get this behavior automatically by including the SC.Control mixin on your
|
378
|
-
view. You can also ignore this property if you like. The collection view
|
379
|
-
itself does not use this property to impact rendering.
|
380
|
-
*/
|
381
|
-
contentValueKey: null,
|
382
|
-
|
383
|
-
/**
|
384
|
-
Enables keyboard-based navigate if set to true.
|
385
|
-
*/
|
386
|
-
acceptsFirstResponder: false,
|
387
|
-
|
388
|
-
/**
|
389
|
-
If your layout uses a grid or horizontal-based layout, then make sure this
|
390
|
-
property is always up to date with the current number of items per row.
|
391
|
-
|
392
|
-
The CollectionView will use this property to support keyboard navigation
|
393
|
-
using the arrow keys.
|
394
|
-
|
395
|
-
If your collection view is simply a vertical list of items then you do not
|
396
|
-
need to edit this property.
|
397
|
-
*/
|
398
|
-
itemsPerRow: 1,
|
399
|
-
|
400
|
-
/**
|
401
|
-
Property returns all of the item views, regardless of group view.
|
402
|
-
|
403
|
-
@field
|
404
|
-
@returns {Array} the item views.
|
405
|
-
*/
|
406
|
-
itemViews: function() {
|
407
|
-
if (!this._itemViews) {
|
408
|
-
|
409
|
-
|
410
|
-
var range = this.get('nowShowingRange') ;
|
411
|
-
var content = this.get('content') || [] ;
|
412
|
-
this._itemViews = [] ;
|
413
|
-
for(var idx=0;idx<range.length;idx++) {
|
414
|
-
var cur = content.objectAt(idx) ;
|
415
|
-
this._itemViews.push(this.itemViewForContent(cur)) ;
|
416
|
-
}
|
417
|
-
}
|
418
|
-
return this._itemViews;
|
419
|
-
}.property(),
|
420
|
-
|
421
|
-
/**
|
422
|
-
Property returns all of the rendered group views in order of their
|
423
|
-
appearance with the content.
|
424
|
-
*/
|
425
|
-
groupViews: function() {
|
426
|
-
if (!this._groupViews) {
|
427
|
-
var groupBy = this.get('groupBy') ;
|
428
|
-
if (groupBy) {
|
429
|
-
var range = this.get('nowShowingRange') ;
|
430
|
-
var content = this.get('content') || [] ;
|
431
|
-
var groupValue = undefined ;
|
432
|
-
this._groupViews = [] ;
|
433
|
-
|
434
|
-
for(var idx=0;idx<range.length;idx++) {
|
435
|
-
var cur = content.objectAt(idx) ;
|
436
|
-
var curGroupValue = (cur) ? cur.get(groupBy) : null ;
|
437
|
-
if (curGroupValue != groupValue) {
|
438
|
-
groupValue = curGroupValue ;
|
439
|
-
this._groupViews.push(this.groupViewForGroupValue(groupValue)) ;
|
440
|
-
}
|
441
|
-
}
|
442
|
-
|
443
|
-
}
|
444
|
-
}
|
445
|
-
return this._groupViews;
|
446
|
-
}.property(),
|
447
|
-
|
448
|
-
/**
|
449
|
-
Returns true if the passed view belongs to the collection.
|
450
|
-
|
451
|
-
This method uses the internal hash of item views and works even if
|
452
|
-
your items are stored in group views. This is faster than searching
|
453
|
-
the child view hierarchy yourself.
|
454
|
-
|
455
|
-
@param {SC.View} view The view to search for.
|
456
|
-
|
457
|
-
@returns {Boolean} True if the view is an item view in the receiver.
|
458
|
-
*/
|
459
|
-
hasItemView: function(view) {
|
460
|
-
if (!this._itemViewsByGuid) this._itemViewsByGuid = {} ;
|
461
|
-
return !!this._itemViewsByGuid[SC.guidFor(view)] ;
|
462
|
-
},
|
463
|
-
|
464
|
-
/**
|
465
|
-
Find the item view underneath the passed mouse location.
|
466
|
-
|
467
|
-
The default implementation of this method simply searches each item view's
|
468
|
-
frame to find one that includes the location. If you are doing your own
|
469
|
-
layout, you may be able to perform this calculation more quickly. If so,
|
470
|
-
consider overriding this method for better performance during drag
|
471
|
-
operations.
|
472
|
-
|
473
|
-
@param {Point} loc The current mouse location in the coordinate of the
|
474
|
-
collection view
|
475
|
-
|
476
|
-
@returns {SC.View} The item view under the collection
|
477
|
-
*/
|
478
|
-
itemViewAtLocation: function(loc) {
|
479
|
-
var itemView = this._itemViewRoot ;
|
480
|
-
while(itemView) {
|
481
|
-
var frame = itemView.get('frame');
|
482
|
-
if (SC.pointInRect(loc, frame)) return itemView ;
|
483
|
-
}
|
484
|
-
return null; // not in an itemView right now.
|
485
|
-
},
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
/**
|
490
|
-
Find the first content item view for the passed event.
|
491
|
-
|
492
|
-
This method will go up the view chain, starting with the view that was the
|
493
|
-
target of the passed event, looking for a child item. This will become
|
494
|
-
the view that is selected by the mouse event.
|
495
|
-
|
496
|
-
This method only works for mouseDown & mouseUp events. mouseMoved events
|
497
|
-
do not have a target.
|
498
|
-
|
499
|
-
@param {Event} evt An event
|
500
|
-
|
501
|
-
*/
|
502
|
-
itemViewForEvent: function(evt)
|
503
|
-
{
|
504
|
-
var view = SC.window.firstViewForEvent( evt );
|
505
|
-
|
506
|
-
if (!view) return null; // workaround for error on IE8, see Ticket #169
|
507
|
-
|
508
|
-
// work up the view hierarchy to find a match...
|
509
|
-
do {
|
510
|
-
// item clicked was the ContainerView itself... i.e. the user clicked outside the child items
|
511
|
-
// nothing to return...
|
512
|
-
if ( view == this ) return null;
|
513
|
-
|
514
|
-
// sweet!... the view is not only in the collection, but it says we can hit it.
|
515
|
-
// hit it and quit it...
|
516
|
-
if ( this.hasItemView(view) && (!view.hitTest || view.hitTest(evt)) ) return view;
|
517
|
-
} while ( view = view.get('parentNode') );
|
518
|
-
|
519
|
-
// nothing was found...
|
520
|
-
return null;
|
521
|
-
},
|
522
|
-
|
523
|
-
|
524
|
-
/**
|
525
|
-
Returns the itemView that represents the passed content object.
|
526
|
-
|
527
|
-
If no item view is currently rendered for the object, this method will
|
528
|
-
return null.
|
529
|
-
|
530
|
-
@param {Object} obj The content object.
|
531
|
-
@returns {SC.View} The item view or null
|
532
|
-
*/
|
533
|
-
itemViewForContent: function(obj) {
|
534
|
-
var key = (obj) ? SC.guidFor(obj) : '0';
|
535
|
-
return this._itemViewsByContent[key];
|
536
|
-
},
|
537
|
-
|
538
|
-
/**
|
539
|
-
Returns the groupView that represents the passed group value.
|
540
|
-
|
541
|
-
If no group view is currently rendered for the gorup value, this method
|
542
|
-
will return null. If grouping is disabled, this method will also return
|
543
|
-
null.
|
544
|
-
|
545
|
-
@param {Object} value The group value.
|
546
|
-
@param {SC.View} The group view or null
|
547
|
-
*/
|
548
|
-
groupViewForGroupValue: function(groupValue) {
|
549
|
-
return this._groupViewsByValue[groupValue] ;
|
550
|
-
},
|
551
|
-
|
552
|
-
/**
|
553
|
-
Returns the groupValue for the passed group view.
|
554
|
-
|
555
|
-
Older-style groupViews expect the group value to be set directly on
|
556
|
-
their labelView while newer groupViews expect their groupValue to be set.
|
557
|
-
This method takes into account both approaches.
|
558
|
-
|
559
|
-
@param {SC.View} groupView the group view.
|
560
|
-
@returns {Object} the value of the group view or null.
|
561
|
-
*/
|
562
|
-
groupValueForGroupView: function(groupView) {
|
563
|
-
if (!groupView) return null ;
|
564
|
-
var ret ;
|
565
|
-
if (groupView.groupValue === undefined) {
|
566
|
-
ret = groupView.get('content') ;
|
567
|
-
} else ret = groupView.get('groupValue') ;
|
568
|
-
return ret ;
|
569
|
-
},
|
570
|
-
|
571
|
-
/**
|
572
|
-
Expands the index into a range of content objects that have the same
|
573
|
-
group value.
|
574
|
-
|
575
|
-
This method searches backward and forward through your content array for
|
576
|
-
objects that have the same group value as the object at the index you
|
577
|
-
pass in. You can use this method when implementing layoutGroupView to
|
578
|
-
determine the range of the content that belongs to the group.
|
579
|
-
|
580
|
-
Since this method simply searches through the content array, it is really
|
581
|
-
only suitable for content arrays of a few hundred items or less. If you
|
582
|
-
expect to have a larger size of content array, then you may need to do
|
583
|
-
something custom in your data model to calculate this range in less time.
|
584
|
-
|
585
|
-
@param {Number} contentIndex index of a content object
|
586
|
-
@returns {Range} a range of objects
|
587
|
-
*/
|
588
|
-
groupRangeForContentIndex: function(contentIndex) {
|
589
|
-
var content = Array.from(this.get('content')) ;
|
590
|
-
var len = content.get('length') ;
|
591
|
-
var groupBy = this.get('groupBy') ;
|
592
|
-
if (!groupBy) return { start: 0, length: len } ;
|
593
|
-
|
594
|
-
var min = contentIndex, max = contentIndex ;
|
595
|
-
var cur = content.objectAt(contentIndex) ;
|
596
|
-
var groupValue = (cur) ? cur.get(groupBy) : null ;
|
597
|
-
|
598
|
-
// find first item at bottom that does not match. add one to get start
|
599
|
-
while(--min >= 0) {
|
600
|
-
var cur = content.objectAt(min) ;
|
601
|
-
var curGroupValue = (cur) ? cur.get(groupBy) : null ;
|
602
|
-
if (curGroupValue !== groupValue) break ;
|
603
|
-
}
|
604
|
-
min++ ;
|
605
|
-
|
606
|
-
// find first item at top that does not match. keep value to calc range
|
607
|
-
while(++max < len) {
|
608
|
-
var cur = content.objectAt(max) ;
|
609
|
-
var curGroupValue = (cur) ? cur.get(groupBy) : null ;
|
610
|
-
if (curGroupValue !== groupValue) break ;
|
611
|
-
}
|
612
|
-
|
613
|
-
return { start: min, length: max-min } ;
|
614
|
-
},
|
615
|
-
|
616
|
-
// Determines the group value at a specified index.
|
617
|
-
groupValueAtContentIndex: function(contentIndex) {
|
618
|
-
var groupBy = this.get('groupBy') ;
|
619
|
-
var content = Array.from(this.get('content')).objectAt(contentIndex) ;
|
620
|
-
return (groupBy && content && content.get) ? content.get(groupBy) : null;
|
621
|
-
},
|
622
|
-
|
623
|
-
// ......................................
|
624
|
-
// GENERATING CHILDREN
|
625
|
-
//
|
626
|
-
|
627
|
-
/**
|
628
|
-
Update the itemViews in the receiver to match the currently visible
|
629
|
-
content objects. Normally this method assumes the content objects
|
630
|
-
themselves have not changed and only updates the views if the range of
|
631
|
-
visible content has changed. If you pass true to the fullUpdate property,
|
632
|
-
then the entire set of itemViews will be revalidated in case any content
|
633
|
-
objects have changed.
|
634
|
-
|
635
|
-
@param {Bool} fullUpdate (Optional) if set to true, assumes content has
|
636
|
-
changed and will perform a full update.
|
637
|
-
|
638
|
-
*/
|
639
|
-
updateChildren: function(fullUpdate) {
|
640
|
-
var f ;
|
641
|
-
|
642
|
-
// if the collection is not presently visible in the window, then there is
|
643
|
-
// really nothing to do here. Just mark the view as dirty and return.
|
644
|
-
if (!this.get('isVisibleInWindow')) {
|
645
|
-
this.set('isDirty', true) ;
|
646
|
-
this._needsFullUpdate = this._needsFullUpdate || fullUpdate ;
|
647
|
-
return;
|
648
|
-
}
|
649
|
-
|
650
|
-
if (SC.BENCHMARK_UPDATE_CHILDREN) {
|
651
|
-
var bkey = '%@.updateChildren(%@)'.fmt(this, (fullUpdate) ? 'FULL' : 'FAST') ;
|
652
|
-
SC.Benchmark.start(bkey);
|
653
|
-
}
|
654
|
-
|
655
|
-
this.beginPropertyChanges() ; // avoid sending notifications
|
656
|
-
|
657
|
-
// STEP 1: Update frame size if needed. Required to compute the
|
658
|
-
// clippingFrame.
|
659
|
-
var f ;
|
660
|
-
if ((f = this.computeFrame()) && !SC.rectsEqual(f, this.get('frame'))) {
|
661
|
-
var parent = this.get('parentNode') ;
|
662
|
-
if (parent) parent.viewFrameWillChange() ;
|
663
|
-
this.set('frame', f) ;
|
664
|
-
if (parent) parent.viewFrameDidChange() ;
|
665
|
-
|
666
|
-
if ((f = this.computeFrame()) && !SC.rectsEqual(f, this.get('frame'))) {
|
667
|
-
this.set('frame', f) ;
|
668
|
-
}
|
669
|
-
}
|
670
|
-
|
671
|
-
// Save the current clipping frame. If the frame methods are called again
|
672
|
-
// later but the frame has not actually changed, we don't want to run
|
673
|
-
// updateChildren again.
|
674
|
-
var clippingFrame = this._lastClippingFrame = this.get('clippingFrame') ;
|
675
|
-
|
676
|
-
// STEP 2: Calculate the new range of content to display in
|
677
|
-
// the clipping frame. Determine if we need to do a full update or
|
678
|
-
// not.
|
679
|
-
|
680
|
-
var range = this.contentRangeInFrame(clippingFrame) ;
|
681
|
-
var content = Array.from(this.get('content'));
|
682
|
-
|
683
|
-
//make sure the range isn't greater than the content length
|
684
|
-
//this will prevent trying to render items that aren't really there.
|
685
|
-
range.length = Math.min(SC.maxRange(range), content.get('length')) - range.start ;
|
686
|
-
|
687
|
-
var nowShowingRange = this.get('nowShowingRange') ;
|
688
|
-
fullUpdate = fullUpdate || (this.get('isDirty') && this._needsFullUpdate) || (SC.intersectRanges(range, nowShowingRange).length <= 0) ;
|
689
|
-
this.set('nowShowingRange', range) ;
|
690
|
-
|
691
|
-
// STEP 3: Update item views.
|
692
|
-
var groupBy = this.get('groupBy') ;
|
693
|
-
var didChange = false ;
|
694
|
-
|
695
|
-
// If this is a fullUpdate, then rebuild the itemViewsByContent hash
|
696
|
-
// from scratch. This is necessary if the content or the visible range
|
697
|
-
// might have changed.
|
698
|
-
if (fullUpdate) {
|
699
|
-
|
700
|
-
var itemViewsByContent = {} ; // this will replace the current hash.
|
701
|
-
|
702
|
-
// iterate through all of the views and insert them. If the view
|
703
|
-
// already exists, it will simply be reused.
|
704
|
-
var idx = SC.maxRange(range) ;
|
705
|
-
while(--idx >= range.start) {
|
706
|
-
var c = content.objectAt(idx) ;
|
707
|
-
var key = SC.guidFor(c) ;
|
708
|
-
var itemView = this._insertItemViewFor(c, groupBy, idx) ;
|
709
|
-
|
710
|
-
if(itemView)
|
711
|
-
{
|
712
|
-
// add item view to new hash and remove from old hash.
|
713
|
-
itemViewsByContent[key] = itemView;
|
714
|
-
|
715
|
-
delete this._itemViewsByContent[key];
|
716
|
-
}
|
717
|
-
}
|
718
|
-
|
719
|
-
// Now iterate through the old hash. Any left over item views should
|
720
|
-
// be removed.
|
721
|
-
for(var key in this._itemViewsByContent) {
|
722
|
-
if (!this._itemViewsByContent.hasOwnProperty(key)) continue ;
|
723
|
-
var itemView = this._itemViewsByContent[key] ;
|
724
|
-
this._removeItemView(itemView, groupBy) ;
|
725
|
-
} ;
|
726
|
-
|
727
|
-
// Swap out remaining content items.
|
728
|
-
this._itemViewsByContent = itemViewsByContent ;
|
729
|
-
didChange = true;
|
730
|
-
|
731
|
-
// If a fullUpdate is not required, then we assume no content has changed
|
732
|
-
// and we just need to add or remove some views to bring the ranges up
|
733
|
-
// to date.
|
734
|
-
} else {
|
735
|
-
// Find changed range at the top. Note that the length here may be
|
736
|
-
// negative. Negative means views should be removed.
|
737
|
-
var start = range.start ;
|
738
|
-
var length = (nowShowingRange.start - start) ;
|
739
|
-
if (length != 0) {
|
740
|
-
this._insertOrRemoveItemViewsInRange(start, length, groupBy) ;
|
741
|
-
didChange = true ;
|
742
|
-
}
|
743
|
-
|
744
|
-
// Find the changed range at the bottom. Note that the length here may
|
745
|
-
// also be negative. Negative means views should be removed.
|
746
|
-
var start = SC.maxRange(nowShowingRange) ;
|
747
|
-
var length = SC.maxRange(range) - start ;
|
748
|
-
if (length != 0) {
|
749
|
-
this._insertOrRemoveItemViewsInRange(start, length, groupBy) ;
|
750
|
-
didChange = true ;
|
751
|
-
}
|
752
|
-
}
|
753
|
-
|
754
|
-
// Recache frames just in case this changed the scroll height.
|
755
|
-
this.recacheFrames() ;
|
756
|
-
|
757
|
-
// Set this to true once children have been rendered. Whenever the
|
758
|
-
// content changes, we don't want resize or clipping frame changes to
|
759
|
-
// cause a refresh until the content has been rendered for the first time.
|
760
|
-
this._hasChildren = range.length>0 ;
|
761
|
-
this.set('isDirty',false);
|
762
|
-
|
763
|
-
// Clean out some cached items and notify their changes.
|
764
|
-
// NOTE: This must be called after _hasChildren has been set or
|
765
|
-
// updateSelectionStates() may not run.
|
766
|
-
if (didChange) {
|
767
|
-
this._flushZombieGroupViews() ;
|
768
|
-
this.updateSelectionStates() ;
|
769
|
-
|
770
|
-
this._itemViews = null ;
|
771
|
-
this.notifyPropertyChange('itemViews') ;
|
772
|
-
|
773
|
-
this._groupViews = null ;
|
774
|
-
this.notifyPropertyChange('groupViews') ;
|
775
|
-
}
|
776
|
-
|
777
|
-
this.endPropertyChanges() ;
|
778
|
-
if (SC.BENCHMARK_UPDATE_CHILDREN) SC.Benchmark.end(bkey);
|
779
|
-
},
|
780
|
-
|
781
|
-
/**
|
782
|
-
Rebuild all the child item views in the collection view.
|
783
|
-
|
784
|
-
This will remove all the child views from the collection view and rebuild
|
785
|
-
them from scratch. This method is generally expensive, but if you have
|
786
|
-
made a substantial number of changes to the content array, this may be the
|
787
|
-
most efficient way to perform the update.
|
788
|
-
|
789
|
-
In general the collection view will automatically keep the item views in
|
790
|
-
sync with the content objects for you. You should not need to call this
|
791
|
-
method very often.
|
792
|
-
|
793
|
-
@returns {void}
|
794
|
-
*/
|
795
|
-
rebuildChildren: function() {
|
796
|
-
|
797
|
-
this.beginPropertyChanges() ;
|
798
|
-
|
799
|
-
// iterate through itemViews and remove them
|
800
|
-
while(this._itemViewRoot) this._removeItemViewFromChain(this._itemViewRoot) ;
|
801
|
-
|
802
|
-
// iterate through groupViews and remove them .. if grouping is disabled,
|
803
|
-
// _groupViewRoot will be null anyway.
|
804
|
-
while(this._groupViewRoot) this._removeGroupView(this._groupViewRoot) ;
|
805
|
-
|
806
|
-
// now updateChildren.
|
807
|
-
this._hasChildren = false ;
|
808
|
-
this.updateChildren() ;
|
809
|
-
|
810
|
-
this.endPropertyChanges() ;
|
811
|
-
},
|
812
|
-
|
813
|
-
/**
|
814
|
-
Update the selection state for the item views to reflect the selection
|
815
|
-
array.
|
816
|
-
|
817
|
-
This will update the isSelected property of all item views so that only
|
818
|
-
those representing content objects found in the selection array are
|
819
|
-
selected.
|
820
|
-
|
821
|
-
This method is called automatically whenever your content or selection
|
822
|
-
properties changed. You should not need to call or override it often.
|
823
|
-
*/
|
824
|
-
updateSelectionStates: function() {
|
825
|
-
if (!this._hasChildren) return ;
|
826
|
-
var selection = this.get('selection') || [];
|
827
|
-
|
828
|
-
// First, for efficiency, turn the selection into a hash by GUID. This
|
829
|
-
// way, we'll only have to perform a linear search over the children.
|
830
|
-
// This hash is cached and flushed each time the selection changes.
|
831
|
-
var selectionHash = this._selectionHash ;
|
832
|
-
if (!selectionHash) {
|
833
|
-
selectionHash = {} ;
|
834
|
-
var idx = selection.get('length') ;
|
835
|
-
while(--idx >= 0) {
|
836
|
-
var cur = selection.objectAt(idx) ;
|
837
|
-
var key = SC.guidFor(cur) ;
|
838
|
-
selectionHash[key] = true ;
|
839
|
-
}
|
840
|
-
this._selectionHash = selectionHash ;
|
841
|
-
}
|
842
|
-
|
843
|
-
// Iterate over the item views and set their selection property.
|
844
|
-
for(var key in this._itemViewsByContent) {
|
845
|
-
if (!this._itemViewsByContent.hasOwnProperty(key)) continue ;
|
846
|
-
var itemView = this._itemViewsByContent[key] ;
|
847
|
-
var isSelected = (key) ? selectionHash[key] : false ;
|
848
|
-
if (itemView.get('isSelected') != isSelected) {
|
849
|
-
itemView.set('isSelected', isSelected) ;
|
850
|
-
}
|
851
|
-
}
|
852
|
-
},
|
853
|
-
|
854
|
-
|
855
|
-
/**
|
856
|
-
Calls updateChildren whenever the view is resized, unless you have not
|
857
|
-
implemented custom layout or incremental rendering.
|
858
|
-
|
859
|
-
UPDATE:
|
860
|
-
-- add/remove any children as needed
|
861
|
-
-- update layout on all itemViews unless you have a more efficient
|
862
|
-
*/
|
863
|
-
resizeChildrenWithOldSize: function(oldSize) {
|
864
|
-
if (!this._hasChildren) return ;
|
865
|
-
this.updateChildren() ; // add/remove any new views.
|
866
|
-
this.layoutResize() ; // perform layout on all of the views if needed.
|
867
|
-
},
|
868
|
-
|
869
|
-
/**
|
870
|
-
Whenever your clipping frame changes, determine new range to display. If
|
871
|
-
new range is a change, then it will update the children and relayout.
|
872
|
-
|
873
|
-
UPDATE:
|
874
|
-
-- add/remove any children as needed
|
875
|
-
-- update layout on added children only
|
876
|
-
*/
|
877
|
-
clippingFrameDidChange: function() {
|
878
|
-
if (!this._hasChildren) return ;
|
879
|
-
SC.Benchmark.start('%@.clippingFrameDidChange'.fmt(this.toString())) ;
|
880
|
-
if (!SC.rectsEqual(this._lastClippingFrame, this.get('clippingFrame'))) {
|
881
|
-
if (this._hasChildren) this.updateChildren() ;
|
882
|
-
}
|
883
|
-
SC.Benchmark.end('%@.clippingFrameDidChange'.fmt(this.toString())) ;
|
884
|
-
},
|
885
|
-
|
886
|
-
/**
|
887
|
-
Override to return the computed frame dimensions of the collection view.
|
888
|
-
|
889
|
-
These dimensions are automatically applied at the end of a call to
|
890
|
-
updateChildren() if they change at all. This method is critical for
|
891
|
-
support of incremental rendering.
|
892
|
-
|
893
|
-
@returns {Rect} width and/or height you want this collection view to have.
|
894
|
-
*/
|
895
|
-
computeFrame: function() { return null; },
|
896
|
-
|
897
|
-
/**
|
898
|
-
Override to return the range of items to render for a given frame.
|
899
|
-
|
900
|
-
You can override this method to implement support for incremenetal
|
901
|
-
rendering. The range you return here will be used to limit the number of
|
902
|
-
actual item views that are created by the collection view.
|
903
|
-
|
904
|
-
@param {Rect} frame The frame you should use to determine the range.
|
905
|
-
|
906
|
-
@returns {Range} A hash that indicates the range of content objects to
|
907
|
-
render. ({ start: X, length: Y })
|
908
|
-
*/
|
909
|
-
contentRangeInFrame: function(frame) {
|
910
|
-
var content = this.get('content') ;
|
911
|
-
var len = ((content && content.get) ? content.get('length') : 0) || 0 ;
|
912
|
-
return { start: 0, length: len };
|
913
|
-
},
|
914
|
-
|
915
|
-
|
916
|
-
/**
|
917
|
-
This method is called whenever a group view is added or during the
|
918
|
-
layoutResize() method. You should use this method to size and position
|
919
|
-
the group view.
|
920
|
-
|
921
|
-
The included contentIndexHint can be used to help you determine the range
|
922
|
-
of content that should be included in the group. If you are renderings a
|
923
|
-
list of items 100 or less, you can get the range of content belonging to
|
924
|
-
the group using the contentRangeForGroup() method. If you are managing
|
925
|
-
a much larger set of content, you should probably implement your own
|
926
|
-
data model.
|
927
|
-
|
928
|
-
Your layout method should can optionally also use the firstLayout to
|
929
|
-
further optimize itself. Normally, you will want to only change a view's
|
930
|
-
actual frame if it does not match your calculated size. However, if
|
931
|
-
firstLayout is true, you can simply set the new layout without checking
|
932
|
-
first.
|
933
|
-
|
934
|
-
@param {SC.View} groupView the view to size and position.
|
935
|
-
@param {Object} groupValue the value the groupView represents.
|
936
|
-
@param {Number} contentIndexHint the index of a content object.
|
937
|
-
@param {Bool} firstLayout True if this is the first the view has been laid out.
|
938
|
-
|
939
|
-
*/
|
940
|
-
layoutGroupView: function(groupView, groupValue, contentIndexHint, firstLayout) {
|
941
|
-
|
942
|
-
},
|
943
|
-
|
944
|
-
/**
|
945
|
-
This method is called whenever an itemView is added or during the
|
946
|
-
layoutResize() method. You should use this method to size and position
|
947
|
-
the itemView.
|
948
|
-
|
949
|
-
@param {SC.View} itemViewthe item view to layout
|
950
|
-
@param {Number} contentIndex the index of the content this layout represents.
|
951
|
-
@param {Bool} firstLayout true if this is the first time it has been laid out.
|
952
|
-
*/
|
953
|
-
layoutItemView: function(itemView, contentIndex, firstLayout) {
|
954
|
-
|
955
|
-
},
|
956
|
-
|
957
|
-
/**
|
958
|
-
This method is called whenever the view is resized. The default
|
959
|
-
implementation will simply iterate through the visible content range and
|
960
|
-
call layoutItemView() and layoutGroupView() on all the views.
|
961
|
-
|
962
|
-
If you would like to provide a more efficient method for updating the
|
963
|
-
layout on a resize, you could override this method and do the iterating
|
964
|
-
yourself.
|
965
|
-
*/
|
966
|
-
layoutResize: function() {
|
967
|
-
if (!this._hasChildren) return ; // ignore calls before first render
|
968
|
-
var nowShowingRange = this.get('nowShowingRange') ;
|
969
|
-
var groupBy = this.get('groupBy') ;
|
970
|
-
var groupValue = undefined ;
|
971
|
-
var content = this.get('content') || [] ;
|
972
|
-
|
973
|
-
var idx = SC.maxRange(nowShowingRange) ;
|
974
|
-
while(--idx >= nowShowingRange.start) {
|
975
|
-
var cur = content.objectAt(idx) ;
|
976
|
-
var itemView = this.itemViewForContent(cur) ;
|
977
|
-
|
978
|
-
// should never happen, but recover just in case.
|
979
|
-
if (!itemView) continue ;
|
980
|
-
|
981
|
-
// if grouping is enabled, get the group value and layout based on that.
|
982
|
-
if (groupBy && ((curGroupValue = (cur) ? cur.get(groupBy) : null) !== groupValue)) {
|
983
|
-
groupValue = curGroupValue ;
|
984
|
-
var groupView = this.groupViewForGroupValue(groupValue) ;
|
985
|
-
if (groupView) {
|
986
|
-
this.layoutGroupView(groupView, groupValue, idx, false) ;
|
987
|
-
}
|
988
|
-
}
|
989
|
-
|
990
|
-
// now layout the itemView itself.
|
991
|
-
this.layoutItemView(itemView, idx, false) ;
|
992
|
-
}
|
993
|
-
},
|
994
|
-
|
995
|
-
|
996
|
-
// Ordered array of item views currently on display. This array
|
997
|
-
// is reset whenever the item views are regenerated.
|
998
|
-
_itemViews: null,
|
999
|
-
|
1000
|
-
// Ordered array of group views currently in the display. This array is
|
1001
|
-
// reset whenever the group views are regenerated.
|
1002
|
-
_groupViews: null,
|
1003
|
-
|
1004
|
-
// Most recent content range on display.
|
1005
|
-
_visibleContentRange: null,
|
1006
|
-
|
1007
|
-
// Hash of itemViews to the content guids they current represent. This
|
1008
|
-
// only matches views in currently in the _visibleContentRange.
|
1009
|
-
_itemViewsByContent: null,
|
1010
|
-
|
1011
|
-
// Hash of groupViews to the group key they currently represent.
|
1012
|
-
_groupViewsByValue: null,
|
1013
|
-
|
1014
|
-
// Hash of counts of item views contained in a group view. When the count
|
1015
|
-
// of a group reaches zero, it will be removed.
|
1016
|
-
_groupViewCounts: null,
|
1017
|
-
|
1018
|
-
// Array of unused itemViews. Push/pop only.
|
1019
|
-
_itemViewPool: null,
|
1020
|
-
|
1021
|
-
// Array of unused groupViews. Push/pop only.
|
1022
|
-
_groupViewPool: null,
|
1023
|
-
|
1024
|
-
// When a group view's item view count reaches zero, it is moved to this
|
1025
|
-
// hash until updateChildren() completes. During that time, if the group
|
1026
|
-
// is needed again, it can be reused. At the end of updateChildren() this
|
1027
|
-
// hash will be flushed and its members returned to the groupView pool.
|
1028
|
-
//
|
1029
|
-
_zombieGroupViews: null,
|
1030
|
-
|
1031
|
-
/** @private
|
1032
|
-
Finds or creates the itemView for the named content and inserts it into
|
1033
|
-
view under the correct group if needed. Note that this method does not
|
1034
|
-
take into account the actual ORDER of item views in the hierarchy. It
|
1035
|
-
assumes that manual layout will ensure the items appear visually in the
|
1036
|
-
proper order anyway.
|
1037
|
-
|
1038
|
-
@param {SC.View} itemView The item view to remove
|
1039
|
-
@param {String} groupBy the value used for grouping or null if grouping is
|
1040
|
-
disabled.
|
1041
|
-
|
1042
|
-
@returns {SC.View} the new itemView.
|
1043
|
-
*/
|
1044
|
-
_insertItemViewFor: function(content, groupBy, contentIndex) {
|
1045
|
-
|
1046
|
-
// first look for a matching record.
|
1047
|
-
var key = SC.guidFor(content) ;
|
1048
|
-
var ret = this._itemViewsByContent[key];
|
1049
|
-
var firstLayout = false ;
|
1050
|
-
|
1051
|
-
// if no record was found, pull an item view from the pool or create one.
|
1052
|
-
// set the content.
|
1053
|
-
if (!ret) {
|
1054
|
-
ret = this._itemViewPool.pop() || this.get('exampleView').create({
|
1055
|
-
owner: this, displayDelegate: this
|
1056
|
-
}) ;
|
1057
|
-
ret.addClassName('sc-collection-item') ; // add class name for display
|
1058
|
-
|
1059
|
-
// set content and add to content hash
|
1060
|
-
ret.set('content', content) ;
|
1061
|
-
this._itemViewsByContent[key] = ret ;
|
1062
|
-
this._itemViewsByGuid[SC.guidFor(ret)] = ret ;
|
1063
|
-
firstLayout = true ;
|
1064
|
-
}
|
1065
|
-
if (!ret) throw "Could not create itemView for content: %@".fmt(content);
|
1066
|
-
|
1067
|
-
// Determine proper parent view and insert itemView if needed.
|
1068
|
-
// Also update count of itemViews.
|
1069
|
-
var canGroup = !!(groupBy && content) ;
|
1070
|
-
var groupValue = (canGroup) ? content.get(groupBy) : null;
|
1071
|
-
var parentView = (canGroup) ? this._insertGroupViewFor(groupValue, contentIndex) : this ;
|
1072
|
-
var curParentView = ret.get('parentNode') ;
|
1073
|
-
|
1074
|
-
if (curParentView != parentView) {
|
1075
|
-
|
1076
|
-
// if the item is already inside of another group, then it is probably
|
1077
|
-
// just being moved, so remove it from its parent group first...
|
1078
|
-
if (groupBy && curParentView) {
|
1079
|
-
|
1080
|
-
// reduce the group view count. If this it the last item in the
|
1081
|
-
// group view, the count will be <= 0 and we will need to remove t
|
1082
|
-
// the group view itself.
|
1083
|
-
if (--this._groupViewCounts[SC.guidFor(curParentView)] <= 0) {
|
1084
|
-
this._removeGroupView(curParentView, groupValue) ;
|
1085
|
-
}
|
1086
|
-
|
1087
|
-
}
|
1088
|
-
|
1089
|
-
parentView.appendChild(ret) ;
|
1090
|
-
if (groupBy) this._groupViewCounts[SC.guidFor(parentView)]++ ;
|
1091
|
-
}
|
1092
|
-
|
1093
|
-
// Layout itemView.
|
1094
|
-
this.layoutItemView(ret, contentIndex, firstLayout) ;
|
1095
|
-
return ret ;
|
1096
|
-
},
|
1097
|
-
|
1098
|
-
/** @private
|
1099
|
-
Removes the itemView from the receiver and returns it to the itemView pool
|
1100
|
-
for later reuse.
|
1101
|
-
|
1102
|
-
If the itemView belongs to a groupView and this leaves the groupView empty
|
1103
|
-
as well, then the groupView will be moved to the zombieGroupViews hash.
|
1104
|
-
|
1105
|
-
@param {SC.View} itemView The item view to remove
|
1106
|
-
@param {String} groupBy the value used for grouping or null if grouping is
|
1107
|
-
disabled.
|
1108
|
-
|
1109
|
-
@returns {SC.View} The itemView that was removed.
|
1110
|
-
*/
|
1111
|
-
_removeItemView: function(itemView, groupBy) {
|
1112
|
-
|
1113
|
-
// If we are grouping, then decrement the groupViewCount. If the new
|
1114
|
-
// count is zero, save groupView for later removal.
|
1115
|
-
var groupView = null ; var groupValue ;
|
1116
|
-
if (groupBy && (groupView = itemView.get('parentNode'))) {
|
1117
|
-
if (--this._groupViewCounts[SC.guidFor(groupView)] > 0) groupView = null ;
|
1118
|
-
if (groupView) {
|
1119
|
-
var content = itemView.get('content') ;
|
1120
|
-
groupValue = (content) ? content.get(groupBy) : null ;
|
1121
|
-
}
|
1122
|
-
}
|
1123
|
-
|
1124
|
-
// Remove itemView from parent and remove from content hash.
|
1125
|
-
var content = itemView.get('content') ;
|
1126
|
-
var key = SC.guidFor(content) ;
|
1127
|
-
delete this._itemViewsByContent[key] ;
|
1128
|
-
delete this._itemViewsByGuid[SC.guidFor(itemView)] ;
|
1129
|
-
itemView.removeFromParent() ;
|
1130
|
-
|
1131
|
-
// Clear content and return itemView to pool
|
1132
|
-
itemView.set('content', null) ;
|
1133
|
-
this._itemViewPool.push(itemView) ;
|
1134
|
-
|
1135
|
-
// if a groupView is set, then it also needs to be returned to the pool
|
1136
|
-
if (groupView) this._removeGroupView(groupView, groupValue) ;
|
1137
|
-
|
1138
|
-
return itemView;
|
1139
|
-
},
|
1140
|
-
|
1141
|
-
/** @private
|
1142
|
-
Adds or removes itemViews for the content in the specified range.
|
1143
|
-
Note that this is not passed as a formal range because the length
|
1144
|
-
could be negative.
|
1145
|
-
|
1146
|
-
A negative length means views should be removed.
|
1147
|
-
*/
|
1148
|
-
_insertOrRemoveItemViewsInRange: function(start, length, groupBy) {
|
1149
|
-
// zero length means do nothing.
|
1150
|
-
if (length == 0) return ;
|
1151
|
-
|
1152
|
-
var content = this.get('content') || [] ;
|
1153
|
-
|
1154
|
-
// negative length == remove item views
|
1155
|
-
if (length < 0) {
|
1156
|
-
// TEMPORARY OPTIMIZATION: Do not remove views when they go out of
|
1157
|
-
// range. This way they don't need to be created/addred later on.
|
1158
|
-
//
|
1159
|
-
// while(++length < 0) {
|
1160
|
-
// var c = content.objectAt(start + length) ;
|
1161
|
-
// var itemView = this.itemViewForContent(c) ;
|
1162
|
-
// if (itemView) this._removeItemView(itemView, groupBy) ;
|
1163
|
-
// }
|
1164
|
-
|
1165
|
-
// positive length == add item views.
|
1166
|
-
} else if (length > 0) {
|
1167
|
-
while(--length >= 0) {
|
1168
|
-
var idx = start + length ;
|
1169
|
-
var c = content.objectAt(idx) ;
|
1170
|
-
this._insertItemViewFor(c, groupBy, idx) ;
|
1171
|
-
}
|
1172
|
-
}
|
1173
|
-
},
|
1174
|
-
|
1175
|
-
/** @private
|
1176
|
-
Finds or creates a groupView for the named group value and inserts it into
|
1177
|
-
the receiver. This method does not take into account the actual ORDER of
|
1178
|
-
the groupViews in the hierarchy. It assumes that manual layout will
|
1179
|
-
ensure the items appear visually in the proper order anyway.
|
1180
|
-
|
1181
|
-
@returns {SC.View} the new groupView.
|
1182
|
-
*/
|
1183
|
-
_insertGroupViewFor: function(groupValue, contentIndex) {
|
1184
|
-
var ret = this._groupViewsByValue[groupValue] ;
|
1185
|
-
// if (ret) return ret ; // nothing to do
|
1186
|
-
|
1187
|
-
var firstLayout = false ;
|
1188
|
-
|
1189
|
-
// if the group was not found, check the zombie pool. If found in zombie
|
1190
|
-
// pool, restore it to the regular group view hash.
|
1191
|
-
if (!ret && this._zombieGroupViews) {
|
1192
|
-
ret = this._zombieGroupViews[groupValue] ;
|
1193
|
-
if (ret) {
|
1194
|
-
delete this._zombieGroupViews[groupValue] ;
|
1195
|
-
this._groupViewsByValue[groupValue] = ret ;
|
1196
|
-
this._groupViewCounts[SC.guidFor(ret)] = 0 ;
|
1197
|
-
}
|
1198
|
-
}
|
1199
|
-
|
1200
|
-
// If groupValue still not found, create one.
|
1201
|
-
if (!ret) {
|
1202
|
-
ret = this._groupViewPool.pop() || this.get('exampleGroupView').create({
|
1203
|
-
owner: this, displayDelegate: this
|
1204
|
-
});
|
1205
|
-
ret.addClassName('sc-collection-group') ;
|
1206
|
-
|
1207
|
-
// set the groupValue on the groupView. Older groupViews expect us to
|
1208
|
-
// set this directly on the labelView. Newer groupViews should have a
|
1209
|
-
// groupValue property.
|
1210
|
-
if (ret.groupValue !== undefined) {
|
1211
|
-
ret.set('groupValue', groupValue) ;
|
1212
|
-
} else ret.set('content', groupValue) ;
|
1213
|
-
|
1214
|
-
// save in cache
|
1215
|
-
this._groupViewsByValue[groupValue] = ret ;
|
1216
|
-
this._groupViewCounts[SC.guidFor(ret)] = 0 ;
|
1217
|
-
firstLayout = true;
|
1218
|
-
}
|
1219
|
-
|
1220
|
-
// If the group view does not already belong to the receiver, add it.
|
1221
|
-
if (!ret) throw "Could not create a groupView for value: %@".fmt(groupValue) ;
|
1222
|
-
if (ret.get('parentNode') != this) this.appendChild(ret) ;
|
1223
|
-
|
1224
|
-
// Layout the group View
|
1225
|
-
this.layoutGroupView(ret, groupValue, contentIndex, firstLayout) ;
|
1226
|
-
|
1227
|
-
return ret ;
|
1228
|
-
},
|
1229
|
-
|
1230
|
-
/** @private
|
1231
|
-
Called whenever a groupView is no longer being used.
|
1232
|
-
|
1233
|
-
Theoretically, this method removes a group view from the receiver and
|
1234
|
-
stores it in the pool for later use. In actuality, this will just moved
|
1235
|
-
the view to the zombieGroupView pool. You must call
|
1236
|
-
_flushZombieGroupViews() to actually remove them from the receiver.
|
1237
|
-
*/
|
1238
|
-
_removeGroupView: function(groupView, groupValue) {
|
1239
|
-
if (SC.ZOMBIE_GROUPS_ENABLED) {
|
1240
|
-
this._zombieGroupViews[groupValue] = groupView ;
|
1241
|
-
} else {
|
1242
|
-
this._finalRemoveGroupView(groupView) ;
|
1243
|
-
}
|
1244
|
-
|
1245
|
-
delete this._groupViewsByValue[groupValue] ;
|
1246
|
-
delete this._groupViewCounts[SC.guidFor(groupView)] ;
|
1247
|
-
return groupView ;
|
1248
|
-
},
|
1249
|
-
|
1250
|
-
/** @private
|
1251
|
-
Flushes any zombie group views, removing them from their parent view and
|
1252
|
-
returning them to the groupView pool for later consumption.
|
1253
|
-
*/
|
1254
|
-
_flushZombieGroupViews: function() {
|
1255
|
-
if (!SC.ZOMBIE_GROUPS_ENABLED) return ; // nothing to do
|
1256
|
-
|
1257
|
-
for(var key in this._zombieGroupViews) {
|
1258
|
-
if (!this._zombieGroupViews.hasOwnProperty(key)) continue ;
|
1259
|
-
var groupView = this._zombieGroupViews[key] ;
|
1260
|
-
this._finalRemoveGroupView(groupView) ;
|
1261
|
-
}
|
1262
|
-
this._zombieGroupViews = {} ; // reset
|
1263
|
-
},
|
1264
|
-
|
1265
|
-
/** @private
|
1266
|
-
Final method to actually remove a groupView from its parent view and
|
1267
|
-
return it to the groupView pool.
|
1268
|
-
*/
|
1269
|
-
_finalRemoveGroupView: function(groupView) {
|
1270
|
-
groupView.removeFromParent() ;
|
1271
|
-
|
1272
|
-
// set the groupValue on the groupView. Older groupViews expect us to set
|
1273
|
-
// this directly on the labelView. Newer groupViews should have a
|
1274
|
-
// groupValue property.
|
1275
|
-
if (groupView.groupValue !== undefined) {
|
1276
|
-
groupView.set('groupValue', null) ;
|
1277
|
-
} else groupView.set('content', null) ;
|
1278
|
-
|
1279
|
-
this._groupViewPool.push(groupView) ;
|
1280
|
-
return groupView ;
|
1281
|
-
},
|
1282
|
-
|
1283
|
-
/** @private
|
1284
|
-
Removes the rootElement from the DOM temporarily if needed to optimize performance.
|
1285
|
-
*/
|
1286
|
-
_removeRootElementFromDom: function() {
|
1287
|
-
if (!SC.REMOVE_COLLECTION_ROOT_ELEMENT_DURING_RENDER) return ;
|
1288
|
-
if (this._cachedRootElementParent === undefined) {
|
1289
|
-
var parent = this._cachedRootElementParent = this.rootElement.parentNode ;
|
1290
|
-
this._cachedRootElementNextSibling = this.rootElement.nextSibling ;
|
1291
|
-
if (parent) parent.removeChild(this.rootElement) ;
|
1292
|
-
}
|
1293
|
-
},
|
1294
|
-
|
1295
|
-
/** @private
|
1296
|
-
Re-adds root element into DOM if necessary. Inverts _removeRootElementFromDom().
|
1297
|
-
*/
|
1298
|
-
_restoreRootElementInDom: function() {
|
1299
|
-
if (!SC.REMOVE_COLLECTION_ROOT_ELEMENT_DURING_RENDER) return ;
|
1300
|
-
if (this._cachedRootElementParent) {
|
1301
|
-
this._cachedRootElementParent.insertBefore(this.rootElement, this._cachedRootElementNextSibling);
|
1302
|
-
}
|
1303
|
-
this._cachedRootElementParent = this._cachedRootElementNextSibling = null ;
|
1304
|
-
},
|
1305
|
-
|
1306
|
-
|
1307
|
-
// ......................................
|
1308
|
-
// SELECTION
|
1309
|
-
//
|
1310
|
-
|
1311
|
-
/** @private
|
1312
|
-
Finds the smallest index of a content object in the selected array.
|
1313
|
-
*/
|
1314
|
-
_indexOfSelectionTop: function() {
|
1315
|
-
var content = this.get('content');
|
1316
|
-
var sel = this.get('selection');
|
1317
|
-
if (!content || !sel) return - 1;
|
1318
|
-
|
1319
|
-
// find the first item in the selection
|
1320
|
-
var contentLength = content.get('length') ;
|
1321
|
-
var indexOfSelected = contentLength ; var idx = sel.length ;
|
1322
|
-
while(--idx >= 0) {
|
1323
|
-
var curIndex = content.indexOf(sel[idx]) ;
|
1324
|
-
if ((curIndex >= 0) && (curIndex < indexOfSelected)) indexOfSelected = curIndex ;
|
1325
|
-
}
|
1326
|
-
|
1327
|
-
return (indexOfSelected >= contentLength) ? -1 : indexOfSelected ;
|
1328
|
-
},
|
1329
|
-
|
1330
|
-
/**
|
1331
|
-
Finds the largest index of a content object in the selection array.
|
1332
|
-
*/
|
1333
|
-
_indexOfSelectionBottom: function() {
|
1334
|
-
var content = this.get('content');
|
1335
|
-
var sel = this.get('selection');
|
1336
|
-
if (!content || !sel) return - 1;
|
1337
|
-
|
1338
|
-
var indexOfSelected = -1 ; var idx = sel.length ;
|
1339
|
-
while(--idx >= 0) {
|
1340
|
-
var curIndex = content.indexOf(sel[idx]) ;
|
1341
|
-
if (curIndex > indexOfSelected) indexOfSelected = curIndex ;
|
1342
|
-
}
|
1343
|
-
|
1344
|
-
return (indexOfSelected < 0) ? -1 : indexOfSelected ;
|
1345
|
-
},
|
1346
|
-
|
1347
|
-
/**
|
1348
|
-
Select one or more items before the current selection, optionally
|
1349
|
-
extending the current selection. Also scrolls the selected item into
|
1350
|
-
view.
|
1351
|
-
|
1352
|
-
Selection does not wrap around.
|
1353
|
-
|
1354
|
-
@param extend {Boolean} (Optional) If true, the selection will be extended
|
1355
|
-
instead of replaced. Defaults to false.
|
1356
|
-
@param numberOfItems {Integer} (Optional) The number of previous to be
|
1357
|
-
selected. Defaults to 1
|
1358
|
-
@returns {void}
|
1359
|
-
*/
|
1360
|
-
selectPreviousItem: function(extend, numberOfItems)
|
1361
|
-
{
|
1362
|
-
if (numberOfItems == null) numberOfItems = 1 ;
|
1363
|
-
if (extend == null) extend = false ;
|
1364
|
-
|
1365
|
-
var content = this.get('content');
|
1366
|
-
var contentLength = content.get('length') ;
|
1367
|
-
|
1368
|
-
// if extending, then we need to do some fun stuff to build the array
|
1369
|
-
var selTop, selBottom, anchor ;
|
1370
|
-
if (extend) {
|
1371
|
-
selTop = this._indexOfSelectionTop() ;
|
1372
|
-
selBottom = this._indexOfSelectionBottom() ;
|
1373
|
-
anchor = (this._selectionAnchor == null) ? selTop : this._selectionAnchor ;
|
1374
|
-
this._selectionAnchor = anchor ;
|
1375
|
-
|
1376
|
-
// If the selBottom is after the anchor, then reduce the selection
|
1377
|
-
if (selBottom > anchor) {
|
1378
|
-
selBottom = selBottom - numberOfItems ;
|
1379
|
-
|
1380
|
-
// otherwise, select the previous item from the top
|
1381
|
-
} else {
|
1382
|
-
selTop = selTop - numberOfItems ;
|
1383
|
-
}
|
1384
|
-
|
1385
|
-
// Ensure we are not out of bounds
|
1386
|
-
if (selTop < 0) selTop = 0 ;
|
1387
|
-
if (selBottom < selTop) selBottom = selTop ;
|
1388
|
-
|
1389
|
-
// if not extending, just select the item previous to the selTop
|
1390
|
-
} else {
|
1391
|
-
selTop = this._indexOfSelectionTop() - numberOfItems;
|
1392
|
-
if (selTop < 0) selTop = 0 ;
|
1393
|
-
selBottom = selTop ;
|
1394
|
-
anchor = null ;
|
1395
|
-
}
|
1396
|
-
|
1397
|
-
// now build array of new items to select
|
1398
|
-
var items = [] ;
|
1399
|
-
while(selTop <= selBottom) {
|
1400
|
-
items[items.length] = content.objectAt(selTop++) ;
|
1401
|
-
}
|
1402
|
-
|
1403
|
-
// ensure that the item is visible and set the selection
|
1404
|
-
if (items.length > 0) {
|
1405
|
-
this.scrollToContent(items.first());
|
1406
|
-
this.selectItems(items);
|
1407
|
-
}
|
1408
|
-
|
1409
|
-
this._selectionAnchor = anchor ;
|
1410
|
-
},
|
1411
|
-
|
1412
|
-
/**
|
1413
|
-
Select one or more items folling the current selection, optionally
|
1414
|
-
extending the current selection. Also scrolls to selected item.
|
1415
|
-
|
1416
|
-
Selection does not wrap around.
|
1417
|
-
|
1418
|
-
@param extend {Boolean} (Optional) If true, the selection will be extended
|
1419
|
-
instead of replaced. Defaults to false.
|
1420
|
-
@param numberOfItems {Integer} (Optional) The number of items to be
|
1421
|
-
selected. Defaults to 1.
|
1422
|
-
@returns {void}
|
1423
|
-
*/
|
1424
|
-
selectNextItem: function(extend, numberOfItems)
|
1425
|
-
{
|
1426
|
-
if (numberOfItems == null) numberOfItems = 1 ;
|
1427
|
-
if (extend == null) extend = false ;
|
1428
|
-
|
1429
|
-
var content = this.get('content');
|
1430
|
-
var contentLength = content.get('length') ;
|
1431
|
-
|
1432
|
-
// if extending, then we need to do some fun stuff to build the array
|
1433
|
-
var selTop, selBottom, anchor ;
|
1434
|
-
if (extend) {
|
1435
|
-
selTop = this._indexOfSelectionTop() ;
|
1436
|
-
selBottom = this._indexOfSelectionBottom() ;
|
1437
|
-
anchor = (this._selectionAnchor == null) ? selTop : this._selectionAnchor ;
|
1438
|
-
this._selectionAnchor = anchor ;
|
1439
|
-
|
1440
|
-
// If the selTop is before the anchor, then reduce the selection
|
1441
|
-
if (selTop < anchor) {
|
1442
|
-
selTop = selTop + numberOfItems ;
|
1443
|
-
|
1444
|
-
// otherwise, select the next item after the top
|
1445
|
-
} else {
|
1446
|
-
selBottom = selBottom + numberOfItems ;
|
1447
|
-
}
|
1448
|
-
|
1449
|
-
// Ensure we are not out of bounds
|
1450
|
-
if (selBottom >= contentLength) selBottom = contentLength-1;
|
1451
|
-
if (selTop > selBottom) selTop = selBottom ;
|
1452
|
-
|
1453
|
-
// if not extending, just select the item next to the selBottom
|
1454
|
-
} else {
|
1455
|
-
selBottom = this._indexOfSelectionBottom() + numberOfItems;
|
1456
|
-
if (selBottom >= contentLength) selBottom = contentLength-1;
|
1457
|
-
selTop = selBottom ;
|
1458
|
-
anchor = null ;
|
1459
|
-
}
|
1460
|
-
|
1461
|
-
// now build array of new items to select
|
1462
|
-
var items = [] ;
|
1463
|
-
while(selTop <= selBottom) {
|
1464
|
-
items[items.length] = content.objectAt(selTop++) ;
|
1465
|
-
}
|
1466
|
-
|
1467
|
-
// ensure that the item is visible and set the selection
|
1468
|
-
if (items.length > 0) {
|
1469
|
-
this.scrollToContent(items.first());
|
1470
|
-
this.selectItems(items);
|
1471
|
-
}
|
1472
|
-
|
1473
|
-
this._selectionAnchor = anchor ;
|
1474
|
-
},
|
1475
|
-
|
1476
|
-
/**
|
1477
|
-
Scroll the rootElement (if needed) to ensure that the item is visible.
|
1478
|
-
@param {SC.Record} record The record to scroll to
|
1479
|
-
@returns {void}
|
1480
|
-
*/
|
1481
|
-
scrollToContent: function(record) {
|
1482
|
-
// find the itemView. if not present, add one.
|
1483
|
-
var content = Array.from(this.get('content'));
|
1484
|
-
if (content.indexOf(record) < 0) return ; // do nothing if not in content.
|
1485
|
-
|
1486
|
-
var itemView = this.itemViewForContent(record) ;
|
1487
|
-
if (!itemView) {
|
1488
|
-
var content = Array.from(this.get('content')) ;
|
1489
|
-
var contentIndex = content.indexOf(record) ;
|
1490
|
-
var groupBy = this.get('groupBy');
|
1491
|
-
itemView = this._insertItemViewFor(record, groupBy, contentIndex);
|
1492
|
-
}
|
1493
|
-
if (itemView) this.scrollToItemView(itemView);
|
1494
|
-
},
|
1495
|
-
|
1496
|
-
/**
|
1497
|
-
Scroll the rootElement (if needed) to ensure that the item is visible.
|
1498
|
-
@param {SC.View} view The item view to scroll to
|
1499
|
-
@returns {void}
|
1500
|
-
*/
|
1501
|
-
scrollToItemView: function( view )
|
1502
|
-
{
|
1503
|
-
// find first scrollable view.
|
1504
|
-
var scrollable = this ;
|
1505
|
-
while(scrollable && (scrollable != SC.window) && (!scrollable.get('isScrollable'))) {
|
1506
|
-
scrollable = scrollable.get('parentNode') ;
|
1507
|
-
}
|
1508
|
-
if (!scrollable || (scrollable == SC.window)) return ; // no scrollable!
|
1509
|
-
scrollable.scrollToVisible(view) ;
|
1510
|
-
},
|
1511
|
-
|
1512
|
-
/**
|
1513
|
-
Selects the passed array of items, optionally extending the
|
1514
|
-
current selection.
|
1515
|
-
|
1516
|
-
@param items {Array} The item or items to select.
|
1517
|
-
@param extendSelection {Boolean} If true, extends the selection instead of
|
1518
|
-
replacing it.
|
1519
|
-
*/
|
1520
|
-
selectItems: function(items, extendSelection) {
|
1521
|
-
var base = (extendSelection) ? this.get('selection') : [] ;
|
1522
|
-
var sel = [items].concat(base).flatten().uniq() ;
|
1523
|
-
|
1524
|
-
// if you are not extending the selection, then clear the selection
|
1525
|
-
// anchor.
|
1526
|
-
this._selectionAnchor = null ;
|
1527
|
-
this.set('selection',sel) ;
|
1528
|
-
},
|
1529
|
-
|
1530
|
-
/**
|
1531
|
-
Removes the items from the selection.
|
1532
|
-
*/
|
1533
|
-
deselectItems: function(items) {
|
1534
|
-
items = [items].flatten() ;
|
1535
|
-
var base = this.get('selection') || [] ;
|
1536
|
-
var sel = base.map(function(i) { return (items.include(i)) ? null : i; });
|
1537
|
-
sel = sel.compact() ;
|
1538
|
-
this.set('selection',sel) ;
|
1539
|
-
},
|
1540
|
-
|
1541
|
-
/**
|
1542
|
-
Deletes the selected content if canDeleteContent is YES.
|
1543
|
-
|
1544
|
-
This will invoke delegate methods to provide fine-grained control.
|
1545
|
-
|
1546
|
-
@returns {Boolean} YES if deletion is possible, even if none actually occurred.
|
1547
|
-
*/
|
1548
|
-
deleteSelection: function() {
|
1549
|
-
|
1550
|
-
// perform some basic checks...
|
1551
|
-
if (!this.get('canDeleteContent')) return NO;
|
1552
|
-
var sel = Array.from(this.get('selection'));
|
1553
|
-
if (!sel || sel.get('length') === 0) return NO ;
|
1554
|
-
|
1555
|
-
// let the delegate decide what to actually delete. If this returns an
|
1556
|
-
// empty array or null, just do nothing.
|
1557
|
-
sel = this.invokeDelegateMethod(this.delegate, 'collectionViewShouldDeleteContent', this, sel) ;
|
1558
|
-
sel = Array.from(sel) ; // ensure this is an array
|
1559
|
-
if (!sel || sel.get('length') === 0) return YES ;
|
1560
|
-
|
1561
|
-
// now have the delegate (or us) perform the deletion. The collection
|
1562
|
-
// view implements a default version of this method.
|
1563
|
-
this.invokeDelegateMethod(this.delegate, 'collectionViewDeleteContent', this, sel) ;
|
1564
|
-
return YES ;
|
1565
|
-
},
|
1566
|
-
|
1567
|
-
/**
|
1568
|
-
Default implementation of the delegate method.
|
1569
|
-
|
1570
|
-
This method will delete the passed items from the content array using
|
1571
|
-
standard array methods. This is often suitable if you are using an
|
1572
|
-
array controller or a real array for your content.
|
1573
|
-
|
1574
|
-
@param view {SC.CollectionView} this
|
1575
|
-
@param sel {Array} the items to delete
|
1576
|
-
@returns {Boolean} YES if the deletion was a success.
|
1577
|
-
*/
|
1578
|
-
collectionViewDeleteContent: function(view, sel) {
|
1579
|
-
|
1580
|
-
// get the content. Bail if this cannot be used as an array.
|
1581
|
-
var content = this.get('content') ;
|
1582
|
-
if (!content) return NO; // nothing to do
|
1583
|
-
|
1584
|
-
// determine the method to use
|
1585
|
-
var hasDestroyObject = $type(content.destroyObject) === T_FUNCTION ;
|
1586
|
-
var hasRemoveObject = $type(content.removeObject) === T_FUNCTION ;
|
1587
|
-
if (!hasDestroyObject && !hasRemoveObject) return NO; // nothing to do
|
1588
|
-
|
1589
|
-
// suspend property notifications and remove the objects...
|
1590
|
-
if (content.beginPropertyChanges) content.beginPropertyChanges();
|
1591
|
-
var idx = sel.get('length') ;
|
1592
|
-
while(--idx >= 0) {
|
1593
|
-
var item = sel.objectAt(idx) ;
|
1594
|
-
(hasDestroyObject) ? content.destroyObject(item) : content.removeObject(item);
|
1595
|
-
}
|
1596
|
-
// begin notifying again...
|
1597
|
-
if (content.endPropertyChanges) content.endPropertyChanges() ;
|
1598
|
-
|
1599
|
-
return YES ; // done!
|
1600
|
-
},
|
1601
|
-
|
1602
|
-
// ......................................
|
1603
|
-
// EVENT HANDLING
|
1604
|
-
//
|
1605
|
-
|
1606
|
-
keyDown: function(evt) {
|
1607
|
-
return this.interpretKeyEvents(evt) ;
|
1608
|
-
},
|
1609
|
-
|
1610
|
-
keyUp: function() { return true; },
|
1611
|
-
|
1612
|
-
/** @private
|
1613
|
-
Handle select all keyboard event.
|
1614
|
-
*/
|
1615
|
-
selectAll: function(evt) {
|
1616
|
-
var content = (this.get('content') || []).slice() ;
|
1617
|
-
this.selectItems(content, NO) ;
|
1618
|
-
return YES ;
|
1619
|
-
},
|
1620
|
-
|
1621
|
-
/** @private
|
1622
|
-
Handle delete keyboard event.
|
1623
|
-
*/
|
1624
|
-
deleteBackward: function(evt) {
|
1625
|
-
return this.deleteSelection() ;
|
1626
|
-
},
|
1627
|
-
|
1628
|
-
/** @private
|
1629
|
-
Handle delete keyboard event.
|
1630
|
-
*/
|
1631
|
-
deleteForward: function(evt) {
|
1632
|
-
return this.deleteSelection() ;
|
1633
|
-
},
|
1634
|
-
|
1635
|
-
/** @private
|
1636
|
-
Selects the same item on the next row or moves down one if
|
1637
|
-
itemsPerRow = 1
|
1638
|
-
*/
|
1639
|
-
moveDown: function(sender, evt) {
|
1640
|
-
this.selectNextItem(false, this.get('itemsPerRow') || 1) ;
|
1641
|
-
return true ;
|
1642
|
-
},
|
1643
|
-
|
1644
|
-
/** @private
|
1645
|
-
Selects the same item on the next row or moves up one if
|
1646
|
-
itemsPerRow = 1
|
1647
|
-
*/
|
1648
|
-
moveUp: function(sender, evt) {
|
1649
|
-
this.selectPreviousItem(false, this.get('itemsPerRow') || 1) ;
|
1650
|
-
return true ;
|
1651
|
-
},
|
1652
|
-
|
1653
|
-
/** @private
|
1654
|
-
Selects the previous item if itemsPerRow > 1. Otherwise does nothing.
|
1655
|
-
*/
|
1656
|
-
moveLeft: function(sender, evt) {
|
1657
|
-
if ((this.get('itemsPerRow') || 1) > 1) this.selectPreviousItem(false, 1) ;
|
1658
|
-
return true ;
|
1659
|
-
},
|
1660
|
-
|
1661
|
-
/** @private
|
1662
|
-
Selects the next item if itemsPerRow > 1. Otherwise does nothing.
|
1663
|
-
*/
|
1664
|
-
moveRight: function(sender, evt) {
|
1665
|
-
if ((this.get('itemsPerRow') || 1) > 1) this.selectNextItem(false, 1) ;
|
1666
|
-
return true ;
|
1667
|
-
},
|
1668
|
-
|
1669
|
-
moveDownAndModifySelection: function(sender, evt) {
|
1670
|
-
this.selectNextItem(true, this.get('itemsPerRow') || 1) ;
|
1671
|
-
return true ;
|
1672
|
-
},
|
1673
|
-
|
1674
|
-
moveUpAndModifySelection: function(sender, evt) {
|
1675
|
-
this.selectPreviousItem(true, this.get('itemsPerRow') || 1) ;
|
1676
|
-
return true ;
|
1677
|
-
},
|
1678
|
-
|
1679
|
-
/** @private
|
1680
|
-
Selects the previous item if itemsPerRow > 1. Otherwise does nothing.
|
1681
|
-
*/
|
1682
|
-
moveLeftAndModifySelection: function(sender, evt) {
|
1683
|
-
if ((this.get('itemsPerRow') || 1) > 1) this.selectPreviousItem(true, 1) ;
|
1684
|
-
return true ;
|
1685
|
-
},
|
1686
|
-
|
1687
|
-
/** @private
|
1688
|
-
Selects the next item if itemsPerRow > 1. Otherwise does nothing.
|
1689
|
-
*/
|
1690
|
-
moveRightAndModifySelection: function(sender, evt) {
|
1691
|
-
if ((this.get('itemsPerRow') || 1) > 1) this.selectNextItem(true, 1) ;
|
1692
|
-
return true ;
|
1693
|
-
},
|
1694
|
-
|
1695
|
-
/**
|
1696
|
-
Handles mouse down events on the collection view or on any of its
|
1697
|
-
children.
|
1698
|
-
|
1699
|
-
The default implementation of this method can handle a wide variety
|
1700
|
-
of user behaviors depending on how you have configured the various
|
1701
|
-
options for the collection view.
|
1702
|
-
|
1703
|
-
@param ev {Event} the mouse down event
|
1704
|
-
@returns {Boolean} Usually YES.
|
1705
|
-
*/
|
1706
|
-
mouseDown: function(ev) {
|
1707
|
-
|
1708
|
-
// When the user presses the mouse down, we don't do much just yet.
|
1709
|
-
// Instead, we just need to save a bunch of state about the mouse down
|
1710
|
-
// so we can choose the right thing to do later.
|
1711
|
-
|
1712
|
-
// save the original mouse down event for use in dragging.
|
1713
|
-
this._mouseDownEvent = ev ;
|
1714
|
-
|
1715
|
-
// Toggle selection only triggers on mouse up. Do nothing.
|
1716
|
-
if (this.useToggleSelection) return true;
|
1717
|
-
|
1718
|
-
// Make sure that saved mouseDown state is always reset in case we do
|
1719
|
-
// not get a paired mouseUp. (Only happens if subclass does not call us
|
1720
|
-
// like it should)
|
1721
|
-
this._mouseDownAt = this._shouldSelect = this._shouldDeselect =
|
1722
|
-
this._shouldReselect = this._refreshSelection = false;
|
1723
|
-
|
1724
|
-
// find the actual view the mouse was pressed down on. This will call
|
1725
|
-
// hitTest() on item views so they can implement non-square detection
|
1726
|
-
// modes. -- once we have an item view, get its content object as well.
|
1727
|
-
var mouseDownView = this._mouseDownView = this.itemViewForEvent(ev);
|
1728
|
-
var mouseDownContent =
|
1729
|
-
this._mouseDownContent = (mouseDownView) ? mouseDownView.get('content') : null;
|
1730
|
-
|
1731
|
-
// become first responder if possible.
|
1732
|
-
this.becomeFirstResponder() ;
|
1733
|
-
|
1734
|
-
// recieved a mouseDown on the collection element, but not on one of the
|
1735
|
-
// childItems... unless we do not allow empty selections, set it to empty.
|
1736
|
-
if (!mouseDownView) {
|
1737
|
-
if (this.get('allowDeselectAll')) this.selectItems([], false);
|
1738
|
-
return true ;
|
1739
|
-
}
|
1740
|
-
|
1741
|
-
// collection some basic setup info
|
1742
|
-
var selection = this.get('selection') || [];
|
1743
|
-
var isSelected = selection.include(mouseDownContent);
|
1744
|
-
var modifierKeyPressed = ev.ctrlKey || ev.metaKey ;
|
1745
|
-
if (mouseDownView.checkboxView && (Event.element(ev) == el.checkboxView.rootElement)) {
|
1746
|
-
modifierKeyPressed = true ;
|
1747
|
-
}
|
1748
|
-
this._modifierKeyPressed = modifierKeyPressed ;
|
1749
|
-
|
1750
|
-
this._mouseDownAt = Date.now();
|
1751
|
-
|
1752
|
-
// holding down a modifier key while clicking a selected item should
|
1753
|
-
// deselect that item...deselect and bail.
|
1754
|
-
if (modifierKeyPressed && isSelected) {
|
1755
|
-
this._shouldDeselect = mouseDownContent;
|
1756
|
-
// if the shiftKey was pressed, then we want to extend the selection
|
1757
|
-
// from the last selected item
|
1758
|
-
} else if (ev.shiftKey && selection.get('length') > 0) {
|
1759
|
-
selection = this._findSelectionExtendedByShift(selection, mouseDownContent) ;
|
1760
|
-
this.selectItems(selection) ;
|
1761
|
-
|
1762
|
-
// If no modifier key was pressed, then clicking on the selected item
|
1763
|
-
// should clear the selection and reselect only the clicked on item.
|
1764
|
-
} else if (!modifierKeyPressed && isSelected) {
|
1765
|
-
this._shouldReselect = mouseDownContent;
|
1766
|
-
|
1767
|
-
// Otherwise, if selecting on mouse down, simply select the clicked on
|
1768
|
-
// item, adding it to the current selection if a modifier key was pressed.
|
1769
|
-
} else {
|
1770
|
-
if (this.get("selectOnMouseDown")){
|
1771
|
-
this.selectItems(mouseDownContent, modifierKeyPressed);
|
1772
|
-
} else this._shouldSelect = mouseDownContent ;
|
1773
|
-
}
|
1774
|
-
|
1775
|
-
// saved for extend by shift ops.
|
1776
|
-
this._previousMouseDownContent = mouseDownContent;
|
1777
|
-
|
1778
|
-
return true;
|
1779
|
-
},
|
1780
|
-
|
1781
|
-
mouseUp: function(ev) {
|
1782
|
-
|
1783
|
-
var canAct = this.get('actOnSelect') ;
|
1784
|
-
var view = this.itemViewForEvent(ev) ;
|
1785
|
-
|
1786
|
-
if (this.useToggleSelection) {
|
1787
|
-
if (!view) return ; // do nothing when clicked outside of elements
|
1788
|
-
|
1789
|
-
// determine if item is selected. If so, then go on.
|
1790
|
-
var selection = this.get('selection') || [] ;
|
1791
|
-
var content = (view) ? view.get('content') : null ;
|
1792
|
-
var isSelected = selection.include(content) ;
|
1793
|
-
if (isSelected) {
|
1794
|
-
this.deselectItems([content]) ;
|
1795
|
-
} else this.selectItems([content],true) ;
|
1796
|
-
|
1797
|
-
} else {
|
1798
|
-
var content = (view) ? view.get('content') : null ;
|
1799
|
-
|
1800
|
-
// this will be set if the user simply clicked on an unselected item and
|
1801
|
-
// selectOnMouseDown was NO.
|
1802
|
-
if (this._shouldSelect) this.selectItems(this._shouldSelect, this._modifierKeyPressed);
|
1803
|
-
|
1804
|
-
// This is true if the user clicked on a selected item with a modifier
|
1805
|
-
// key pressed.
|
1806
|
-
if (this._shouldDeselect) this.deselectItems(this._shouldDeselect);
|
1807
|
-
|
1808
|
-
// This is true if the user clicked on a selected item without a
|
1809
|
-
// modifier-key pressed. When this happens we try to begin editing
|
1810
|
-
// on the content. If that is not allowed, then simply clear the
|
1811
|
-
// selection and reselect the clicked on item.
|
1812
|
-
if (this._shouldReselect) {
|
1813
|
-
|
1814
|
-
// - contentValueIsEditable is true
|
1815
|
-
var canEdit = this.get('contentValueIsEditable') ;
|
1816
|
-
|
1817
|
-
// - the user clicked on an item that was already selected
|
1818
|
-
// - is the only item selected
|
1819
|
-
if (canEdit) {
|
1820
|
-
var sel = this.get('selection') ;
|
1821
|
-
canEdit = sel && (sel.get('length') === 1) && (sel.objectAt(0) === this._shouldReselect) ;
|
1822
|
-
}
|
1823
|
-
|
1824
|
-
// - the item view responds to contentHitTest() and returns YES.
|
1825
|
-
// - the item view responds to beginEditing and returns YES.
|
1826
|
-
if (canEdit) {
|
1827
|
-
var itemView = this.itemViewForContent(this._shouldReselect) ;
|
1828
|
-
canEdit = itemView && (!itemView.contentHitTest || itemView.contentHitTest(ev)) ;
|
1829
|
-
canEdit = (canEdit && itemView.beginEditing) ? itemView.beginEditing() : NO ;
|
1830
|
-
}
|
1831
|
-
|
1832
|
-
// if cannot edit, just reselect
|
1833
|
-
if (!canEdit) this.selectItems(this._shouldReselect,false) ;
|
1834
|
-
}
|
1835
|
-
|
1836
|
-
this._cleanupMouseDown() ;
|
1837
|
-
}
|
1838
|
-
|
1839
|
-
this._mouseDownEvent = null ;
|
1840
|
-
if (canAct) this._action(ev, view) ;
|
1841
|
-
|
1842
|
-
return false; // bubble event to allow didDoubleClick to be called...
|
1843
|
-
},
|
1844
|
-
|
1845
|
-
_cleanupMouseDown: function() {
|
1846
|
-
this._mouseDownAt = this._shouldDeselect = this._shouldReselect = this._refreshSelection = this._shouldSelect = false;
|
1847
|
-
this._mouseDownEvent = this._mouseDownContent = this._mouseDownView = null ;
|
1848
|
-
},
|
1849
|
-
|
1850
|
-
mouseMoved: function(ev) {
|
1851
|
-
var view = this.itemViewForEvent(ev) ;
|
1852
|
-
// handle hover events.
|
1853
|
-
if(this._lastHoveredItem && ((view === null) || (view != this._lastHoveredItem)) && this._lastHoveredItem.mouseOut) {
|
1854
|
-
this._lastHoveredItem.mouseOut(ev);
|
1855
|
-
}
|
1856
|
-
this._lastHoveredItem = view ;
|
1857
|
-
if (view && view.mouseOver) view.mouseOver(ev) ;
|
1858
|
-
},
|
1859
|
-
|
1860
|
-
mouseOut: function(ev) {
|
1861
|
-
|
1862
|
-
var view = this._lastHoveredItem ;
|
1863
|
-
this._lastHoveredItem = null ;
|
1864
|
-
if (view && view.didMouseOut) view.didMouseOut(ev) ;
|
1865
|
-
},
|
1866
|
-
|
1867
|
-
doubleClick: function(ev) {
|
1868
|
-
var view = this.itemViewForEvent(ev) ;
|
1869
|
-
if (view) {
|
1870
|
-
this._action(view, ev) ;
|
1871
|
-
return true ;
|
1872
|
-
} else return false ;
|
1873
|
-
},
|
1874
|
-
|
1875
|
-
_findSelectionExtendedByShift: function(selection, mouseDownContent) {
|
1876
|
-
var content = this.get('content');
|
1877
|
-
|
1878
|
-
// bounds of the collection...
|
1879
|
-
var contentLowerBounds = 0;
|
1880
|
-
var contentUpperBounds = (content.get('length') - 1);
|
1881
|
-
|
1882
|
-
var selectionBeginIndex = content.indexOf(selection.first());
|
1883
|
-
var selectionEndIndex = content.indexOf(selection.last());
|
1884
|
-
|
1885
|
-
var previousMouseDownIndex = content.indexOf(this._previousMouseDownContent);
|
1886
|
-
// _previousMouseDownContent couldn't be found... either it hasn't been set yet or the record has been deleted by the user
|
1887
|
-
// fall back to the first selected item.
|
1888
|
-
if (previousMouseDownIndex == -1) previousMouseDownIndex = selectionBeginIndex;
|
1889
|
-
|
1890
|
-
|
1891
|
-
var currentMouseDownIndex = content.indexOf(mouseDownContent);
|
1892
|
-
// sanity check...
|
1893
|
-
if (currentMouseDownIndex == -1) throw "Unable to extend selection to an item that's not in the content array!";
|
1894
|
-
|
1895
|
-
// clicked before the current selection set... extend it's beginning...
|
1896
|
-
if (currentMouseDownIndex < selectionBeginIndex) {
|
1897
|
-
selectionBeginIndex = currentMouseDownIndex;
|
1898
|
-
}
|
1899
|
-
|
1900
|
-
// clicked after the current selection set... extend it's ending...
|
1901
|
-
if (currentMouseDownIndex > selectionEndIndex) {
|
1902
|
-
selectionEndIndex = currentMouseDownIndex;
|
1903
|
-
}
|
1904
|
-
|
1905
|
-
// clicked inside the selection set... need to determine where the last
|
1906
|
-
// selection was and use that as an anchor.
|
1907
|
-
if ((currentMouseDownIndex > selectionBeginIndex) && (currentMouseDownIndex < selectionEndIndex)) {
|
1908
|
-
if (currentMouseDownIndex === previousMouseDownIndex) {
|
1909
|
-
selectionBeginIndex = currentMouseDownIndex;
|
1910
|
-
selectionEndIndex = currentMouseDownIndex;
|
1911
|
-
} else if (currentMouseDownIndex > previousMouseDownIndex) {
|
1912
|
-
selectionBeginIndex = previousMouseDownIndex;
|
1913
|
-
selectionEndIndex = currentMouseDownIndex;
|
1914
|
-
} else if (currentMouseDownIndex < previousMouseDownIndex){
|
1915
|
-
selectionBeginIndex = currentMouseDownIndex;
|
1916
|
-
selectionEndIndex = previousMouseDownIndex;
|
1917
|
-
}
|
1918
|
-
}
|
1919
|
-
|
1920
|
-
// slice doesn't include the last index passed... silly..
|
1921
|
-
selectionEndIndex++;
|
1922
|
-
|
1923
|
-
// shouldn't need to sanity check that the selection is in bounds due to
|
1924
|
-
// the indexOf checks above...I'll have faith that indexOf hasn't lied to
|
1925
|
-
// me...
|
1926
|
-
return content.slice(selectionBeginIndex, selectionEndIndex);
|
1927
|
-
},
|
1928
|
-
|
1929
|
-
|
1930
|
-
// if content value is editable and we have one item selected, then edit.
|
1931
|
-
// otherwise, invoke action.
|
1932
|
-
insertNewline: function() {
|
1933
|
-
if (this.get('contentValueIsEditable')) {
|
1934
|
-
var sel = this.get('selection') ;
|
1935
|
-
if (sel && sel.get('length') === 1) {
|
1936
|
-
var itemView = this.itemViewForContent(sel.objectAt(0)) ;
|
1937
|
-
if (itemView && itemView.beginEditing) {
|
1938
|
-
this.scrollToItemView(itemView) ;
|
1939
|
-
itemView.beginEditing() ;
|
1940
|
-
}
|
1941
|
-
}
|
1942
|
-
|
1943
|
-
// invoke action!
|
1944
|
-
} else {
|
1945
|
-
var sel = this.get('selection') ;
|
1946
|
-
var itemView = (sel && sel.get('length') === 1) ? this.itemViewForContent(sel.objectAt(0)) : null ;
|
1947
|
-
this._action(itemView, null) ;
|
1948
|
-
}
|
1949
|
-
|
1950
|
-
return YES ; // always handle
|
1951
|
-
},
|
1952
|
-
|
1953
|
-
// ......................................
|
1954
|
-
// FIRST RESPONDER
|
1955
|
-
//
|
1956
|
-
|
1957
|
-
/**
|
1958
|
-
Called whenever the collection becomes first responder.
|
1959
|
-
Adds the focused class to the element.
|
1960
|
-
*/
|
1961
|
-
didBecomeFirstResponder: function() {
|
1962
|
-
this.addClassName('focus') ;
|
1963
|
-
},
|
1964
|
-
|
1965
|
-
willLoseFirstResponder: function() {
|
1966
|
-
this.removeClassName('focus');
|
1967
|
-
},
|
1968
|
-
|
1969
|
-
// ......................................
|
1970
|
-
// DRAG AND DROP SUPPORT
|
1971
|
-
//
|
1972
|
-
|
1973
|
-
/**
|
1974
|
-
When reordering its content, the collection view will store its reorder
|
1975
|
-
data using this special data type. The data type is unique to each
|
1976
|
-
collection view instance. You can use this data type to detect reorders
|
1977
|
-
if necessary.
|
1978
|
-
|
1979
|
-
@field
|
1980
|
-
@type {String}
|
1981
|
-
*/
|
1982
|
-
reorderDataType: function() {
|
1983
|
-
if (!this._reorderDataTypeKey) {
|
1984
|
-
this._reorderDataTypeKey = "SC.CollectionView.Reorder.%@".fmt(SC.guidFor(this)) ;
|
1985
|
-
}
|
1986
|
-
return this._reorderDataTypeKey ;
|
1987
|
-
}.property(),
|
1988
|
-
|
1989
|
-
_reorderDataType: function() {
|
1990
|
-
return this.get('reorderDataType') ;
|
1991
|
-
},
|
1992
|
-
|
1993
|
-
/**
|
1994
|
-
This property is set to the array of content objects that are the subject
|
1995
|
-
of a drag whenever a drag is initiated on the collection view. You can
|
1996
|
-
consult this property when implementing your collection view delegate
|
1997
|
-
methods, but otherwise you should not use this property in your code.
|
1998
|
-
|
1999
|
-
Note that drag content will always appear in the same order the content
|
2000
|
-
appears in the source content array.
|
2001
|
-
|
2002
|
-
@field
|
2003
|
-
@type {Array}
|
2004
|
-
*/
|
2005
|
-
dragContent: null,
|
2006
|
-
|
2007
|
-
/**
|
2008
|
-
This property is set to the proposed insertion index during a call to
|
2009
|
-
collectionViewValidateDrop(). Your delegate implementations can change
|
2010
|
-
the value of this property to enforce a drop some in some other location.
|
2011
|
-
|
2012
|
-
@type {Number}
|
2013
|
-
@field
|
2014
|
-
*/
|
2015
|
-
proposedInsertionIndex: null,
|
2016
|
-
|
2017
|
-
/**
|
2018
|
-
This property is set to the proposed drop operation during a call to
|
2019
|
-
collectionViewValidateDrop(). Your delegate implementations can change
|
2020
|
-
the value of this property to enforce a different type of drop operation.
|
2021
|
-
|
2022
|
-
@type {Number}
|
2023
|
-
@field
|
2024
|
-
*/
|
2025
|
-
proposedDropOperation: null,
|
2026
|
-
|
2027
|
-
/** @private
|
2028
|
-
mouseDragged event handler. Initiates a drag if the following conditions
|
2029
|
-
are met:
|
2030
|
-
|
2031
|
-
- collectionViewShouldBeginDrag() returns YES *OR*
|
2032
|
-
- the above method is not implemented and canReorderContent is true.
|
2033
|
-
- the dragDataTypes property returns a non-empty array
|
2034
|
-
- a mouse down event was saved by the mouseDown method.
|
2035
|
-
*/
|
2036
|
-
mouseDragged: function(ev) {
|
2037
|
-
// if the mouse down event was cleared, there is nothing to do; return.
|
2038
|
-
if (this._mouseDownEvent === null) return YES ;
|
2039
|
-
|
2040
|
-
// Don't do anything unless the user has been dragging for 123msec
|
2041
|
-
if ((Date.now() - this._mouseDownAt) < 123) return YES ;
|
2042
|
-
|
2043
|
-
// OK, they must be serious, decide if a drag will be allowed.
|
2044
|
-
if (this.invokeDelegateMethod(this.delegate, 'collectionViewShouldBeginDrag', this)) {
|
2045
|
-
|
2046
|
-
// First, get the selection to drag. Drag an array of selected
|
2047
|
-
// items appearing in this collection, in the order of the
|
2048
|
-
// collection.
|
2049
|
-
//
|
2050
|
-
// Set this to the dragContent property.
|
2051
|
-
var content = this.get('content') || [] ;
|
2052
|
-
var dragContent;
|
2053
|
-
|
2054
|
-
// if we don't select on mouse down, then the selection has not been
|
2055
|
-
// updated to whatever the user clicked. Instead use
|
2056
|
-
// mouse down content.
|
2057
|
-
if (!this.get("selectOnMouseDown")) {
|
2058
|
-
dragContent = [this._mouseDownContent];
|
2059
|
-
} else {
|
2060
|
-
dragContent = this.get('selection').sort(function(a,b) {
|
2061
|
-
a = content.indexOf(a) ;
|
2062
|
-
b = content.indexOf(b) ;
|
2063
|
-
return (a<b) ? -1 : ((a>b) ? 1 : 0) ;
|
2064
|
-
});
|
2065
|
-
}
|
2066
|
-
|
2067
|
-
this.set('dragContent', dragContent) ;
|
2068
|
-
|
2069
|
-
// Get the set of data types supported by the delegate. If this returns
|
2070
|
-
// a null or empty array and reordering content is not also supported
|
2071
|
-
// then do not start the drag.
|
2072
|
-
if (this.get('dragDataTypes').get('length') > 0) {
|
2073
|
-
// Build the drag view to use for the ghost drag. This
|
2074
|
-
// should essentially contain any visible drag items.
|
2075
|
-
var view = this.ghostViewFor(dragContent) ;
|
2076
|
-
|
2077
|
-
// Initiate the drag
|
2078
|
-
SC.Drag.start({
|
2079
|
-
event: this._mouseDownEvent,
|
2080
|
-
source: this,
|
2081
|
-
dragView: view,
|
2082
|
-
ghost: NO,
|
2083
|
-
slideBack: YES,
|
2084
|
-
dataSource: this
|
2085
|
-
}) ;
|
2086
|
-
|
2087
|
-
// Also use this opportunity to clean up since mouseUp won't
|
2088
|
-
// get called.
|
2089
|
-
this._cleanupMouseDown() ;
|
2090
|
-
this._lastInsertionIndex = null ;
|
2091
|
-
|
2092
|
-
// Drag was not allowed by the delegate, so bail.
|
2093
|
-
} else {
|
2094
|
-
this.set('dragContent', null) ;
|
2095
|
-
}
|
2096
|
-
|
2097
|
-
return YES ;
|
2098
|
-
}
|
2099
|
-
},
|
2100
|
-
|
2101
|
-
/**
|
2102
|
-
Implements the drag data source protocol for the collection view. This
|
2103
|
-
property will consult the collection view delegate if one is provided. It
|
2104
|
-
will also do the right thing if you have set canReorderContent to YES.
|
2105
|
-
|
2106
|
-
@field
|
2107
|
-
@type {Array}
|
2108
|
-
*/
|
2109
|
-
dragDataTypes: function() {
|
2110
|
-
|
2111
|
-
// consult delegate.
|
2112
|
-
var ret = this.invokeDelegateMethod(this.delegate, 'collectionViewDragDataTypes', this) ;
|
2113
|
-
var canReorderContent = this.get('canReorderContent') ;
|
2114
|
-
|
2115
|
-
// bail if ret returned null or empty array and cannot reorder.
|
2116
|
-
if ((!ret || ret.get('length')===0) && !canReorderContent) return [];
|
2117
|
-
|
2118
|
-
// add reorder type if needed.
|
2119
|
-
if (canReorderContent) {
|
2120
|
-
ret = (ret) ? ret.slice() : [] ;
|
2121
|
-
|
2122
|
-
var key = this.get('reorderDataType') ;
|
2123
|
-
if (ret.indexOf(key) < 0) ret.push(key) ;
|
2124
|
-
}
|
2125
|
-
return ret ;
|
2126
|
-
|
2127
|
-
//data: { "_mouseDownContent": dragContent }
|
2128
|
-
|
2129
|
-
}.property(),
|
2130
|
-
|
2131
|
-
/**
|
2132
|
-
Implements the drag data source protocol method. The implementation of
|
2133
|
-
this method will consult the collection view delegate if one has been
|
2134
|
-
provided. It also respects the canReoderContent method.
|
2135
|
-
*/
|
2136
|
-
dragDataForType: function(dataType, drag) {
|
2137
|
-
|
2138
|
-
// if this is a reorder, then return drag content.
|
2139
|
-
if (this.get('canReorderContent')) {
|
2140
|
-
if (dataType === this.get('reorderDataType')) return this.get('dragContent') ;
|
2141
|
-
}
|
2142
|
-
|
2143
|
-
// otherwise, just pass along to the delegate.
|
2144
|
-
return this.invokeDelegateMethod(this.delegate, 'collectionViewDragDataForType', this, dataType, drag) ;
|
2145
|
-
},
|
2146
|
-
|
2147
|
-
/**
|
2148
|
-
Implements the SC.DropTarget interface. The default implementation will
|
2149
|
-
consult the collection view delegate, if you implement those methods.
|
2150
|
-
*/
|
2151
|
-
dragEntered: function(drag, evt) {
|
2152
|
-
|
2153
|
-
// the proposed drag operation is DRAG_REORDER only if we can reorder
|
2154
|
-
// content and the drag contains reorder content.
|
2155
|
-
var op = SC.DRAG_NONE ;
|
2156
|
-
if (this.get('canReorderContent')) {
|
2157
|
-
var types = drag.get('dataTypes') ;
|
2158
|
-
if (types.indexOf(this.get('reorderDataType')) >= 0) {
|
2159
|
-
op = SC.DRAG_REORDER ;
|
2160
|
-
}
|
2161
|
-
}
|
2162
|
-
|
2163
|
-
// Now pass this onto the delegate.
|
2164
|
-
op = this.invokeDelegateMethod(this.delegate, 'collectionViewValidateDrop', this, drag, SC.DROP_ANY, -1, op) ;
|
2165
|
-
|
2166
|
-
if (op === SC.DRAG_REORDER) op = SC.DRAG_MOVE ;
|
2167
|
-
|
2168
|
-
// return
|
2169
|
-
return op ;
|
2170
|
-
},
|
2171
|
-
|
2172
|
-
// Determines the allowed drop operation insertion point, operation type,
|
2173
|
-
// and the drag operation to be performed. Used by dragUpdated() and
|
2174
|
-
// performDragOperation().
|
2175
|
-
_computeDropOperationState: function(drag, evt) {
|
2176
|
-
|
2177
|
-
// get the insertion index for this location. This can be computed
|
2178
|
-
// by a subclass using whatever method. This method is not expected to
|
2179
|
-
// do any data valdidation, just to map the location to an insertion
|
2180
|
-
// index.
|
2181
|
-
var loc = drag.get('location') ;
|
2182
|
-
loc = this.convertFrameFromView(loc, null) ;
|
2183
|
-
var dropOp = SC.DROP_BEFORE ;
|
2184
|
-
var dragOp = SC.DRAG_NONE ;
|
2185
|
-
|
2186
|
-
// STEP 1: Try with a DROP_ON option -- send straight to delegate if
|
2187
|
-
// supported by view.
|
2188
|
-
|
2189
|
-
// get the computed insertion index and possibly drop operation.
|
2190
|
-
// prefer to drop ON.
|
2191
|
-
var idx = this.insertionIndexForLocation(loc, SC.DROP_ON) ;
|
2192
|
-
if ($type(idx) === T_ARRAY) {
|
2193
|
-
dropOp = idx[1] ;
|
2194
|
-
idx = idx[0] ;
|
2195
|
-
}
|
2196
|
-
|
2197
|
-
// if the return drop operation is DROP_ON, then just check it with the
|
2198
|
-
// delegate method. If the delegate method does not support dropping on,
|
2199
|
-
// then it will return DRAG_NONE, in which case we will try again with
|
2200
|
-
// drop before.
|
2201
|
-
if (dropOp === SC.DROP_ON) {
|
2202
|
-
|
2203
|
-
// Now save the insertion index and the dropOp. This may be changed by
|
2204
|
-
// the collection delegate.
|
2205
|
-
this.set('proposedInsertionIndex', idx) ;
|
2206
|
-
this.set('proposedDropOperation', dropOp) ;
|
2207
|
-
dragOp = this.invokeDelegateMethod(this.delegate, 'collectionViewValidateDrop', this, drag, dropOp, idx, dragOp) ;
|
2208
|
-
idx = this.get('proposedInsertionIndex') ;
|
2209
|
-
dropOp = this.get('proposedDropOperation') ;
|
2210
|
-
this._dropInsertionIndex = this._dropOperation = null ;
|
2211
|
-
|
2212
|
-
// The delegate is OK with a drop on also, so just return.
|
2213
|
-
if (dragOp !== SC.DRAG_NONE) {
|
2214
|
-
return [idx, dropOp, dragOp] ;
|
2215
|
-
|
2216
|
-
// The delegate is NOT OK with a drop on, try to get the insertion
|
2217
|
-
// index again, but this time prefer SC.DROP_BEFORE, then let the
|
2218
|
-
// rest of the method run...
|
2219
|
-
} else {
|
2220
|
-
dropOp = SC.DROP_BEFORE ;
|
2221
|
-
idx = this.insertionIndexForLocation(loc, SC.DROP_BEFORE) ;
|
2222
|
-
if ($type(idx) === T_ARRAY) {
|
2223
|
-
dropOp = idx[1] ;
|
2224
|
-
idx = idx[0] ;
|
2225
|
-
}
|
2226
|
-
}
|
2227
|
-
}
|
2228
|
-
|
2229
|
-
// if this is a reorder drag, set the proposed op to SC.DRAG_REORDER and
|
2230
|
-
// validate the insertion point. This only works if the insertion point
|
2231
|
-
// is DROP_BEFORE. DROP_ON is not handled by reordering content.
|
2232
|
-
if ((idx >= 0) && this.get('canReorderContent') && (dropOp === SC.DROP_BEFORE)) {
|
2233
|
-
|
2234
|
-
var objects = drag.dataForType(this.get('reorderDataType')) ;
|
2235
|
-
if (objects) {
|
2236
|
-
var content = this.get('content') || [] ;
|
2237
|
-
|
2238
|
-
// if the insertion index is in between two items in the drag itself,
|
2239
|
-
// then this is not allowed. Either use the last insertion index or
|
2240
|
-
// find the first index that is not in between selections. Stop when
|
2241
|
-
// we get to the beginning.
|
2242
|
-
var previousContent = (idx > 0) ? content.objectAt(idx-1) : null ;
|
2243
|
-
var nextContent = (idx < content.get('length')) ? content.objectAt(idx) : null;
|
2244
|
-
|
2245
|
-
var isPreviousInDrag = (previousContent) ? objects.indexOf(previousContent)>=0 : NO;
|
2246
|
-
var isNextInDrag = (nextContent) ? objects.indexOf(nextContent)>=0 : NO;
|
2247
|
-
|
2248
|
-
if (isPreviousInDrag && isNextInDrag) {
|
2249
|
-
if (this._lastInsertionIndex == null) {
|
2250
|
-
while((idx >= 0) && (objects.indexOf(content.objectAt(idx)) >= 0)) {
|
2251
|
-
idx-- ;
|
2252
|
-
}
|
2253
|
-
} else idx = this._lastInsertionIndex ;
|
2254
|
-
}
|
2255
|
-
|
2256
|
-
// If we found a valid insertion point to reorder at, then set the op
|
2257
|
-
// to custom DRAG_REORDER.
|
2258
|
-
if (idx >= 0) dragOp = SC.DRAG_REORDER ;
|
2259
|
-
}
|
2260
|
-
}
|
2261
|
-
|
2262
|
-
// Now save the insertion index and the dropOp. This may be changed by
|
2263
|
-
// the collection delegate.
|
2264
|
-
this.set('proposedInsertionIndex', idx) ;
|
2265
|
-
this.set('proposedDropOperation', dropOp) ;
|
2266
|
-
dragOp = this.invokeDelegateMethod(this.delegate, 'collectionViewValidateDrop', this, drag, dropOp, idx, dragOp) ;
|
2267
|
-
idx = this.get('proposedInsertionIndex') ;
|
2268
|
-
dropOp = this.get('proposedDropOperation') ;
|
2269
|
-
this._dropInsertionIndex = this._dropOperation = null ;
|
2270
|
-
|
2271
|
-
// return generated state
|
2272
|
-
return [idx, dropOp, dragOp] ;
|
2273
|
-
},
|
2274
|
-
|
2275
|
-
/**
|
2276
|
-
Implements the SC.DropTarget interface. The default implementation will
|
2277
|
-
determine the drop location and then consult the collection view delegate
|
2278
|
-
if you implement those methods. Otherwise it will handle reordering
|
2279
|
-
content on its own.
|
2280
|
-
*/
|
2281
|
-
dragUpdated: function(drag, evt) {
|
2282
|
-
|
2283
|
-
var state = this._computeDropOperationState(drag, evt) ;
|
2284
|
-
var idx = state[0], dropOp = state[1], dragOp = state[2] ;
|
2285
|
-
|
2286
|
-
// if the insertion index or dropOp have changed, update the insertion
|
2287
|
-
// point
|
2288
|
-
if (dragOp !== SC.DRAG_NONE) {
|
2289
|
-
if ((this._lastInsertionIndex !== idx) || (this._lastDropOperation !== dropOp)) {
|
2290
|
-
var itemView = this.itemViewForContent(this.get('content').objectAt(idx));
|
2291
|
-
this.showInsertionPoint(itemView, dropOp) ;
|
2292
|
-
}
|
2293
|
-
|
2294
|
-
this._lastInsertionIndex = idx ;
|
2295
|
-
this._lastDropOperation = dropOp ;
|
2296
|
-
|
2297
|
-
} else {
|
2298
|
-
this.hideInsertionPoint() ;
|
2299
|
-
this._lastInsertionIndex = this._lastDropOperation = null ;
|
2300
|
-
}
|
2301
|
-
|
2302
|
-
// Normalize drag operation to the standard kinds accepted by the drag
|
2303
|
-
// system.
|
2304
|
-
return (dragOp === SC.DRAG_REORDER) ? SC.DRAG_MOVE : dragOp;
|
2305
|
-
},
|
2306
|
-
|
2307
|
-
/**
|
2308
|
-
Implements the SC.DropTarget protocol. Hides any visible insertion
|
2309
|
-
point and clears some cached values.
|
2310
|
-
*/
|
2311
|
-
dragExited: function() {
|
2312
|
-
this.hideInsertionPoint() ;
|
2313
|
-
this._lastInsertionIndex = this._lastDropOperation = null ;
|
2314
|
-
},
|
2315
|
-
|
2316
|
-
/**
|
2317
|
-
Implements the SC.DropTarget protocol. Hides any visible insertion
|
2318
|
-
point and clears some cached values.
|
2319
|
-
*/
|
2320
|
-
dragEnded: function() {
|
2321
|
-
this.hideInsertionPoint() ;
|
2322
|
-
this._lastInsertionIndex = this._lastDropOperation = null ;
|
2323
|
-
},
|
2324
|
-
|
2325
|
-
/**
|
2326
|
-
Implements the SC.DropTarget protocol.
|
2327
|
-
*/
|
2328
|
-
prepareForDragOperation: function(op, drag) { return YES; },
|
2329
|
-
|
2330
|
-
/**
|
2331
|
-
Implements the SC.DropTarget protocol. Consults the collection view
|
2332
|
-
delegate to actually perform the operation unless the operation is
|
2333
|
-
reordering content.
|
2334
|
-
*/
|
2335
|
-
performDragOperation: function(op, drag) {
|
2336
|
-
|
2337
|
-
// Get the correct insertion point, drop operation, etc.
|
2338
|
-
var state = this._computeDropOperationState(drag, null, op) ;
|
2339
|
-
var idx = state[0], dropOp = state[1], dragOp = state[2] ;
|
2340
|
-
|
2341
|
-
// The dragOp is the kinds of ops allowed. The drag operation must
|
2342
|
-
// be included in that set.
|
2343
|
-
if (dragOp === SC.DRAG_REORDER) {
|
2344
|
-
op = (op & SC.DRAG_MOVE) ? SC.DRAG_REORDER : SC.DRAG_NONE ;
|
2345
|
-
} else {
|
2346
|
-
op = op & dragOp ;
|
2347
|
-
}
|
2348
|
-
|
2349
|
-
// If no allowed drag operation could be found, just return.
|
2350
|
-
if (op === SC.DRAG_NONE) return op;
|
2351
|
-
|
2352
|
-
// Some operation is allowed through, give the delegate a chance to
|
2353
|
-
// handle it.
|
2354
|
-
var performed = this.invokeDelegateMethod(this.delegate, 'collectionViewAcceptDrop', this, drag, dropOp, idx, op) ;
|
2355
|
-
|
2356
|
-
// If the delegate did not handle the drag (i.e. returned SC.DRAG_NONE),
|
2357
|
-
// and the op type is REORDER, then do the reorder here.
|
2358
|
-
if ((performed === SC.DRAG_NONE) && (op === SC.DRAG_REORDER)) {
|
2359
|
-
var objects = drag.dataForType(this.get('reorderDataType')) ;
|
2360
|
-
if (!objects) return SC.DRAG_NONE ;
|
2361
|
-
|
2362
|
-
var content = this.get('content') ;
|
2363
|
-
content.beginPropertyChanges(); // suspend notifications
|
2364
|
-
|
2365
|
-
// find the old index and remove it.
|
2366
|
-
var objectsIdx = objects.get('length') ;
|
2367
|
-
while(--objectsIdx >= 0) {
|
2368
|
-
var obj = objects.objectAt(objectsIdx) ;
|
2369
|
-
var old = content.indexOf(obj) ;
|
2370
|
-
if (old >= 0) content.removeAt(old) ;
|
2371
|
-
if ((old >= 0) && (old < idx)) idx--; //adjust idx
|
2372
|
-
}
|
2373
|
-
|
2374
|
-
// now insert objects at new location
|
2375
|
-
content.replace(idx, 0, objects) ;
|
2376
|
-
content.endPropertyChanges(); // restart notifications
|
2377
|
-
|
2378
|
-
// make the op into its actual value
|
2379
|
-
op = SC.DRAG_MOVE ;
|
2380
|
-
}
|
2381
|
-
|
2382
|
-
return op;
|
2383
|
-
},
|
2384
|
-
|
2385
|
-
/**
|
2386
|
-
Default delegate method implementation, returns YES if canReorderContent
|
2387
|
-
is also true.
|
2388
|
-
*/
|
2389
|
-
collectionViewShouldBeginDrag: function(view) {
|
2390
|
-
return this.get('canReorderContent') ;
|
2391
|
-
},
|
2392
|
-
|
2393
|
-
concludeDragOperation: function(op, drag) {
|
2394
|
-
this.hideInsertionPoint() ;
|
2395
|
-
this._lastInsertionIndex = null ;
|
2396
|
-
},
|
2397
|
-
|
2398
|
-
/**
|
2399
|
-
The insertion orientation. This is used to determine which
|
2400
|
-
dimension we should pay attention to when determining insertion point for
|
2401
|
-
a mouse click.
|
2402
|
-
|
2403
|
-
{{{
|
2404
|
-
SC.HORIZONTAL_ORIENTATION: look at the X dimension only
|
2405
|
-
SC.VERTICAL_ORIENTATION: look at the Y dimension only
|
2406
|
-
}}}
|
2407
|
-
*/
|
2408
|
-
insertionOrientation: SC.HORIZONTAL_ORIENTATION,
|
2409
|
-
|
2410
|
-
/**
|
2411
|
-
Get the preferred insertion point for the given location, including
|
2412
|
-
an insertion preference of before or after the named index.
|
2413
|
-
|
2414
|
-
You can implement this method in a subclass if you like to perform a
|
2415
|
-
more efficient check. The default implementation will loop through the
|
2416
|
-
item views looking for the first view to "switch sides" in the orientation
|
2417
|
-
you specify.
|
2418
|
-
|
2419
|
-
This method should return an array with two values. The first value is
|
2420
|
-
the insertion point index and the second value is the drop operation,
|
2421
|
-
which should be one of SC.DROP_BEFORE or SC.DROP_ON.
|
2422
|
-
|
2423
|
-
The preferred drop operation passed in should be used as a hint as to
|
2424
|
-
the type of operation the drag and drop could would prefer to receive.
|
2425
|
-
If the dropOperaiton is SC.DROP_ON, then you should return a DROP_ON
|
2426
|
-
mode if possible. Otherwise, you should never return DROP_ON.
|
2427
|
-
|
2428
|
-
For compatibility, you can also return just the insertion index. If you
|
2429
|
-
do this, then the collction view will assume the drop operation is
|
2430
|
-
SC.DROP_BEFORE.
|
2431
|
-
|
2432
|
-
If an insertion is NOT allowed, you should return -1 as the insertion
|
2433
|
-
point. In this case, the drop operation will be ignored.
|
2434
|
-
|
2435
|
-
@param loc {Point} the mouse location.
|
2436
|
-
@param dropOperation {DropOp} the preferred drop operation.
|
2437
|
-
@returns {Array} [proposed drop index, drop operation]
|
2438
|
-
*/
|
2439
|
-
insertionIndexForLocation: function(loc, dropOperation) {
|
2440
|
-
var content = this.get('content') ;
|
2441
|
-
var f, itemView, curSide, lastSide = null ;
|
2442
|
-
var orient = this.get('insertionOrientation') ;
|
2443
|
-
var ret= null ;
|
2444
|
-
for(var idx=0; ((ret == null) && (idx<content.length)); idx++) {
|
2445
|
-
itemView = this.itemViewForContent(content.objectAt(idx));
|
2446
|
-
f = this.convertFrameFromView(itemView.get('frame'), itemView) ;
|
2447
|
-
|
2448
|
-
// if we are a horizontal orientation, look for the first item that
|
2449
|
-
// will "switch sides" on the x path an the maxY is greater than Y.
|
2450
|
-
// This assumes you will flow top to bottom, but it should work if you
|
2451
|
-
// flow LTR or RTL.
|
2452
|
-
if (orient == SC.HORIZONTAL_ORIENTATION) {
|
2453
|
-
if (SC.maxY(f) > loc.y) {
|
2454
|
-
curSide = (SC.maxX(f) < loc.x) ? -1 : 1 ;
|
2455
|
-
} else curSide = null ;
|
2456
|
-
|
2457
|
-
// if we are a vertical orientation, look for the first item that
|
2458
|
-
// will "swithc sides" on the y path and the maxX is greater than X.
|
2459
|
-
// This assumes you will flow LTR, but it should work if you flow
|
2460
|
-
// bottom to top or top to bottom.
|
2461
|
-
} else {
|
2462
|
-
if (SC.minX(f) < loc.x) {
|
2463
|
-
curSide = (SC.maxY(f) < loc.y) ? -1 : 1 ;
|
2464
|
-
} else curSide = null ;
|
2465
|
-
}
|
2466
|
-
|
2467
|
-
// if we "switched" sides then return this item view.
|
2468
|
-
if (curSide !== null) {
|
2469
|
-
|
2470
|
-
// OK, we found an item view, while we have this data, decide if
|
2471
|
-
// we should insert before or after the view
|
2472
|
-
if ((lastSide !== null) && (curSide != lastSide)) {
|
2473
|
-
ret = idx ;
|
2474
|
-
if (orient == SC.HORIZONTAL_ORIENTATION) {
|
2475
|
-
if (SC.midX(f) < loc.x) ret++ ;
|
2476
|
-
} else {
|
2477
|
-
if (SC.midY(f) < loc.y) ret++ ;
|
2478
|
-
}
|
2479
|
-
}
|
2480
|
-
lastSide =curSide ;
|
2481
|
-
}
|
2482
|
-
}
|
2483
|
-
|
2484
|
-
// Handle some edge cases
|
2485
|
-
if ((ret == null) || (ret < 0)) ret = 0 ;
|
2486
|
-
if (ret > content.length) ret = content.length ;
|
2487
|
-
|
2488
|
-
// Done. Phew. Return.
|
2489
|
-
return ret;
|
2490
|
-
},
|
2491
|
-
|
2492
|
-
/**
|
2493
|
-
Override to show the insertion point during a drag.
|
2494
|
-
|
2495
|
-
Called during a drag to show the insertion point. Passed value is the
|
2496
|
-
item view that you should display the insertion point before. If the
|
2497
|
-
passed value is null, then you should show the insertion point AFTER that
|
2498
|
-
last item view returned by the itemViews property.
|
2499
|
-
|
2500
|
-
Once this method is called, you are guaranteed to also recieve a call to
|
2501
|
-
hideInsertionPoint() at some point in the future.
|
2502
|
-
|
2503
|
-
The default implementation of this method does nothing.
|
2504
|
-
|
2505
|
-
@param itemView {SC.View} view the insertion point should appear directly before. If null, show insertion point at end.
|
2506
|
-
@param dropOperation {Number} the drop operation. will be SC.DROP_BEFORE or SC.DROP_ON
|
2507
|
-
|
2508
|
-
@returns {void}
|
2509
|
-
*/
|
2510
|
-
showInsertionPoint: function(itemView, dropOperation) {
|
2511
|
-
return (dropOperation === SC.DROP_BEFORE) ? this.showInsertionPointBefore(itemView) : this.hideInsertionPoint() ;
|
2512
|
-
},
|
2513
|
-
|
2514
|
-
/**
|
2515
|
-
@deprecated
|
2516
|
-
|
2517
|
-
Show the insertion point during a drag before the named item view.
|
2518
|
-
|
2519
|
-
This method has been deprecated in favor of the more generic
|
2520
|
-
showInsertionPoint() which can be used to show drops occurring both on
|
2521
|
-
and before an itemView. If you do not implement showInsertionPoint()
|
2522
|
-
yourself, the default implementation will call this method whenever the
|
2523
|
-
drop operation is SC.DROP_BEFORE.
|
2524
|
-
|
2525
|
-
@param itemView {SC.View} the item view to show before.
|
2526
|
-
@returns {void}
|
2527
|
-
*/
|
2528
|
-
showInsertionPointBefore: function(itemView) {},
|
2529
|
-
|
2530
|
-
/**
|
2531
|
-
Override to hide the insertion point when a drag ends.
|
2532
|
-
|
2533
|
-
Called during a drag to hide the insertion point. This will be called
|
2534
|
-
when the user exits the view, cancels the drag or completes the drag. It
|
2535
|
-
will not be called when the insertion point changes during a drag.
|
2536
|
-
|
2537
|
-
You should expect to receive one or more calls to
|
2538
|
-
showInsertionPointBefore() during a drag followed by at least one call to
|
2539
|
-
this method at the end. Your method should not raise an error if it is
|
2540
|
-
called more than once.
|
2541
|
-
|
2542
|
-
@returns {void}
|
2543
|
-
*/
|
2544
|
-
hideInsertionPoint: function() {},
|
2545
|
-
|
2546
|
-
/**
|
2547
|
-
Override this method to provide your own ghost image for a drag.
|
2548
|
-
|
2549
|
-
Note that the only purpose of this view is to render a visible drag
|
2550
|
-
element. It is not critical that you make this element bindable, etc.
|
2551
|
-
|
2552
|
-
@param dragContent {Array} Array of content objects that will be used in
|
2553
|
-
the drag.
|
2554
|
-
*/
|
2555
|
-
ghostViewFor: function(dragContent) {
|
2556
|
-
var view = SC.View.create() ;
|
2557
|
-
view.setStyle({ position: 'absolute', overflow: 'hidden' });
|
2558
|
-
|
2559
|
-
var viewFrame = this.convertFrameToView(this.get('frame'), null) ;
|
2560
|
-
view.set('frame', viewFrame) ;
|
2561
|
-
|
2562
|
-
var idx = dragContent.length ;
|
2563
|
-
var maxX = 0; var maxY = 0 ; var minX =100000; var minY = 100000 ;
|
2564
|
-
|
2565
|
-
while(--idx >= 0) {
|
2566
|
-
var itemView = this.itemViewForContent(dragContent[idx]) ;
|
2567
|
-
if (!itemView) continue ;
|
2568
|
-
|
2569
|
-
var f = itemView.get('frame') ;
|
2570
|
-
f = this.convertFrameFromView(f, itemView) ;
|
2571
|
-
|
2572
|
-
var dom = itemView.rootElement ;
|
2573
|
-
if (!dom) continue ;
|
2574
|
-
|
2575
|
-
// save the maxX & maxY. This will be used to trim the size
|
2576
|
-
// of the ghost view later.
|
2577
|
-
if (SC.maxX(f) > maxX) maxX = SC.maxX(f) ;
|
2578
|
-
if (SC.maxY(f) > maxY) maxY = SC.maxY(f) ;
|
2579
|
-
if (SC.minX(f) < minX) minX = SC.minX(f) ;
|
2580
|
-
if (SC.minY(f) < minY) minY = SC.minY(f) ;
|
2581
|
-
|
2582
|
-
// Clone the contents of this node. We should probably apply the
|
2583
|
-
// computed style to the cloned nodes in order to make sure they match
|
2584
|
-
// even if the CSS styles do not match. Make sure the items are
|
2585
|
-
// properly positioned.
|
2586
|
-
dom = dom.cloneNode(true) ;
|
2587
|
-
|
2588
|
-
Element.setStyle(dom, { position: "absolute", left: "%@px".fmt(f.x), top: "%@px".fmt(f.y), width: "%@px".fmt(f.width), height: "%@px".fmt(f.height) }) ;
|
2589
|
-
view.rootElement.appendChild(dom) ;
|
2590
|
-
}
|
2591
|
-
|
2592
|
-
// Now we have a view, create another view that will wrap the other view
|
2593
|
-
// and position it inside.
|
2594
|
-
var wrapper = SC.View.create() ;
|
2595
|
-
wrapper.setStyle({ position: 'absolute', overflow: 'hidden' }) ;
|
2596
|
-
wrapper.set('frame', {
|
2597
|
-
x: viewFrame.x+minX, y: viewFrame.y+minY,
|
2598
|
-
width: (maxX-minX+1), height: (maxY-minY+1)
|
2599
|
-
}) ;
|
2600
|
-
wrapper.appendChild(view) ;
|
2601
|
-
view.set('frame', { x: 0-minX, y: 0-minY }) ;
|
2602
|
-
return wrapper ;
|
2603
|
-
},
|
2604
|
-
|
2605
|
-
// ......................................
|
2606
|
-
// INTERNAL
|
2607
|
-
//
|
2608
|
-
|
2609
|
-
init: function() {
|
2610
|
-
|
2611
|
-
// Initialize internal hashes and arrays. Normally the best approach to this
|
2612
|
-
// is to initialize a property only when it is used. However, these properties
|
2613
|
-
// are critical to layout and therefore will always be needed so it is faster
|
2614
|
-
// to do it once here.
|
2615
|
-
this._itemViewsByContent= {};
|
2616
|
-
this._groupViewsByValue= {};
|
2617
|
-
this._groupViewCounts= {};
|
2618
|
-
this._zombieGroupViews= {};
|
2619
|
-
this._itemViewsByGuid = {} ;
|
2620
|
-
|
2621
|
-
this._itemViewPool= [];
|
2622
|
-
this._groupViewPool= [];
|
2623
|
-
|
2624
|
-
sc_super() ;
|
2625
|
-
this._dropTargetObserver();
|
2626
|
-
},
|
2627
|
-
|
2628
|
-
// Perform the action. Supports legacy behavior as well as newer style
|
2629
|
-
// action dispatch.
|
2630
|
-
_action: function(view, evt) {
|
2631
|
-
|
2632
|
-
var action = this.get('action');
|
2633
|
-
var target = this.get('target') || null;
|
2634
|
-
if (action) {
|
2635
|
-
// if the action is a function, just call it
|
2636
|
-
if ($type(action) == T_FUNCTION) return this.action(view, evt) ;
|
2637
|
-
|
2638
|
-
// otherwise, use the new sendAction style
|
2639
|
-
SC.app.sendAction(action, target, this) ;
|
2640
|
-
|
2641
|
-
// if no action is specified, then trigger the support action,
|
2642
|
-
// if supported.
|
2643
|
-
} else if (!view) {
|
2644
|
-
return ; // nothing to do
|
2645
|
-
|
2646
|
-
// if the target view has its own internal action handler,
|
2647
|
-
// trigger that.
|
2648
|
-
} else if ($type(view._action) == T_FUNCTION) {
|
2649
|
-
return view._action(evt) ;
|
2650
|
-
|
2651
|
-
// otherwise call the action method to support older styles.
|
2652
|
-
} else if ($type(view.action) == T_FUNCTION) {
|
2653
|
-
return view.action(evt) ;
|
2654
|
-
}
|
2655
|
-
},
|
2656
|
-
|
2657
|
-
/** Add/remove from drop targets as needed. */
|
2658
|
-
_dropTargetObserver: function() {
|
2659
|
-
var canDrop = this.get('canReorderContent') || this.get('isDropTarget') ;
|
2660
|
-
if (canDrop) {
|
2661
|
-
SC.Drag.addDropTarget(this) ;
|
2662
|
-
} else {
|
2663
|
-
SC.Drag.removeDropTarget(this) ;
|
2664
|
-
}
|
2665
|
-
}.observes('canReorderContent', 'isDropTarget'),
|
2666
|
-
|
2667
|
-
/** @private
|
2668
|
-
Whenever content changes, update children and also start observing
|
2669
|
-
new [] property.
|
2670
|
-
*/
|
2671
|
-
_contentObserver: function() {
|
2672
|
-
var content = this.get('content') ;
|
2673
|
-
if (SC.isEqual(content, this._content)) return ; // nothing to do
|
2674
|
-
|
2675
|
-
if (!this._boundContentPropertyObserver) {
|
2676
|
-
this._boundContentPropertyObserver = this._contentPropertyObserver.bind(this) ;
|
2677
|
-
}
|
2678
|
-
var func = this._boundContentPropertyObserver ;
|
2679
|
-
|
2680
|
-
// remove old observer, add new observer, and trigger content property change
|
2681
|
-
if (this._content) this._content.removeObserver('[]', func) ;
|
2682
|
-
if (content) content.addObserver('[]', func) ;
|
2683
|
-
this._content = content; //cache
|
2684
|
-
this._contentPropertyRevision = null ;
|
2685
|
-
|
2686
|
-
var rev = (content) ? content.propertyRevision : -1 ;
|
2687
|
-
this._contentPropertyObserver(this, '[]', content, rev) ;
|
2688
|
-
}.observes('content'),
|
2689
|
-
|
2690
|
-
/** @private
|
2691
|
-
Whenever the selection changes, update the itemViews.
|
2692
|
-
*/
|
2693
|
-
_selectionObserver: function() {
|
2694
|
-
var sel = this.get('selection') ;
|
2695
|
-
if (SC.isEqual(sel, this._selection)) return ; // nothing to do
|
2696
|
-
|
2697
|
-
if (!this._boundSelectionPropertyObserver) {
|
2698
|
-
this._boundSelectionPropertyObserver = this._selectionPropertyObserver.bind(this) ;
|
2699
|
-
}
|
2700
|
-
var func = this._boundSelectionPropertyObserver ;
|
2701
|
-
|
2702
|
-
if (this._selection) this._selection.removeObserver('[]', func) ;
|
2703
|
-
if (sel) sel.addObserver('[]', func) ;
|
2704
|
-
this._selection = sel ;
|
2705
|
-
this._selectionPropertyRevision = null ;
|
2706
|
-
var propertyRevision = (sel) ? sel.propertyRevision : null;
|
2707
|
-
this._selectionPropertyObserver(this, '[]', sel, propertyRevision) ;
|
2708
|
-
}.observes('selection'),
|
2709
|
-
|
2710
|
-
// called on content change *and* content.[] change...
|
2711
|
-
// update children if this is a new propertyRevision
|
2712
|
-
//
|
2713
|
-
// UPDATE:
|
2714
|
-
// -- recheck all item views, add/remove children as needed
|
2715
|
-
// -- update layout on all item views.
|
2716
|
-
// -- optional: determine the first item view that does not match.
|
2717
|
-
//
|
2718
|
-
_contentPropertyObserver: function(target, key, value, rev) {
|
2719
|
-
if (!this._updatingContent && (!rev || (rev != this._contentPropertyRevision))) {
|
2720
|
-
this._contentPropertyRevision = rev ;
|
2721
|
-
this._updatingContent = true ;
|
2722
|
-
this._hasChildren = false ;
|
2723
|
-
this.updateChildren(true) ;
|
2724
|
-
this._updatingContent = false ;
|
2725
|
-
}
|
2726
|
-
},
|
2727
|
-
|
2728
|
-
// called on selection change and selection.[] change...
|
2729
|
-
// update selection states if this is a new propertyRevision
|
2730
|
-
_selectionPropertyObserver: function(target, key, value, rev) {
|
2731
|
-
if (!this._updatingSel && (!rev || (rev != this._selectionPropertyRevision))) {
|
2732
|
-
this._selectionPropertyRevision = rev ;
|
2733
|
-
this._updatingSel = true ;
|
2734
|
-
this._selectionHash = null ; // flush cache
|
2735
|
-
this.updateSelectionStates() ;
|
2736
|
-
this._updatingSel = false ;
|
2737
|
-
}
|
2738
|
-
},
|
2739
|
-
|
2740
|
-
// If isVisibleInWindow status changes, updateChildren if we are dirty.
|
2741
|
-
_isVisibleInWindowObserver: function() {
|
2742
|
-
if (this.get('isDirty')) this.updateChildren() ;
|
2743
|
-
}.observes('isVisibleInWindow'),
|
2744
|
-
|
2745
|
-
// ======================================================================
|
2746
|
-
// DEPRECATED APIS (Still available for compatibility)
|
2747
|
-
|
2748
|
-
/** @private
|
2749
|
-
If set to false, this method will prevent you from deselecting all of
|
2750
|
-
the items in your view. This is better implemented using a controller
|
2751
|
-
that prohibits empty selection.
|
2752
|
-
*/
|
2753
|
-
allowDeselectAll: true,
|
2754
|
-
|
2755
|
-
/** @private */
|
2756
|
-
itemExistsInCollection: function( view ) { return this.hasItemView(view); },
|
2757
|
-
|
2758
|
-
/** @private */
|
2759
|
-
viewForContentRecord: function(rec) { return this.itemViewForContent(rec); }
|
2760
|
-
|
2761
|
-
|
2762
|
-
}) ;
|
2763
|
-
|
2764
|
-
|