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,2301 +0,0 @@
|
|
1
|
-
// ========================================================================
|
2
|
-
// SproutCore
|
3
|
-
// copyright 2006-2008 Sprout Systems, Inc.
|
4
|
-
// ========================================================================
|
5
|
-
|
6
|
-
require('foundation/object') ;
|
7
|
-
require('foundation/responder') ;
|
8
|
-
require('foundation/node_descriptor') ;
|
9
|
-
require('foundation/binding');
|
10
|
-
require('foundation/path_module');
|
11
|
-
|
12
|
-
require('mixins/delegate_support') ;
|
13
|
-
|
14
|
-
SC.BENCHMARK_OUTLETS = NO ;
|
15
|
-
SC.BENCHMARK_CONFIGURE_OUTLETS = NO ;
|
16
|
-
|
17
|
-
/**
|
18
|
-
@class
|
19
|
-
|
20
|
-
A view is the root class you use to manage the web page DOM in your
|
21
|
-
application. You can use views to render visible content on your page,
|
22
|
-
provide animations, and to capture and respond to events.
|
23
|
-
|
24
|
-
You can use SC.View directly to manage DOM elements or you can extend one
|
25
|
-
of the many subclasses provided by SproutCore. This documentation describes
|
26
|
-
the general concepts you need to understand when working with views, though
|
27
|
-
most often you will want to work with one of the subclasses instead.
|
28
|
-
|
29
|
-
h2. Working with DOM Elements
|
30
|
-
|
31
|
-
h2. Handling Events
|
32
|
-
|
33
|
-
@extends SC.Responder
|
34
|
-
@extends SC.PathModule
|
35
|
-
@extends SC.DelegateSupport
|
36
|
-
@since SproutCore 1.0
|
37
|
-
*/
|
38
|
-
SC.View = SC.Responder.extend(SC.PathModule, SC.DelegateSupport,
|
39
|
-
/** @scope SC.View.prototype */ {
|
40
|
-
|
41
|
-
// ..........................................
|
42
|
-
// VIEW API
|
43
|
-
//
|
44
|
-
// The methods in this section are used to manage actual views. You can
|
45
|
-
// basically interact with child elements in two ways. One using an API
|
46
|
-
// similar to the DOM API. Alternatively, you can treat the view like an
|
47
|
-
// array and use standard iterators.
|
48
|
-
//
|
49
|
-
|
50
|
-
/**
|
51
|
-
Insert the view into the the receiver's childNodes array.
|
52
|
-
|
53
|
-
The view will be added to the childNodes array before the beforeView. If
|
54
|
-
beforeView is null, then the view will be added to the end of the array.
|
55
|
-
This will also add the view's rootElement DOM node to the receivers
|
56
|
-
containerElement DOM node as a child.
|
57
|
-
|
58
|
-
If the specified view already belongs to another parent, it will be
|
59
|
-
removed from that view first.
|
60
|
-
|
61
|
-
@param view {SC.View} the view to insert as a child node.
|
62
|
-
@param beforeView {SC.View} view to insert before, or null to insert at
|
63
|
-
end
|
64
|
-
@returns {SC.View} the receiver
|
65
|
-
*/
|
66
|
-
insertBefore: function(view, beforeView) {
|
67
|
-
this._insertBefore(view,beforeView,true);
|
68
|
-
},
|
69
|
-
|
70
|
-
/** @private */
|
71
|
-
_insertBefore: function(view, beforeView, updateDom) {
|
72
|
-
// verify that beforeView is a child.
|
73
|
-
if (beforeView) {
|
74
|
-
if (beforeView.parentNode != this) throw "insertBefore() beforeView must belong to the receiver" ;
|
75
|
-
if (beforeView == view) throw "insertBefore() views cannot be the same";
|
76
|
-
}
|
77
|
-
|
78
|
-
if (view.parentNode) view.removeFromParent() ;
|
79
|
-
this.willAddChild(this, beforeView) ;
|
80
|
-
view.willAddToParent(this, beforeView) ;
|
81
|
-
|
82
|
-
// patch in the view.
|
83
|
-
if (beforeView) {
|
84
|
-
view.set('previousSibling', beforeView.previousSibling) ;
|
85
|
-
view.set('nextSibling', beforeView) ;
|
86
|
-
beforeView.set('previousSibling', view) ;
|
87
|
-
} else {
|
88
|
-
view.set('previousSibling', this.lastChild) ;
|
89
|
-
view.set('nextSibling', null) ;
|
90
|
-
this.set('lastChild', view) ;
|
91
|
-
}
|
92
|
-
|
93
|
-
if (view.previousSibling) view.previousSibling.set('nextSibling',view);
|
94
|
-
if (view.previousSibling == null) this.set('firstChild',view) ;
|
95
|
-
view.set('parentNode', this) ;
|
96
|
-
|
97
|
-
// Update DOM. -- ANIMATE
|
98
|
-
// Note that this code is not called when outlets are first configured.
|
99
|
-
// The assumption is that the created view already belongs to the
|
100
|
-
// document somwhere.
|
101
|
-
if (updateDom) {
|
102
|
-
var beforeElement = (beforeView) ? beforeView.rootElement : null;
|
103
|
-
|
104
|
-
(this.containerElement || this.rootElement).insertBefore(view.rootElement,beforeElement);
|
105
|
-
|
106
|
-
// regenerate the childNodes array.
|
107
|
-
this._rebuildChildNodes();
|
108
|
-
}
|
109
|
-
|
110
|
-
// update cached states.
|
111
|
-
view._updateIsVisibleInWindow() ;
|
112
|
-
view._flushInternalCaches() ;
|
113
|
-
view._invalidateClippingFrame() ;
|
114
|
-
|
115
|
-
// call notices.
|
116
|
-
view.didAddToParent(this, beforeView) ;
|
117
|
-
this.didAddChild(view, beforeView) ;
|
118
|
-
try{
|
119
|
-
return this ;
|
120
|
-
}finally{
|
121
|
-
if(beforeElement)
|
122
|
-
beforeElement=null;
|
123
|
-
}
|
124
|
-
},
|
125
|
-
|
126
|
-
/**
|
127
|
-
Remove the view from the receiver's childNodes array.
|
128
|
-
|
129
|
-
This will also remove the view's DOM element from the recievers DOM.
|
130
|
-
|
131
|
-
@param view {SC.View} the view to remove
|
132
|
-
@returns {SC.View} the receiver
|
133
|
-
*/
|
134
|
-
removeChild: function(view) {
|
135
|
-
if (!view) return ;
|
136
|
-
if (view.parentNode != this) throw "removeChild: view must belong to parent";
|
137
|
-
|
138
|
-
view.willRemoveFromParent() ;
|
139
|
-
this.willRemoveChild(view) ;
|
140
|
-
|
141
|
-
// unpatch.
|
142
|
-
if (view.previousSibling) {
|
143
|
-
view.previousSibling.set('nextSibling', view.nextSibling);
|
144
|
-
} else this.set('firstChild', view.nextSibling) ;
|
145
|
-
|
146
|
-
if (view.nextSibling) {
|
147
|
-
view.nextSibling.set('previousSibling', view.previousSibling) ;
|
148
|
-
} else this.set('lastChild', view.previousSibling) ;
|
149
|
-
|
150
|
-
// Update DOM -- ANIMATE
|
151
|
-
var el = (this.containerElement || this.rootElement);
|
152
|
-
if (el && (view.rootElement.parentNode == el) && (el != document)) {
|
153
|
-
el.removeChild(view.rootElement);
|
154
|
-
}
|
155
|
-
|
156
|
-
// regenerate the childNodes array.
|
157
|
-
this._rebuildChildNodes();
|
158
|
-
|
159
|
-
view.set('nextSibling', null);
|
160
|
-
view.set('previousSibling', null);
|
161
|
-
view.set('parentNode', null) ;
|
162
|
-
|
163
|
-
// update parent state.
|
164
|
-
view._updateIsVisibleInWindow() ;
|
165
|
-
view._flushInternalCaches();
|
166
|
-
view._invalidateClippingFrame() ;
|
167
|
-
|
168
|
-
view.didRemoveFromParent(this) ;
|
169
|
-
this.didRemoveChild(view);
|
170
|
-
try{
|
171
|
-
return this;
|
172
|
-
}finally{
|
173
|
-
el=null;
|
174
|
-
}
|
175
|
-
},
|
176
|
-
|
177
|
-
/**
|
178
|
-
Replace the oldView with the specified view in the receivers childNodes
|
179
|
-
array. This will also replace the DOM node of the oldView with the DOM
|
180
|
-
node of the new view in the receivers DOM.
|
181
|
-
|
182
|
-
If the specified view already belongs to another parent, it will be
|
183
|
-
removed from that view first.
|
184
|
-
|
185
|
-
@param view {SC.View} the view to insert in the DOM
|
186
|
-
@param view {SC.View} the view to remove from the DOM.
|
187
|
-
@returns {SC.View} the receiver
|
188
|
-
*/
|
189
|
-
replaceChild: function(view, oldView) {
|
190
|
-
this.insertBefore(view,oldView) ; this.removeChild(oldView) ;
|
191
|
-
return this;
|
192
|
-
},
|
193
|
-
|
194
|
-
/**
|
195
|
-
Removes the receiver from its parentNode. If the receiver does not belong
|
196
|
-
to a parentNode, this method does nothing.
|
197
|
-
|
198
|
-
@returns {null}
|
199
|
-
*/
|
200
|
-
removeFromParent: function() {
|
201
|
-
if (this.parentNode) this.parentNode.removeChild(this) ;
|
202
|
-
return null ;
|
203
|
-
},
|
204
|
-
|
205
|
-
/**
|
206
|
-
Works just like removeFromParent but also removes the view from internal
|
207
|
-
caches and sets the rootElement to null so that the view and its DOM can
|
208
|
-
be garbage collected.
|
209
|
-
|
210
|
-
SproutCore includes special gaurds that ensure views and their related
|
211
|
-
DOM elements will be garbage collected whenever your web page unloads.
|
212
|
-
However, if you create and destroy views frequently while your application
|
213
|
-
is running, you should call this method when views are no longer needed
|
214
|
-
to ensure they will be garbage collected even while your application is
|
215
|
-
still running.
|
216
|
-
|
217
|
-
@returns {null}
|
218
|
-
*/
|
219
|
-
destroy: function() {
|
220
|
-
this.removeFromParent() ;
|
221
|
-
delete SC.View._view[SC.guidFor(this)];
|
222
|
-
return null ;
|
223
|
-
},
|
224
|
-
|
225
|
-
/**
|
226
|
-
Appends the specified view to the end of the receivers childNodes array.
|
227
|
-
This is equivalent to calling insertBefore(view, null);
|
228
|
-
|
229
|
-
@param view {SC.View} the view to insert
|
230
|
-
@returns {SC.View} the receiver
|
231
|
-
*/
|
232
|
-
appendChild: function(view) {
|
233
|
-
this.insertBefore(view,null) ;
|
234
|
-
return this ;
|
235
|
-
},
|
236
|
-
|
237
|
-
/**
|
238
|
-
The array of views that are direct children of the receiver view. The DOM
|
239
|
-
elements managed by the views are also directl children of the
|
240
|
-
containerElement for the receiver.
|
241
|
-
|
242
|
-
@field
|
243
|
-
@type Array
|
244
|
-
*/
|
245
|
-
childNodes: [],
|
246
|
-
|
247
|
-
/**
|
248
|
-
The first child view in the childNodes array. If the view does not have
|
249
|
-
any children, this property will be null.
|
250
|
-
|
251
|
-
@field
|
252
|
-
@type SC.View
|
253
|
-
*/
|
254
|
-
firstChild: null,
|
255
|
-
|
256
|
-
/**
|
257
|
-
The last child view in the childNodes array. If the view does not have any children,
|
258
|
-
this property will be null.
|
259
|
-
|
260
|
-
@field
|
261
|
-
@type SC.View
|
262
|
-
*/
|
263
|
-
lastChild: null,
|
264
|
-
|
265
|
-
/**
|
266
|
-
The next sibling view in the childNodes array of the receivers parentNode.
|
267
|
-
If the receiver is the last view in the array or if the receiver does not
|
268
|
-
belong to a parent view this property will be null.
|
269
|
-
|
270
|
-
@field
|
271
|
-
@type SC.View
|
272
|
-
*/
|
273
|
-
nextSibling: null,
|
274
|
-
|
275
|
-
/**
|
276
|
-
The previous sibling view in the childNodes array of the receivers
|
277
|
-
parentNode. If the receiver is the first view in the array or if the
|
278
|
-
receiver does not belong to a parent view this property will be null.
|
279
|
-
|
280
|
-
@field
|
281
|
-
@type SC.View
|
282
|
-
*/
|
283
|
-
previousSibling: null,
|
284
|
-
|
285
|
-
/**
|
286
|
-
The parent view this view belongs to. If the receiver does not belong to a parent view
|
287
|
-
then this property is null.
|
288
|
-
|
289
|
-
@field
|
290
|
-
@type SC.View
|
291
|
-
*/
|
292
|
-
parentNode: null,
|
293
|
-
|
294
|
-
|
295
|
-
/**
|
296
|
-
The pane this view belongs to. The pane is the root of the responder
|
297
|
-
chain that this view belongs to. Typically a view's pane will be the
|
298
|
-
SC.window object. However, if you have added the view to a dialog, panel,
|
299
|
-
popup or other pane, this property will point to that pane instead.
|
300
|
-
|
301
|
-
If the view does not belong to a parentNode or if the view is not
|
302
|
-
onscreen, this property will be null.
|
303
|
-
|
304
|
-
@field
|
305
|
-
@type SC.View
|
306
|
-
*/
|
307
|
-
pane: function()
|
308
|
-
{
|
309
|
-
var view = this;
|
310
|
-
while(view = view.get('parentNode'))
|
311
|
-
{
|
312
|
-
if (view.get('isPane') ) break;
|
313
|
-
}
|
314
|
-
return view;
|
315
|
-
}.property(),
|
316
|
-
|
317
|
-
|
318
|
-
/**
|
319
|
-
Removes all child views from the receiver.
|
320
|
-
|
321
|
-
@returns {void}
|
322
|
-
*/
|
323
|
-
clear: function() {
|
324
|
-
while(this.firstChild) this.removeChild(this.firstChild) ;
|
325
|
-
},
|
326
|
-
|
327
|
-
/**
|
328
|
-
This method is called on the view just before it is added to a new parent
|
329
|
-
view.
|
330
|
-
|
331
|
-
You can override this method to do any setup you need on your view or to
|
332
|
-
reset any cached values that are impacted by being added to a view. The
|
333
|
-
default implementation does nothing.
|
334
|
-
|
335
|
-
@param parent {SC.View} the new parent
|
336
|
-
@paran beforeView {SC.View} the view in the parent's childNodes array that
|
337
|
-
will follow this view once it is added. If the view is being added to
|
338
|
-
the end of the array, this will be null.
|
339
|
-
@returns {void}
|
340
|
-
*/
|
341
|
-
willAddToParent: function(parent, beforeView) {},
|
342
|
-
|
343
|
-
/**
|
344
|
-
This method is called on the view just after it is added to a new parent
|
345
|
-
view.
|
346
|
-
|
347
|
-
You can override this method to do any setup you need on your view or to
|
348
|
-
reset any cached values that are impacted by being added to a view. The
|
349
|
-
default implementation does nothing.
|
350
|
-
|
351
|
-
@param parent {SC.View} the new parent
|
352
|
-
@paran beforeView {SC.View} the view in the parent's childNodes array that
|
353
|
-
will follow this view once it is added. If the view is being added to
|
354
|
-
the end of the array, this will be null.
|
355
|
-
@returns {void}
|
356
|
-
*/
|
357
|
-
didAddToParent: function(parent, beforeView) {},
|
358
|
-
|
359
|
-
/**
|
360
|
-
This method is called on the view just before it is removed from a parent
|
361
|
-
view.
|
362
|
-
|
363
|
-
You can override this method to clear out any values that depend on the
|
364
|
-
view belonging to the current parentNode. The default implementation does
|
365
|
-
nothing.
|
366
|
-
|
367
|
-
@returns {void}
|
368
|
-
*/
|
369
|
-
willRemoveFromParent: function() {},
|
370
|
-
|
371
|
-
/**
|
372
|
-
This method is called on the view just after it is removed from a parent
|
373
|
-
view.
|
374
|
-
|
375
|
-
You can override this method to clear out any values that depend on the
|
376
|
-
view belonging to the current parentNode. The default implementation does
|
377
|
-
nothing.
|
378
|
-
|
379
|
-
@param oldParent {SC.View} the old parent view
|
380
|
-
@returns {void}
|
381
|
-
*/
|
382
|
-
didRemoveFromParent: function(oldParent) {},
|
383
|
-
|
384
|
-
/**
|
385
|
-
This method is called just before a new child view is added to the
|
386
|
-
receiver's childNodes array. You can use this to prepare for any layout
|
387
|
-
or other cleanup you might need to do.
|
388
|
-
|
389
|
-
The default implementation does nothing.
|
390
|
-
|
391
|
-
@param child {SC.View} the view to be added
|
392
|
-
@param beforeView {SC.View} and existing child view that will follow the
|
393
|
-
child view in the array once it is added. If adding to the end of the
|
394
|
-
array, this param will be null.
|
395
|
-
@returns {void}
|
396
|
-
*/
|
397
|
-
willAddChild: function(child, beforeView) {},
|
398
|
-
|
399
|
-
/**
|
400
|
-
This method is called just after a new child view is added to the
|
401
|
-
receiver's childNodes array. You can use this to prepare for any layout
|
402
|
-
or other cleanup you might need to do.
|
403
|
-
|
404
|
-
The default implementation does nothing.
|
405
|
-
|
406
|
-
@param child {SC.View} the view that was added
|
407
|
-
@param beforeView {SC.View} and existing child view that will follow the
|
408
|
-
child view in the array once it is added. If adding to the end of the
|
409
|
-
array, this param will be null.
|
410
|
-
@returns {void}
|
411
|
-
*/
|
412
|
-
didAddChild: function(child, beforeView) {},
|
413
|
-
|
414
|
-
/**
|
415
|
-
This method is called just before a child view is removed from the
|
416
|
-
receiver's childNodes array. You can use this to prepare for any layout
|
417
|
-
or other cleanup you might need to do.
|
418
|
-
|
419
|
-
The default implementation does nothing.
|
420
|
-
|
421
|
-
@param child {SC.View} the view to be removed
|
422
|
-
@returns {void}
|
423
|
-
*/
|
424
|
-
willRemoveChild: function(child) {},
|
425
|
-
|
426
|
-
/**
|
427
|
-
This method is called just after a child view is removed from the
|
428
|
-
receiver's childNodes array. You can use this to prepare for any layout
|
429
|
-
or other cleanup you might need to do.
|
430
|
-
|
431
|
-
The default implementation does nothing.
|
432
|
-
|
433
|
-
@param child {SC.View} the view that was removed
|
434
|
-
@returns {void}
|
435
|
-
*/
|
436
|
-
didRemoveChild: function(child) {},
|
437
|
-
|
438
|
-
|
439
|
-
nextKeyView: null,
|
440
|
-
previousKeyView: null,
|
441
|
-
|
442
|
-
nextValidKeyView: function()
|
443
|
-
{
|
444
|
-
var view = this;
|
445
|
-
while (view = view.get('nextKeyView'))
|
446
|
-
{
|
447
|
-
if (view.get('isVisible') && view.get('acceptsFirstResponder')) {
|
448
|
-
return view;
|
449
|
-
}
|
450
|
-
}
|
451
|
-
return null;
|
452
|
-
},
|
453
|
-
|
454
|
-
previousValidKeyView: function()
|
455
|
-
{
|
456
|
-
var view = this;
|
457
|
-
while (view = view.get('previousKeyView'))
|
458
|
-
{
|
459
|
-
if (view.get('isVisible') && view.get('acceptsFirstResponder')) {
|
460
|
-
return view;
|
461
|
-
}
|
462
|
-
}
|
463
|
-
return null;
|
464
|
-
},
|
465
|
-
|
466
|
-
/** @private
|
467
|
-
Invoked whenever the child hierarchy changes and any internally cached
|
468
|
-
values might need to be recalculated.
|
469
|
-
*/
|
470
|
-
_flushInternalCaches: function() {
|
471
|
-
// only flush cache for parent if this item was cached since the top level
|
472
|
-
// cached can only be populated if this one is populated also...
|
473
|
-
if ((this._needsClippingFrame != null) || (this._needsFrameChanges != null)) {
|
474
|
-
this._needsClippingFrame = this._needsFrameChanges = null ;
|
475
|
-
if (this.parentNode) this.parentNode._flushInternalCaches() ;
|
476
|
-
}
|
477
|
-
},
|
478
|
-
|
479
|
-
// ..........................................
|
480
|
-
// SC.Responder implementation
|
481
|
-
//
|
482
|
-
|
483
|
-
nextResponder: function()
|
484
|
-
{
|
485
|
-
return this.parentNode;
|
486
|
-
}.property('parentNode'),
|
487
|
-
|
488
|
-
// recursively travels down the view hierarchy looking for a view that returns true to performKeyEquivalent
|
489
|
-
performKeyEquivalent: function(keystring, evt)
|
490
|
-
{
|
491
|
-
var child = this.get('firstChild');
|
492
|
-
while (child)
|
493
|
-
{
|
494
|
-
if (child.performKeyEquivalent(keystring, evt)) return true;
|
495
|
-
child = child.get('nextSibling');
|
496
|
-
}
|
497
|
-
return false;
|
498
|
-
},
|
499
|
-
|
500
|
-
// ..........................................
|
501
|
-
// ELEMENT API
|
502
|
-
//
|
503
|
-
|
504
|
-
/**
|
505
|
-
An array of currently applied classNames.
|
506
|
-
|
507
|
-
@field
|
508
|
-
@type {Array}
|
509
|
-
@param value {Array} Array of class names to apply to the element
|
510
|
-
*/
|
511
|
-
classNames: function(key, value) {
|
512
|
-
if (value !== undefined) {
|
513
|
-
value = Array.from(value) ;
|
514
|
-
if (this.rootElement) this.rootElement.className = value.join(' ') ;
|
515
|
-
this._classNames = value.slice() ;
|
516
|
-
}
|
517
|
-
|
518
|
-
if (!this._classNames) {
|
519
|
-
var classNames = this.rootElement.className;
|
520
|
-
this._classNames = (classNames && classNames.length > 0) ? classNames.split(' ') : [] ;
|
521
|
-
}
|
522
|
-
return this._classNames ;
|
523
|
-
}.property(),
|
524
|
-
|
525
|
-
/**
|
526
|
-
Detects the presence of the class name on the root element.
|
527
|
-
|
528
|
-
@param className {String} the class name
|
529
|
-
@returns {Boolean} YES if class name is currently applied, NO otherwise
|
530
|
-
*/
|
531
|
-
hasClassName: function(className) {
|
532
|
-
return (this._classNames || this.get('classNames')).indexOf(className) >= 0 ;
|
533
|
-
},
|
534
|
-
|
535
|
-
/**
|
536
|
-
Adds the class name to the element.
|
537
|
-
|
538
|
-
@param className {String} the class name to add.
|
539
|
-
@returns {String} the class name
|
540
|
-
*/
|
541
|
-
addClassName: function(className) {
|
542
|
-
if (this.hasClassName(className)) return ; // nothing to do
|
543
|
-
|
544
|
-
var classNames = this._classNames || this.get('classNames') ;
|
545
|
-
classNames.push(className) ;
|
546
|
-
this.set('classNames', classNames) ;
|
547
|
-
return className ;
|
548
|
-
},
|
549
|
-
|
550
|
-
/**
|
551
|
-
Removes the specified class name from the element.
|
552
|
-
|
553
|
-
@param className {String} the class name to remove
|
554
|
-
@returns {String} the class name
|
555
|
-
*/
|
556
|
-
removeClassName: function(className) {
|
557
|
-
if (!this.hasClassName(className)) return ; // nothing to do
|
558
|
-
|
559
|
-
var classNames = this._classNames || this.get('classNames') ;
|
560
|
-
classNames = this._classNames = classNames.without(className) ;
|
561
|
-
this.set('classNames', classNames) ;
|
562
|
-
return className ;
|
563
|
-
},
|
564
|
-
|
565
|
-
/**
|
566
|
-
Adds or removes the class name according to flag.
|
567
|
-
|
568
|
-
This is a simple way to add or remove a class from the root element.
|
569
|
-
|
570
|
-
@param className {String} the class name
|
571
|
-
@param flag {Boolean} YES to add class name, NO to remove it.
|
572
|
-
@returns {String} The class Name.
|
573
|
-
*/
|
574
|
-
setClassName: function(className, flag) {
|
575
|
-
return (!!flag) ? this.addClassName(className) : this.removeClassName(className);
|
576
|
-
},
|
577
|
-
|
578
|
-
/**
|
579
|
-
Toggles the presence of the class name.
|
580
|
-
|
581
|
-
If the specified CSS class is applied, it will be removed. If it is not
|
582
|
-
present, it will be added. Note that if this changes the potential
|
583
|
-
layout of the view, you must wrap calls to this in viewFrameDidChange()
|
584
|
-
and viewFrameWillChange().
|
585
|
-
|
586
|
-
@param className {String} the class name
|
587
|
-
@returns {Boolean} YES if classname is now applied
|
588
|
-
*/
|
589
|
-
toggleClassName: function(className) {
|
590
|
-
return this.setClassName(className, !this.hasClassName(className)) ;
|
591
|
-
},
|
592
|
-
|
593
|
-
/**
|
594
|
-
Retrieves the current value of the named CSS style.
|
595
|
-
|
596
|
-
This method is designed to work cross platform and uses the current
|
597
|
-
computed style, which is the combination of all applied CSS class names
|
598
|
-
and inline styles.
|
599
|
-
|
600
|
-
@param style {String} the style key.
|
601
|
-
@returns {Object} the style value or null if not-applied/auto
|
602
|
-
*/
|
603
|
-
getStyle: function(style) {
|
604
|
-
var element = this.rootElement ;
|
605
|
-
if (!this._computedStyle) {
|
606
|
-
this._computedStyle = document.defaultView.getComputedStyle(element, null) ;
|
607
|
-
}
|
608
|
-
|
609
|
-
//if (style == 'float') style = 'cssFloat' ;
|
610
|
-
style = (style === 'float') ? 'cssFloat' : style.camelize() ;
|
611
|
-
var value = element.style[style];
|
612
|
-
if (!value) {
|
613
|
-
value = this._computedStyle ? this._computedStyle[style] : null ;
|
614
|
-
}
|
615
|
-
|
616
|
-
if (style === 'opacity') {
|
617
|
-
value = value ? parseFloat(value) : 1.0;
|
618
|
-
}
|
619
|
-
if (value === 'auto') value = null ;
|
620
|
-
|
621
|
-
return value ;
|
622
|
-
},
|
623
|
-
|
624
|
-
|
625
|
-
/**
|
626
|
-
Sets the passed hash of CSS styles and values on the element. You should
|
627
|
-
pass your properties pre-camelized.
|
628
|
-
|
629
|
-
@param styles {Hash} hash of keys and values
|
630
|
-
@param camelized {Boolean} optional bool set to NO if you did not camelize.
|
631
|
-
@returns {Boolean} YES if set succeeded.
|
632
|
-
*/
|
633
|
-
setStyle: function(styles, camelized) {
|
634
|
-
return Element.setStyle(this.rootElement, styles, camelized) ;
|
635
|
-
},
|
636
|
-
|
637
|
-
/**
|
638
|
-
Updates the HTML of an element.
|
639
|
-
|
640
|
-
This method takes care of nasties like processing scripts and inserting
|
641
|
-
HTML into a table. It is also somewhat slow. If you control the HTML
|
642
|
-
being inserted and you are not working with table elements, you should use
|
643
|
-
the innerHTML property instead. If you are setting content generated by
|
644
|
-
users, this method can insert the content safely.
|
645
|
-
|
646
|
-
@param html {String} the html to insert.
|
647
|
-
*/
|
648
|
-
update: function(html) {
|
649
|
-
Element.update((this.containerElement || this.rootElement),html) ;
|
650
|
-
this.propertyDidChange('innerHTML') ;
|
651
|
-
},
|
652
|
-
|
653
|
-
/**
|
654
|
-
Retrieves the value for an attribute on the DOM element
|
655
|
-
|
656
|
-
@param attrName {String} the attribute name
|
657
|
-
@returns {String} attribute value
|
658
|
-
*/
|
659
|
-
getAttribute: function(attrName) {
|
660
|
-
return Element.readAttribute(this.rootElement,attrName) ;
|
661
|
-
},
|
662
|
-
|
663
|
-
/**
|
664
|
-
Sets an attribute on the root DOM element.
|
665
|
-
|
666
|
-
@param attrName {String} the attribute name
|
667
|
-
@param value {String} the new attribute value
|
668
|
-
@returns {String} the set attribute name
|
669
|
-
*/
|
670
|
-
setAttribute: function(attrName, value) {
|
671
|
-
this.rootElement.setAttribute(attrName, value) ;
|
672
|
-
},
|
673
|
-
|
674
|
-
/**
|
675
|
-
Returns true if the named attributes is defined on the views root element.
|
676
|
-
|
677
|
-
@param attrName {String} the attribute name
|
678
|
-
@returns {Boolean} YES if attribute is present.
|
679
|
-
*/
|
680
|
-
hasAttribute: function(attrName) {
|
681
|
-
return Element.hasAttribute(this.rootElement, attrName) ;
|
682
|
-
},
|
683
|
-
|
684
|
-
// ..........................................
|
685
|
-
// STYLE API
|
686
|
-
//
|
687
|
-
// These properties can be used to directly manipulate various CSS
|
688
|
-
// styles on the view. These properties are required for animation
|
689
|
-
// support. Values are typically assumed to be in px.
|
690
|
-
|
691
|
-
/**
|
692
|
-
SC.View's unknown property is used to implement a large class of
|
693
|
-
properties beginning with the the world "style". You can get or set
|
694
|
-
any of these properties to edit individual CSS style properties.
|
695
|
-
*/
|
696
|
-
unknownProperty: function(key, value) {
|
697
|
-
if (key && key.match && key.match(/^style/)) {
|
698
|
-
key = key.slice(5,key.length).replace(/^./, function(x) {
|
699
|
-
return x.toLowerCase();
|
700
|
-
});
|
701
|
-
|
702
|
-
var ret = null ;
|
703
|
-
|
704
|
-
// handle dimensional properties
|
705
|
-
if (key.match(/height$|width$|top$|bottom$|left$|right$/i)) {
|
706
|
-
if (value !== undefined) {
|
707
|
-
this.viewFrameWillChange() ;
|
708
|
-
var props = {} ;
|
709
|
-
props[key] = (value) ? value + 'px' : 'auto' ;
|
710
|
-
this.setStyle(props) ;
|
711
|
-
this.viewFrameDidChange() ;
|
712
|
-
}
|
713
|
-
ret = this.getStyle(key) ;
|
714
|
-
ret = (ret === 'auto') ? null : Math.round(parseFloat(ret)) ;
|
715
|
-
|
716
|
-
// all other properties just pass through (and do not change frame)
|
717
|
-
} else {
|
718
|
-
if (value !== undefined) {
|
719
|
-
var props = {} ;
|
720
|
-
props[key] = value ;
|
721
|
-
this.setStyle(props) ;
|
722
|
-
}
|
723
|
-
ret = this.getStyle(key) ;
|
724
|
-
}
|
725
|
-
return ret;
|
726
|
-
|
727
|
-
} else return arguments.callee.base.call(this, key, value) ;
|
728
|
-
},
|
729
|
-
|
730
|
-
// ..........................................
|
731
|
-
// DOM API
|
732
|
-
//
|
733
|
-
// The methods in this section give you some low-level control over how the
|
734
|
-
// view interacts with the DOM. You do not normally need to work with this.
|
735
|
-
|
736
|
-
/**
|
737
|
-
This is the DOM element actually managed by this view. This will be set
|
738
|
-
by the view when it is created. You should rarely need to access this
|
739
|
-
property directly. When you do access it, you should only do so from
|
740
|
-
within methods you write on your SC.View subclasses, never from outside
|
741
|
-
the view.
|
742
|
-
|
743
|
-
Unlike most properties, you do not need to use get()/set() to access this
|
744
|
-
property. It is not currently safe to edit this property once the view
|
745
|
-
has been createde.
|
746
|
-
|
747
|
-
@field
|
748
|
-
@type {Element}
|
749
|
-
*/
|
750
|
-
rootElement: null,
|
751
|
-
|
752
|
-
/**
|
753
|
-
Normally when you add child views to your view, their DOM elements will
|
754
|
-
be set as direct children of the root element. However you can
|
755
|
-
choose instead to designate an alertnative child node using this
|
756
|
-
property. Set this to a selector string to begin with. The first time
|
757
|
-
it is accessed, the view will convert it to an actual element. It is not
|
758
|
-
currently safe to edit this property once the view has been created.
|
759
|
-
|
760
|
-
Like rootElement, you should only access this property from within
|
761
|
-
methods you write on an SC.View subclass, never from outside the view.
|
762
|
-
Unlike most properties, it is not necessary to use get()/set().
|
763
|
-
|
764
|
-
@field
|
765
|
-
@type {Element}
|
766
|
-
*/
|
767
|
-
containerElement: null,
|
768
|
-
|
769
|
-
// ..........................................
|
770
|
-
// VIEW LAYOUT
|
771
|
-
//
|
772
|
-
// The following methods can be used to implement automatic resizing.
|
773
|
-
// The frame and bounds provides a simple way for you to compute the
|
774
|
-
// location and size of your views. You can then use the automatic
|
775
|
-
// resizing.
|
776
|
-
|
777
|
-
/**
|
778
|
-
Returns true if the view or any of its contained views implement the
|
779
|
-
clippingFrameDidChange method.
|
780
|
-
|
781
|
-
If this property returns false, then notifications about changes to the
|
782
|
-
clippingFrame will probably not be called on the receiver. Normally if
|
783
|
-
you do not need to worry about this property since implementing the
|
784
|
-
clippingFrameDidChange() method will change its value and cause your
|
785
|
-
method to be invoked.
|
786
|
-
|
787
|
-
This property is automatically updated whenever you add or remove a child
|
788
|
-
view.
|
789
|
-
*/
|
790
|
-
needsClippingFrame: function() {
|
791
|
-
if (this._needsClippingFrame == null) {
|
792
|
-
var ret = this.clippingFrameDidChange != SC.View.prototype.clippingFrameDidChange;
|
793
|
-
var view = this.get('firstChild') ;
|
794
|
-
while(!ret && view) {
|
795
|
-
ret = view.get('needsClippingFrame') ;
|
796
|
-
view = view.get('nextSibling') ;
|
797
|
-
}
|
798
|
-
this._needsClippingFrame = ret ;
|
799
|
-
}
|
800
|
-
return this._needsClippingFrame ;
|
801
|
-
}.property(),
|
802
|
-
|
803
|
-
/**
|
804
|
-
Returns true if the view or any of its contained views implements any
|
805
|
-
resize methods.
|
806
|
-
|
807
|
-
If this property returns false, changes to your frame view may not be
|
808
|
-
relayed to child methods. This may mean that your various frame
|
809
|
-
properties could become stale unless you call refreshFrames() first.
|
810
|
-
|
811
|
-
If you want you make sure your frames are up to date, see hasManualLayout.
|
812
|
-
|
813
|
-
This property is automatically updated whenever you add or remove a child
|
814
|
-
view. It returns true if you implement any of the resize methods or if
|
815
|
-
hasManualLayout is true.
|
816
|
-
*/
|
817
|
-
needsFrameChanges: function() {
|
818
|
-
if (this._needsFrameChanges == null) {
|
819
|
-
var ret = this.get('needsClippingFrame') || this.get('hasManualLayout') ;
|
820
|
-
var view = this.get('firstChild') ;
|
821
|
-
while(!ret && view) {
|
822
|
-
ret = view.get('needsFrameChanges') ;
|
823
|
-
view = view.get('nextSibling') ;
|
824
|
-
}
|
825
|
-
this._needsFrameChanges = ret ;
|
826
|
-
}
|
827
|
-
return this._needsFrameChanges ;
|
828
|
-
}.property(),
|
829
|
-
|
830
|
-
|
831
|
-
/**
|
832
|
-
Returns true if the receiver manages the layout for itself or its
|
833
|
-
children.
|
834
|
-
|
835
|
-
Normally this property returns true automatically if you implement
|
836
|
-
resizeChildrenWithOldSize() or resizeWithOldParentSize() or
|
837
|
-
clippingFrameDidChange().
|
838
|
-
|
839
|
-
If you do not implement these methods but need to make sure your frame is
|
840
|
-
always up-to-date anyway, set this property to true.
|
841
|
-
*/
|
842
|
-
hasManualLayout: function() {
|
843
|
-
return (this.resizeChildrenWithOldSize != SC.View.prototype.resizeChildrenWithOldSize) ||
|
844
|
-
(this.resizeWithOldParentSize != SC.View.prototype.resizeWithOldParentSize) ||
|
845
|
-
(this.clippingFrameDidChange != SC.View.prototype.clippingFrameDidChange) ;
|
846
|
-
}.property(),
|
847
|
-
|
848
|
-
/**
|
849
|
-
Convert a point _from_ the offset parent of the passed view to the current
|
850
|
-
view.
|
851
|
-
|
852
|
-
This is a useful utility for converting points in the coordinate system of
|
853
|
-
another view to the coordinate system of the receiver. Pass null for
|
854
|
-
targetView to convert a point from a window offset. This is the inverse
|
855
|
-
of convertFrameToView().
|
856
|
-
|
857
|
-
Note that if your view is not visible on the screen, this may not work.
|
858
|
-
|
859
|
-
@param {Point} f The point or frame to convert
|
860
|
-
@param {SC.View} targetView The view to convert from. Pass null to convert from window coordinates.
|
861
|
-
|
862
|
-
@returns {Point} The converted point or frame
|
863
|
-
*/
|
864
|
-
convertFrameFromView: function(f, targetView) {
|
865
|
-
|
866
|
-
// first, convert to root level offset.
|
867
|
-
var thisOffset = SC.viewportOffset(this.get('offsetParent')) ;
|
868
|
-
var thatOffset = (targetView) ? SC.viewportOffset(targetView.get('offsetParent')) : SC.ZERO_POINT;
|
869
|
-
|
870
|
-
// now get adjustment.
|
871
|
-
var adjustX = thatOffset.x - thisOffset.x ;
|
872
|
-
var adjustY = thatOffset.y - thisOffset.y ;
|
873
|
-
return { x: (f.x + adjustX), y: (f.y + adjustY), width: f.width, height: f.height };
|
874
|
-
},
|
875
|
-
|
876
|
-
/**
|
877
|
-
Convert a point _to_ the offset parent of the passed view from the current
|
878
|
-
view.
|
879
|
-
|
880
|
-
This is a useful utility for converting points in the coordinate system of
|
881
|
-
the receiver to the coordinate system of another view. Pass null for
|
882
|
-
targetView to convert a point to a window offset. This is the inverse of
|
883
|
-
convertFrameFromView().
|
884
|
-
|
885
|
-
Note that if your view is not visible on the screen, this may not work.
|
886
|
-
|
887
|
-
@param {Point} f The point or frame to convert
|
888
|
-
@param {SC.View} targetView The view to convert to. Pass null to convert to window coordinates.
|
889
|
-
|
890
|
-
@returns {Point} The converted point or frame
|
891
|
-
*/
|
892
|
-
convertFrameToView: function(f, sourceView) {
|
893
|
-
// first, convert to root level offset.
|
894
|
-
var thisOffset = SC.viewportOffset(this.get('offsetParent')) ;
|
895
|
-
var thatOffset = (sourceView) ? SC.viewportOffset(sourceView.get('offsetParent')) : SC.ZERO_POINT ;
|
896
|
-
|
897
|
-
// now get adjustment.
|
898
|
-
var adjustX = thisOffset.x - thatOffset.x ;
|
899
|
-
var adjustY = thisOffset.y - thatOffset.y ;
|
900
|
-
return { x: (f.x + adjustX), y: (f.y + adjustY), width: f.width, height: f.height };
|
901
|
-
},
|
902
|
-
|
903
|
-
/**
|
904
|
-
This property returns a DOM ELEMENT that is the offset parent for
|
905
|
-
this view's frame coordinates. Depending on your CSS, this parent
|
906
|
-
may or may not match with the parent view.
|
907
|
-
|
908
|
-
@example
|
909
|
-
offsetView = $view(this.get('offsetParent')) ;
|
910
|
-
|
911
|
-
@field
|
912
|
-
@type {Element}
|
913
|
-
*/
|
914
|
-
offsetParent: function() {
|
915
|
-
|
916
|
-
// handle simple cases.
|
917
|
-
var el = this.rootElement ;
|
918
|
-
if (!el || el === document.body) return el;
|
919
|
-
if (el.offsetParent) return el.offsetParent ;
|
920
|
-
|
921
|
-
// in some cases, we can't find the offset parent so we walk up the
|
922
|
-
// chain until an element is found with a position other than
|
923
|
-
// 'static'
|
924
|
-
//
|
925
|
-
// Note that IE places DOM elements not in the main body inside of a
|
926
|
-
// document-fragment root. We need to treat document-fragments (i.e.
|
927
|
-
// nodeType === 11) as null values
|
928
|
-
var ret = null ;
|
929
|
-
while(!ret && (el = el.parentNode) && (el.nodeType !== 11) && (el !== document.body)) {
|
930
|
-
if (Element.getStyle(el, 'position') !== 'static') ret = el;
|
931
|
-
}
|
932
|
-
if (!ret && (el === document.body)) ret = el ;
|
933
|
-
return ret ;
|
934
|
-
}.property(),
|
935
|
-
|
936
|
-
/**
|
937
|
-
The inner bounds for the content shown inside of this frame. Reflects
|
938
|
-
scroll position and other properties.
|
939
|
-
|
940
|
-
The inner frame returns the actual available frame for child elements,
|
941
|
-
less any borders or scroll bars.
|
942
|
-
|
943
|
-
This value can change when:
|
944
|
-
- the receiver's frame changes
|
945
|
-
- the receiver's child views change, adding or removing scrollbars
|
946
|
-
- You can the CSS or applied style that effects the borders or scrollbar visibility
|
947
|
-
*/
|
948
|
-
innerFrame: function(key, value) {
|
949
|
-
|
950
|
-
var f ;
|
951
|
-
if (this._innerFrame == null) {
|
952
|
-
|
953
|
-
// get the base frame
|
954
|
-
// The _collectInnerFrame function is set at the bottom of this file
|
955
|
-
// based on the browser type.
|
956
|
-
var el = this.rootElement ;
|
957
|
-
f = this._collectFrame(SC.View._collectInnerFrame) ;
|
958
|
-
|
959
|
-
// bizarely for FireFox if your offsetParent has a border, then it can
|
960
|
-
// impact the offset
|
961
|
-
if (SC.Platform.Firefox) {
|
962
|
-
var parent = el.offsetParent ;
|
963
|
-
var overflow = (parent) ? Element.getStyle(parent, 'overflow') : 'visible' ;
|
964
|
-
if (overflow && overflow !== 'visible') {
|
965
|
-
var left = parseInt(Element.getStyle(parent, 'borderLeftWidth'),0) || 0 ;
|
966
|
-
var top = parseInt(Element.getStyle(parent, 'borderTopWidth'),0) || 0 ;
|
967
|
-
f.x += left; f.y += top ;
|
968
|
-
}
|
969
|
-
}
|
970
|
-
|
971
|
-
// fix the x & y with the clientTop/clientLeft
|
972
|
-
var clientLeft, clientTop ;
|
973
|
-
|
974
|
-
if (SC.Platform.IE) {
|
975
|
-
if (!el.width) {
|
976
|
-
clientLeft = parseInt(this.getStyle('border-left-width'),0) || 0 ;
|
977
|
-
} else clientLeft = el.clientLeft ;
|
978
|
-
|
979
|
-
if (!el.height) {
|
980
|
-
clientTop = parseInt(this.getStyle('border-top-width'),0) || 0 ;
|
981
|
-
} else clientTop = el.clientTop ;
|
982
|
-
|
983
|
-
f.x += clientLeft; f.y += clientTop;
|
984
|
-
}
|
985
|
-
else {
|
986
|
-
if (el.clientLeft == null) {
|
987
|
-
clientLeft = parseInt(this.getStyle('border-left-width'),0) || 0 ;
|
988
|
-
} else clientLeft = el.clientLeft ;
|
989
|
-
|
990
|
-
if (el.clientTop == null) {
|
991
|
-
clientTop = parseInt(this.getStyle('border-top-width'),0) || 0 ;
|
992
|
-
} else clientTop = el.clientTop ;
|
993
|
-
|
994
|
-
f.x += clientLeft; f.y += clientTop;
|
995
|
-
}
|
996
|
-
|
997
|
-
// cache this frame if using manual layout mode
|
998
|
-
this._innerFrame = SC.cloneRect(f);
|
999
|
-
} else f = SC.cloneRect(this._innerFrame) ;
|
1000
|
-
// console.log('returning x:%@ y:%@ w:%@ h:%@'.fmt(f.x, f.y, f.width, f.height));
|
1001
|
-
return f ;
|
1002
|
-
}.property('frame'),
|
1003
|
-
|
1004
|
-
/**
|
1005
|
-
The outside bounds of your view, offset top/left from its offsetParent
|
1006
|
-
|
1007
|
-
The frame rect is the area actually occupied by a view including any
|
1008
|
-
borders or padding, but excluding margins.
|
1009
|
-
|
1010
|
-
The frame is calculated and cached the first time you get it. Afer that,
|
1011
|
-
the frame cache should automatically update when you make changes that
|
1012
|
-
will effect the view frames unless you change the frame indirectly, such
|
1013
|
-
as through changing CSS classes or by-passing the view to edit the DOM.
|
1014
|
-
|
1015
|
-
If you make a change like this, be sure to wrap the code that makes this
|
1016
|
-
change with calls to viewFrameWillChange() and viewFrameDidChange() on the
|
1017
|
-
highest-level view that will be impacted by the change. Calling this
|
1018
|
-
method will automatically update child frames as well.
|
1019
|
-
|
1020
|
-
When you set the frame property, it will update the left, top, height,
|
1021
|
-
and width CSS attributes on the element. Since the height and width in
|
1022
|
-
the frame rect includes borders and padding, the view will automatically
|
1023
|
-
adjust the height and width CSS it sets to account for this.
|
1024
|
-
|
1025
|
-
If you would prefer to edit the CSS attributes for the frame directly
|
1026
|
-
instead, you can do so by using the styleTop, styleLeft, styleRight,
|
1027
|
-
styleBottom, styleWidth, and styleHeight properties on the view. These
|
1028
|
-
properties will update the CSS attributes and call viewFrameDidChange()/
|
1029
|
-
viewFrameWillChange().
|
1030
|
-
|
1031
|
-
@field
|
1032
|
-
*/
|
1033
|
-
frame: function(key, value) {
|
1034
|
-
|
1035
|
-
// if value was passed, set the values in the style
|
1036
|
-
// now update the frame if needed. Only actually change the style for
|
1037
|
-
// those parts of the frame that were passed in.
|
1038
|
-
if (value !== undefined) {
|
1039
|
-
|
1040
|
-
this.viewFrameWillChange() ;
|
1041
|
-
|
1042
|
-
var f= value ;
|
1043
|
-
var style = {} ;
|
1044
|
-
var didResize = false ;
|
1045
|
-
|
1046
|
-
// collect required info
|
1047
|
-
// reposition X
|
1048
|
-
if (value.x !== undefined) {
|
1049
|
-
style.left = Math.floor(f.x) + 'px' ;
|
1050
|
-
style.right = 'auto';
|
1051
|
-
}
|
1052
|
-
|
1053
|
-
// reposition Y
|
1054
|
-
if (value.y !== undefined) {
|
1055
|
-
style.top = Math.floor(f.y) + 'px' ;
|
1056
|
-
style.bottom = 'auto';
|
1057
|
-
}
|
1058
|
-
|
1059
|
-
// Resize width
|
1060
|
-
if (value.width !== undefined) {
|
1061
|
-
didResize = true ;
|
1062
|
-
var padding = 0 ;
|
1063
|
-
var idx = SC.View.WIDTH_PADDING_STYLES.length;
|
1064
|
-
while(--idx >= 0) {
|
1065
|
-
padding += parseInt(this.getStyle(SC.View.WIDTH_PADDING_STYLES[idx]), 0) || 0;
|
1066
|
-
}
|
1067
|
-
var width = Math.floor(f.width) - padding ;
|
1068
|
-
if (!isNaN(width)) style.width = width.toString() + 'px' ;
|
1069
|
-
}
|
1070
|
-
|
1071
|
-
// Resize Height
|
1072
|
-
if (value.height !== undefined) {
|
1073
|
-
didResize = true ;
|
1074
|
-
var padding = 0 ;
|
1075
|
-
var idx = SC.View.HEIGHT_PADDING_STYLES.length;
|
1076
|
-
while(--idx >= 0) {
|
1077
|
-
padding += parseInt(this.getStyle(SC.View.HEIGHT_PADDING_STYLES[idx]), 0) || 0;
|
1078
|
-
}
|
1079
|
-
var height = Math.floor(f.height) - padding ;
|
1080
|
-
if(!isNaN(height)) style.height = height.toString() + 'px' ;
|
1081
|
-
}
|
1082
|
-
|
1083
|
-
// now apply style change and clear the cached frame
|
1084
|
-
this.setStyle(style) ;
|
1085
|
-
|
1086
|
-
// notify for a resize only.
|
1087
|
-
this.viewFrameDidChange() ;
|
1088
|
-
}
|
1089
|
-
|
1090
|
-
// build frame. We can use a cached version but only
|
1091
|
-
// if layoutMode == SC.MANUAL_MODE
|
1092
|
-
var f;
|
1093
|
-
if (this._frame == null) {
|
1094
|
-
var el = this.rootElement ;
|
1095
|
-
f = this._collectFrame(function() {
|
1096
|
-
return {
|
1097
|
-
x: el.offsetLeft,
|
1098
|
-
y: el.offsetTop,
|
1099
|
-
width: el.offsetWidth,
|
1100
|
-
height: el.offsetHeight
|
1101
|
-
};
|
1102
|
-
}) ;
|
1103
|
-
|
1104
|
-
// bizarely for FireFox if your offsetParent has a border, then it can
|
1105
|
-
// impact the offset
|
1106
|
-
if (SC.Platform.Firefox) {
|
1107
|
-
var parent = el.offsetParent ;
|
1108
|
-
var overflow = (parent) ? Element.getStyle(parent, 'overflow') : 'visible' ;
|
1109
|
-
if (overflow && overflow !== 'visible') {
|
1110
|
-
var left = parseInt(Element.getStyle(parent, 'borderLeftWidth'),0) || 0 ;
|
1111
|
-
var top = parseInt(Element.getStyle(parent, 'borderTopWidth'),0) || 0 ;
|
1112
|
-
f.x += left; f.y += top ;
|
1113
|
-
}
|
1114
|
-
}
|
1115
|
-
|
1116
|
-
// cache this frame if using manual layout mode
|
1117
|
-
this._frame = SC.cloneRect(f);
|
1118
|
-
} else f = SC.cloneRect(this._frame) ;
|
1119
|
-
|
1120
|
-
// finally return the frame.
|
1121
|
-
return f ;
|
1122
|
-
}.property(),
|
1123
|
-
|
1124
|
-
/**
|
1125
|
-
The current frame size.
|
1126
|
-
|
1127
|
-
This property will actually return the same value as the frame property,
|
1128
|
-
however setting this property will set only the frame size and ignore any
|
1129
|
-
origin you might pass.
|
1130
|
-
|
1131
|
-
@field
|
1132
|
-
*/
|
1133
|
-
size: function(key, value) {
|
1134
|
-
if (value !== undefined) {
|
1135
|
-
this.set('frame',{ width: value.width, height: value.height }) ;
|
1136
|
-
}
|
1137
|
-
return this.get('frame') ;
|
1138
|
-
}.property('frame'),
|
1139
|
-
|
1140
|
-
/**
|
1141
|
-
The current frame origin.
|
1142
|
-
|
1143
|
-
This property will actually return the same value as the frame property,
|
1144
|
-
however setting this property will set only the frame origin and ignore
|
1145
|
-
any size you might pass.
|
1146
|
-
|
1147
|
-
@field
|
1148
|
-
*/
|
1149
|
-
origin: function(key, value) {
|
1150
|
-
if (value !== undefined) {
|
1151
|
-
this.set('frame',{ x: value.x, y: value.y }) ;
|
1152
|
-
}
|
1153
|
-
return this.get('frame') ;
|
1154
|
-
}.property('frame'),
|
1155
|
-
|
1156
|
-
/**
|
1157
|
-
Call this method before you make a change that will impact the frame of
|
1158
|
-
the view such as changing the border thickness or adding/removing a CSS
|
1159
|
-
style.
|
1160
|
-
|
1161
|
-
Once you finish making your changes, be sure to call viewFrameDidChange()
|
1162
|
-
as well. This will deliver any relevant resizing and other notifications.
|
1163
|
-
It is safe to nest multiple calls to this method.
|
1164
|
-
|
1165
|
-
This method is called automatically anytime you set the frame.
|
1166
|
-
|
1167
|
-
@returns {void}
|
1168
|
-
*/
|
1169
|
-
viewFrameWillChange: function() {
|
1170
|
-
if (this._frameChangeLevel++ <= 0) {
|
1171
|
-
this._frameChangeLevel = 1 ;
|
1172
|
-
|
1173
|
-
// save frame information if view has manual layout.
|
1174
|
-
if (this.get('needsFrameChanges')) {
|
1175
|
-
this._cachedFrames = this.getEach('innerFrame', 'clippingFrame', 'frame') ;
|
1176
|
-
} else this._cachedFrames = null ;
|
1177
|
-
this.beginPropertyChanges(); // suspend change notifications
|
1178
|
-
}
|
1179
|
-
},
|
1180
|
-
|
1181
|
-
/**
|
1182
|
-
Call this method just after you finish making changes that will impace the
|
1183
|
-
frame of the view such as changing the border thickness or adding/removing
|
1184
|
-
a CSS style.
|
1185
|
-
|
1186
|
-
It is safe to next multiple calls to this method. This method is called
|
1187
|
-
automatically anytime you set the frame.
|
1188
|
-
|
1189
|
-
@returns {void}
|
1190
|
-
*/
|
1191
|
-
viewFrameDidChange: function(force) {
|
1192
|
-
|
1193
|
-
// clear the frame caches
|
1194
|
-
this.recacheFrames() ;
|
1195
|
-
|
1196
|
-
// if this is a top-level call then also deliver notifications as needed.
|
1197
|
-
if (--this._frameChangeLevel <= 0) {
|
1198
|
-
this._frameChangeLevel = 0 ;
|
1199
|
-
if (this._cachedFrames) {
|
1200
|
-
var newFrames = this.getEach('innerFrame', 'clippingFrame') ;
|
1201
|
-
|
1202
|
-
// notify if clippingFrame has changed and clippingFrameDidChange is
|
1203
|
-
// implemented.
|
1204
|
-
var nf = newFrames[1]; var of = this._cachedFrames[1] ;
|
1205
|
-
if (force || (nf.width != of.width) || (nf.height != of.height)) {
|
1206
|
-
this._invalidateClippingFrame() ;
|
1207
|
-
}
|
1208
|
-
|
1209
|
-
// notify children if the size of the innerFrame has changed.
|
1210
|
-
var nf = newFrames[0]; var of = this._cachedFrames[0] ;
|
1211
|
-
if (force || (nf.width != of.width) || (nf.height != of.height)) {
|
1212
|
-
this.resizeChildrenWithOldSize(this._cachedFrames.last()) ;
|
1213
|
-
}
|
1214
|
-
|
1215
|
-
// clear parent scrollFrame if needed
|
1216
|
-
var parent = this.parentNode ;
|
1217
|
-
while (parent && parent != SC.window) {
|
1218
|
-
if (parent._scrollFrame) parent._scrollFrame = null ;
|
1219
|
-
parent = parent.parentNode ;
|
1220
|
-
}
|
1221
|
-
|
1222
|
-
this.notifyPropertyChange('frame') ; // trigger notifications.
|
1223
|
-
}
|
1224
|
-
|
1225
|
-
// allow notifications again
|
1226
|
-
this.endPropertyChanges() ;
|
1227
|
-
}
|
1228
|
-
},
|
1229
|
-
|
1230
|
-
|
1231
|
-
/**
|
1232
|
-
Clears any cached frames so the next get will recompute them.
|
1233
|
-
|
1234
|
-
This method does not notify any observers of changes to the frames. It
|
1235
|
-
should only be used when you need to make sure your frame info is up to
|
1236
|
-
date but you do not expect anything to have happened that frame observers
|
1237
|
-
would be interested in.
|
1238
|
-
*/
|
1239
|
-
recacheFrames: function() {
|
1240
|
-
this._innerFrame = this._frame = this._clippingFrame = this._scrollFrame = null ;
|
1241
|
-
},
|
1242
|
-
|
1243
|
-
/**
|
1244
|
-
Set to true if you expect this view to have scrollable content.
|
1245
|
-
|
1246
|
-
Normally views do not monitor their onscroll event. If you set this
|
1247
|
-
property to true, however, the view will observe its onscroll event and
|
1248
|
-
update its scrollFrame and clippedFrame.
|
1249
|
-
|
1250
|
-
This will also register the view as a scrollable area that can be
|
1251
|
-
auto-scrolled during a drag/drop event.
|
1252
|
-
*/
|
1253
|
-
isScrollable: false,
|
1254
|
-
|
1255
|
-
/**
|
1256
|
-
The frame used to control scrolling of content.
|
1257
|
-
|
1258
|
-
x,y => offset from the innerFrame root.
|
1259
|
-
width,height => total size of the frame
|
1260
|
-
|
1261
|
-
If the frame does not have scrollable content, then the size will be equal
|
1262
|
-
to the innerFrame size.
|
1263
|
-
|
1264
|
-
This frame changes when:
|
1265
|
-
- the receiver's innerFrame changes
|
1266
|
-
- the scroll location is changed programatically
|
1267
|
-
- the size of child views changes
|
1268
|
-
- the user scrolls the view
|
1269
|
-
|
1270
|
-
@field
|
1271
|
-
*/
|
1272
|
-
scrollFrame: function(key, value) {
|
1273
|
-
|
1274
|
-
// if value was passed, update the scroll x,y only.
|
1275
|
-
if (value != undefined) {
|
1276
|
-
var el = this.rootElement ;
|
1277
|
-
if (value.x != null) el.scrollLeft = 0-value.x ;
|
1278
|
-
if (value.y != null) el.scrollTop = 0-value.y ;
|
1279
|
-
this._scrollFrame = null ;
|
1280
|
-
this._invalidateClippingFrame() ;
|
1281
|
-
}
|
1282
|
-
|
1283
|
-
// build frame. We can use a cached version but only
|
1284
|
-
var f;
|
1285
|
-
if (this._scrollFrame == null) {
|
1286
|
-
var el = this.rootElement ;
|
1287
|
-
var func;
|
1288
|
-
if (SC.isIE()) {
|
1289
|
-
func = function() {
|
1290
|
-
var borderTopWidth = 0;
|
1291
|
-
var borderBottomWidth = 0;
|
1292
|
-
var borderLeftWidth = 0;
|
1293
|
-
var borderRightWidth = 0;
|
1294
|
-
|
1295
|
-
var overflow = el.currentStyle.overflow;
|
1296
|
-
if ( overflow != 'hidden' && overflow != 'auto' ) {
|
1297
|
-
borderTopWidth = parseInt(el.currentStyle.borderTopWidth, 0) || 0 ;
|
1298
|
-
borderBottomWidth = parseInt(el.currentStyle.borderBottomWidth, 0) || 0 ;
|
1299
|
-
borderLeftWidth = parseInt(el.currentStyle.borderLeftWidth, 0) || 0 ;
|
1300
|
-
borderRightWidth = parseInt(el.currentStyle.borderRightWidth, 0) || 0 ;
|
1301
|
-
}
|
1302
|
-
return {
|
1303
|
-
x: 0 - el.scrollLeft,
|
1304
|
-
y: 0 - el.scrollTop,
|
1305
|
-
width: el.scrollWidth + borderLeftWidth + borderRightWidth,
|
1306
|
-
height: Math.max(el.scrollHeight, el.clientHeight) + borderTopWidth + borderBottomWidth
|
1307
|
-
};
|
1308
|
-
};
|
1309
|
-
}
|
1310
|
-
else {
|
1311
|
-
func = function() {
|
1312
|
-
return {
|
1313
|
-
x: 0 - el.scrollLeft,
|
1314
|
-
y: 0 - el.scrollTop,
|
1315
|
-
width: el.scrollWidth,
|
1316
|
-
height: el.scrollHeight
|
1317
|
-
};
|
1318
|
-
};
|
1319
|
-
}
|
1320
|
-
f = this._collectFrame(func);
|
1321
|
-
|
1322
|
-
// cache this frame if using manual layout mode
|
1323
|
-
this._scrollFrame = SC.cloneRect(f);
|
1324
|
-
} else f = SC.cloneRect(this._scrollFrame) ;
|
1325
|
-
|
1326
|
-
// finally return the frame.
|
1327
|
-
return f ;
|
1328
|
-
}.property('frame'),
|
1329
|
-
|
1330
|
-
/**
|
1331
|
-
The visible portion of the view.
|
1332
|
-
|
1333
|
-
Returns the subset of the receivers frame that is actually visible on
|
1334
|
-
screen. This frame is automatically updated whenever one of the following
|
1335
|
-
changes:
|
1336
|
-
|
1337
|
-
- A parent view is resized
|
1338
|
-
- A parent view's scrollFrame changes.
|
1339
|
-
- The receiver is moved or resized
|
1340
|
-
- The receiver or a parent view is added to or removed from the window.
|
1341
|
-
|
1342
|
-
@field
|
1343
|
-
*/
|
1344
|
-
clippingFrame: function() {
|
1345
|
-
var f ;
|
1346
|
-
if (this._clippingFrame == null) {
|
1347
|
-
|
1348
|
-
//if (this instanceof SC.SplitView) debugger ;
|
1349
|
-
|
1350
|
-
// my clipping frame is usually my frame
|
1351
|
-
f = this.get('frame') ;
|
1352
|
-
|
1353
|
-
// scope to my parents clipping frame.
|
1354
|
-
if (this.parentNode) {
|
1355
|
-
|
1356
|
-
// use only the visible portion of the parent's innerFrame.
|
1357
|
-
var parent = this.parentNode ;
|
1358
|
-
var prect = SC.intersectRects(parent.get('clippingFrame'), parent.get('innerFrame'));
|
1359
|
-
|
1360
|
-
// convert the local view's coordinates
|
1361
|
-
prect = this.convertFrameFromView(prect, parent) ;
|
1362
|
-
|
1363
|
-
// if parent is scrollable, then adjust by scroll frame also.
|
1364
|
-
if (this.parentNode.get('isScrollable')) {
|
1365
|
-
var scrollFrame = this.get('scrollFrame') ;
|
1366
|
-
prect.x -= scrollFrame.x ;
|
1367
|
-
prect.y -= scrollFrame.y ;
|
1368
|
-
}
|
1369
|
-
|
1370
|
-
// blend with current frame
|
1371
|
-
f = SC.intersectRects(f, prect) ;
|
1372
|
-
} else {
|
1373
|
-
f.width = f.height = 0 ;
|
1374
|
-
}
|
1375
|
-
|
1376
|
-
this._clippingFrame = SC.cloneRect(f) ;
|
1377
|
-
|
1378
|
-
} else f = SC.cloneRect(this._clippingFrame) ;
|
1379
|
-
return f ;
|
1380
|
-
}.property('frame', 'scrollFrame'),
|
1381
|
-
|
1382
|
-
/**
|
1383
|
-
Called whenever the receivers clippingFrame has changed. You can override
|
1384
|
-
this method to perform partial rendering or other clippingFrame-dependent
|
1385
|
-
actions.
|
1386
|
-
|
1387
|
-
The default implementation does nothing (and may not even be called do to
|
1388
|
-
optimizations). Note that this is the preferred way to respond to changes
|
1389
|
-
in the clippingFrame of using an observer since this method is gauranteed
|
1390
|
-
to happen in the correct order. You can use observers and bindings as
|
1391
|
-
well if you wish to handle anything that need not be handled
|
1392
|
-
synchronously.
|
1393
|
-
*/
|
1394
|
-
clippingFrameDidChange: function() {
|
1395
|
-
|
1396
|
-
},
|
1397
|
-
|
1398
|
-
/**
|
1399
|
-
Called whenever the view's innerFrame size changes. You can override this
|
1400
|
-
method to perform your own layout of your child views.
|
1401
|
-
|
1402
|
-
If you do not override this method, the view will assume you are using
|
1403
|
-
CSS to layout your child views. As an optimization the view may not
|
1404
|
-
always call this method if it determines that you have not overridden it.
|
1405
|
-
|
1406
|
-
This default version simply calls resizeWithOldParentSize() on all of its
|
1407
|
-
children.
|
1408
|
-
|
1409
|
-
@param oldSize {Size} The old frame size of the view.
|
1410
|
-
@returns {void}
|
1411
|
-
*/
|
1412
|
-
resizeChildrenWithOldSize: function(oldSize) {
|
1413
|
-
var child = this.get('firstChild') ;
|
1414
|
-
while(child) {
|
1415
|
-
child.resizeWithOldParentSize(oldSize) ;
|
1416
|
-
child = child.get('nextSibling') ;
|
1417
|
-
}
|
1418
|
-
},
|
1419
|
-
|
1420
|
-
/**
|
1421
|
-
Called whenever the parent's innerFrame size has changed. You can
|
1422
|
-
override this method to change how your view responds to this change.
|
1423
|
-
|
1424
|
-
If you do not override this method, the view will assume you are using CSS
|
1425
|
-
to control your layout and it will simply relay the change information to
|
1426
|
-
your child views. As an optmization, the view may not always call this
|
1427
|
-
method if it determines that you have not overridden it.
|
1428
|
-
|
1429
|
-
@param oldSize {Size} The old frame size of the parent view.
|
1430
|
-
*/
|
1431
|
-
resizeWithOldParentSize: function(oldSize) {
|
1432
|
-
this.viewFrameWillChange() ;
|
1433
|
-
this.viewFrameDidChange(YES) ;
|
1434
|
-
},
|
1435
|
-
|
1436
|
-
/** @private
|
1437
|
-
Handler for the onscroll event. Hooked in on init if isScrollable is
|
1438
|
-
true. Notify children that their clipping frame has changed.
|
1439
|
-
*/
|
1440
|
-
_onscroll: function() {
|
1441
|
-
this._scrollFrame = null ;
|
1442
|
-
this.notifyPropertyChange('scrollFrame') ;
|
1443
|
-
SC.Benchmark.start('%@.onscroll'.fmt(this)) ;
|
1444
|
-
this._invalidateClippingFrame() ;
|
1445
|
-
SC.Benchmark.end('%@.onscroll'.fmt(this)) ;
|
1446
|
-
},
|
1447
|
-
|
1448
|
-
_frameChangeLevel: 0,
|
1449
|
-
|
1450
|
-
/** @private
|
1451
|
-
Used internally to collect client offset and location info. If the
|
1452
|
-
element is not in the main window or hidden, it will be added temporarily
|
1453
|
-
and then the passed function will be called.
|
1454
|
-
*/
|
1455
|
-
_collectFrame: function(func) {
|
1456
|
-
var el = this.rootElement ;
|
1457
|
-
|
1458
|
-
// if not visible in window, move parent node into window and get
|
1459
|
-
// dim and offset. If the element has no parentNode, then just move
|
1460
|
-
// the element in.
|
1461
|
-
var isVisibleInWindow = this.get('isVisibleInWindow') ;
|
1462
|
-
if (!isVisibleInWindow) {
|
1463
|
-
var pn = el.parentNode || el ;
|
1464
|
-
if (pn === SC.window.rootElement) pn = el ;
|
1465
|
-
|
1466
|
-
var pnParent = pn.parentNode ; // cache former parent node
|
1467
|
-
var pnSib = pn.nextSibling ; // cache next sibling
|
1468
|
-
SC.window.rootElement.insertBefore(pn, null) ;
|
1469
|
-
}
|
1470
|
-
|
1471
|
-
// if view is not displayed, temporarily display it also
|
1472
|
-
var display = this.getStyle('display') ;
|
1473
|
-
var isHidden = !(display != 'none' && display != null) ;
|
1474
|
-
|
1475
|
-
// All *Width and *Height properties give 0 on elements with display none,
|
1476
|
-
// so enable the element temporarily
|
1477
|
-
if (isHidden) {
|
1478
|
-
var els = this.rootElement.style;
|
1479
|
-
var originalVisibility = els.visibility;
|
1480
|
-
var originalPosition = els.position;
|
1481
|
-
var originalDisplay = els.display;
|
1482
|
-
els.visibility = 'hidden';
|
1483
|
-
els.position = 'absolute';
|
1484
|
-
els.display = 'block';
|
1485
|
-
}
|
1486
|
-
|
1487
|
-
var ret = func.call(this) ;
|
1488
|
-
|
1489
|
-
if (isHidden) {
|
1490
|
-
els.display = originalDisplay;
|
1491
|
-
els.position = originalPosition;
|
1492
|
-
els.visibility = originalVisibility;
|
1493
|
-
}
|
1494
|
-
|
1495
|
-
if (!isVisibleInWindow) {
|
1496
|
-
if (pnParent) {
|
1497
|
-
pnParent.insertBefore(pn, pnSib) ;
|
1498
|
-
} else {
|
1499
|
-
if(pn.parentNode)
|
1500
|
-
SC.window.rootElement.removeChild(pn) ;
|
1501
|
-
}
|
1502
|
-
}
|
1503
|
-
|
1504
|
-
return ret;
|
1505
|
-
},
|
1506
|
-
|
1507
|
-
/** @private
|
1508
|
-
Called whenever some aspect of the receiver's frames have changed that
|
1509
|
-
probably has invalidated the child views clippingFrames. Events that cause
|
1510
|
-
this include:
|
1511
|
-
|
1512
|
-
- change to the innerFrame size
|
1513
|
-
- change to the scrollFrame
|
1514
|
-
- change to the clippingFrame
|
1515
|
-
|
1516
|
-
For performance reasons, this only passes onto children if they or a decendent
|
1517
|
-
implements the clippingFrameDidChange method.
|
1518
|
-
*/
|
1519
|
-
_invalidateChildrenClippingFrames: function() {
|
1520
|
-
var view = this.get('firstChild') ;
|
1521
|
-
while(view) {
|
1522
|
-
view._invalidateClippingFrame() ;
|
1523
|
-
view = view.get('nextSibling') ;
|
1524
|
-
}
|
1525
|
-
},
|
1526
|
-
|
1527
|
-
/** @private
|
1528
|
-
Called by a parentNode whenever the clippingFrame needs to be recalculated.
|
1529
|
-
*/
|
1530
|
-
_invalidateClippingFrame: function() {
|
1531
|
-
if (this.get('needsClippingFrame')) {
|
1532
|
-
this._clippingFrame = null ;
|
1533
|
-
this.clippingFrameDidChange() ;
|
1534
|
-
this.notifyPropertyChange('clippingFrame') ;
|
1535
|
-
this._invalidateChildrenClippingFrames() ;
|
1536
|
-
}
|
1537
|
-
},
|
1538
|
-
|
1539
|
-
// ..........................................
|
1540
|
-
// PROPERTIES
|
1541
|
-
//
|
1542
|
-
|
1543
|
-
/**
|
1544
|
-
Used to show or hide the view.
|
1545
|
-
|
1546
|
-
If this property is set to NO, then the DOM element will be hidden using
|
1547
|
-
display:none. You will often want to bind this property to some setting
|
1548
|
-
in your application to make various parts of your app visible as needed.
|
1549
|
-
|
1550
|
-
If you have animation enabled, then changing this property will actually
|
1551
|
-
trigger the animation to bring the view in or out.
|
1552
|
-
|
1553
|
-
The default binding format is SC.Binding.Bool
|
1554
|
-
|
1555
|
-
@field
|
1556
|
-
@type {Boolean}
|
1557
|
-
*/
|
1558
|
-
isVisible: true,
|
1559
|
-
|
1560
|
-
/** @private */
|
1561
|
-
isVisibleBindingDefault: SC.Binding.Bool,
|
1562
|
-
|
1563
|
-
/**
|
1564
|
-
(Read Only) The current display visibility of the view.
|
1565
|
-
|
1566
|
-
Usually, this property will mirror the current state of the isVisible
|
1567
|
-
property. However, if your view animates its visibility in and out, then
|
1568
|
-
this will not become false until the animation completes.
|
1569
|
-
|
1570
|
-
@type {Boolean}
|
1571
|
-
*/
|
1572
|
-
displayIsVisible: true,
|
1573
|
-
|
1574
|
-
/**
|
1575
|
-
true when the view is actually visible in the DOM window.
|
1576
|
-
|
1577
|
-
This property is set to true only when the view is (a) in the main DOM
|
1578
|
-
hierarchy and (b) all parent nodes are visible and (c) the receiver node
|
1579
|
-
is visible.
|
1580
|
-
|
1581
|
-
@type {Boolean}
|
1582
|
-
@field
|
1583
|
-
*/
|
1584
|
-
isVisibleInWindow: NO,
|
1585
|
-
|
1586
|
-
/**
|
1587
|
-
If true, the tooltip will be localized. Also used by some subclasses.
|
1588
|
-
|
1589
|
-
@type {Boolean}
|
1590
|
-
@field
|
1591
|
-
*/
|
1592
|
-
localize: false,
|
1593
|
-
|
1594
|
-
/**
|
1595
|
-
Applied to the title attribute of the rootElement DOM if set.
|
1596
|
-
|
1597
|
-
If localize is true, then the toolTip will be localized first.
|
1598
|
-
|
1599
|
-
@type {String}
|
1600
|
-
@field
|
1601
|
-
*/
|
1602
|
-
toolTip: '',
|
1603
|
-
|
1604
|
-
|
1605
|
-
/**
|
1606
|
-
The HTML you want to use when creating a new element.
|
1607
|
-
|
1608
|
-
You can specify the HTML as a string of text, using the NodeDescriptor, or
|
1609
|
-
by pointing directly to an element.
|
1610
|
-
|
1611
|
-
Note that as an optimization, SC.View will actually convert the value of
|
1612
|
-
this property to an actual DOM structure the first time you create a view
|
1613
|
-
and then clone the DOM structure for future views.
|
1614
|
-
|
1615
|
-
This means that in general you should only set the value of emptyElement
|
1616
|
-
when you create a view subclass. Changing this property value at other
|
1617
|
-
times will often have no effect.
|
1618
|
-
|
1619
|
-
@field
|
1620
|
-
@type {String}
|
1621
|
-
*/
|
1622
|
-
emptyElement: "<div></div>",
|
1623
|
-
|
1624
|
-
/**
|
1625
|
-
If true, view will display in a lightbox when you show it.
|
1626
|
-
|
1627
|
-
@field
|
1628
|
-
@type {Boolean}
|
1629
|
-
*/
|
1630
|
-
isPanel: false,
|
1631
|
-
|
1632
|
-
/**
|
1633
|
-
If true, the view should be modal when shown as a panel.
|
1634
|
-
|
1635
|
-
@field
|
1636
|
-
@type {Boolean}
|
1637
|
-
*/
|
1638
|
-
isModal: true,
|
1639
|
-
|
1640
|
-
/**
|
1641
|
-
Enable visible animation by default.
|
1642
|
-
*/
|
1643
|
-
isAnimationEnabled: true,
|
1644
|
-
|
1645
|
-
/**
|
1646
|
-
General support for animation. Just call this method and it will build
|
1647
|
-
and play an animation starting from the current state. The second param
|
1648
|
-
is optional. It should either be a hash of animator options or an
|
1649
|
-
animator object returned by a previous call to transitionTo().
|
1650
|
-
|
1651
|
-
*/
|
1652
|
-
transitionTo: function(target,animator,opts) {
|
1653
|
-
var animatorOptions = opts || {} ;
|
1654
|
-
|
1655
|
-
// Create or reset the animator.
|
1656
|
-
if (animator && !animator._isAnimator) {
|
1657
|
-
var finalStyle = animator ;
|
1658
|
-
if (!this.get("isAnimationEnabled")) {
|
1659
|
-
animatorOptions = Object.clone(animatorOptions) ;
|
1660
|
-
animatorOptions.duration = 1;
|
1661
|
-
}
|
1662
|
-
if (animatorOptions.duration) {
|
1663
|
-
animatorOptions.duration = parseInt(animatorOptions.duration,0) ;
|
1664
|
-
}
|
1665
|
-
|
1666
|
-
animator = Animator.apply(this.rootElement, finalStyle, animatorOptions);
|
1667
|
-
animator._isAnimator = true ;
|
1668
|
-
}
|
1669
|
-
|
1670
|
-
// trigger animation
|
1671
|
-
if (animator) {
|
1672
|
-
animator.jumpTo(animator.state) ;
|
1673
|
-
animator.seekTo(target) ;
|
1674
|
-
}
|
1675
|
-
return animator ;
|
1676
|
-
},
|
1677
|
-
|
1678
|
-
/**
|
1679
|
-
The contents of the view as HTML. You can use this property to both
|
1680
|
-
retrieve the content and to change it. Use this property instead of
|
1681
|
-
manually changing the content of your view as this property works around
|
1682
|
-
certain cross-browser bugs.
|
1683
|
-
|
1684
|
-
@field
|
1685
|
-
*/
|
1686
|
-
innerHTML: function(key, value) {
|
1687
|
-
if (value !== undefined) {
|
1688
|
-
|
1689
|
-
// Clear the text node.
|
1690
|
-
this._textNode = null ;
|
1691
|
-
|
1692
|
-
// Safari2 has a bad habit of sometimes not actually changing its
|
1693
|
-
// innerHTML. This will make sure the innerHTML get's changed properly.
|
1694
|
-
if (SC.isSafari() && !SC.isSafari3()) {
|
1695
|
-
var el = (this.containerElement || this.rootElement) ; var reps = 0 ;
|
1696
|
-
var f = function() {
|
1697
|
-
el.innerHTML = '' ; el.innerHTML = value ;
|
1698
|
-
if ((reps++ < 5) && (value.length>0) && (el.innerHTML == '')) {
|
1699
|
-
f.invokeLater() ;
|
1700
|
-
}
|
1701
|
-
};
|
1702
|
-
f();
|
1703
|
-
} else (this.containerElement || this.rootElement).innerHTML = value;
|
1704
|
-
} else value = (this.containerElement || this.rootElement).innerHTML ;
|
1705
|
-
return value ;
|
1706
|
-
}.property(),
|
1707
|
-
|
1708
|
-
/**
|
1709
|
-
The contents of the view as plain text. You can use this property to
|
1710
|
-
both retrieve the content and to change it. Use this property instead of
|
1711
|
-
the innerHTML property when you want to set plain text only as this
|
1712
|
-
property is much faster.
|
1713
|
-
|
1714
|
-
@field
|
1715
|
-
*/
|
1716
|
-
innerText: function(key, value) {
|
1717
|
-
if (value !== undefined) {
|
1718
|
-
if (value == null) value = '' ;
|
1719
|
-
|
1720
|
-
// add a textNode if necessary
|
1721
|
-
if (this._textNode == null) {
|
1722
|
-
this._textNode = document.createTextNode(value) ;
|
1723
|
-
var el = this.rootElement || this.containerElement ;
|
1724
|
-
while(el.firstChild) el.removeChild(el.firstChild) ;
|
1725
|
-
el.appendChild(this._textNode) ;
|
1726
|
-
} else this._textNode.data = value ;
|
1727
|
-
}
|
1728
|
-
|
1729
|
-
return (this._textNode) ? this._textNode.data : this.innerHTML().unescapeHTML() ;
|
1730
|
-
|
1731
|
-
}.property(),
|
1732
|
-
|
1733
|
-
|
1734
|
-
// ..........................................
|
1735
|
-
// SUPPORT METHODS
|
1736
|
-
//
|
1737
|
-
init: function() {
|
1738
|
-
arguments.callee.base.call(this) ;
|
1739
|
-
|
1740
|
-
// configure them outlets.
|
1741
|
-
if (SC.BENCHMARK_CONFIGURE_OUTLETS) SC.Benchmark.start('SC.View.configureOutlets') ;
|
1742
|
-
this.configureOutlets() ;
|
1743
|
-
if (SC.BENCHMARK_CONFIGURE_OUTLETS) SC.Benchmark.end('SC.View.configureOutlets') ;
|
1744
|
-
|
1745
|
-
var toolTip = this.get('toolTip') ;
|
1746
|
-
if(toolTip && (toolTip != '')) this._updateToolTipObserver();
|
1747
|
-
|
1748
|
-
// if container element is a string, convert it to an actual DOM element.
|
1749
|
-
if (this.containerElement && ($type(this.containerElement) === T_STRING)) {
|
1750
|
-
this.containerElement = this.$sel(this.containerElement);
|
1751
|
-
}
|
1752
|
-
|
1753
|
-
// register as a drop target and scrollable.
|
1754
|
-
if (this.get('isDropTarget')) SC.Drag.addDropTarget(this) ;
|
1755
|
-
if (this.get('isScrollable')) SC.Drag.addScrollableView(this) ;
|
1756
|
-
|
1757
|
-
// add scrollable handler
|
1758
|
-
if (this.isScrollable) this.rootElement.onscroll = SC.View._onscroll ;
|
1759
|
-
|
1760
|
-
// setup isVisibleInWindow ;
|
1761
|
-
this.isVisibleInWindow = (this.parentNode) ? this.parentNode.get('isVisibleInWindow') : NO;
|
1762
|
-
},
|
1763
|
-
|
1764
|
-
// this method looks through your outlets array and will try to
|
1765
|
-
// reconfigure any missing ones.
|
1766
|
-
configureOutlets: function() {
|
1767
|
-
|
1768
|
-
if (!this.outlets || (this.outlets.length <= 0)) return ;
|
1769
|
-
|
1770
|
-
// lookup outlets as selector paths or execute the function if there
|
1771
|
-
// is one.
|
1772
|
-
this.beginPropertyChanges(); // bundle changes
|
1773
|
-
for(var oloc=0;oloc < this.outlets.length;oloc++) {
|
1774
|
-
var view = this.outlet(this.outlets[oloc]) ;
|
1775
|
-
}
|
1776
|
-
this.endPropertyChanges() ;
|
1777
|
-
},
|
1778
|
-
|
1779
|
-
// ..........................................
|
1780
|
-
// VISIBILITY METHODS
|
1781
|
-
//
|
1782
|
-
|
1783
|
-
// Calling this method will show the view. Don't call this method
|
1784
|
-
// directly but instead set the isVisible property to true. You can
|
1785
|
-
// override this method to provide your own show capabilities.
|
1786
|
-
show: function() {
|
1787
|
-
Element.show(this.rootElement) ;
|
1788
|
-
this.removeClassName('hidden') ;
|
1789
|
-
this.set('displayIsVisible',true) ;
|
1790
|
-
},
|
1791
|
-
|
1792
|
-
// This is the primitive method for hiding a view. It will be called when
|
1793
|
-
// isVisible is set to false after an animation runs or immediate if no
|
1794
|
-
// animation is defined.
|
1795
|
-
hide: function() {
|
1796
|
-
Element.hide(this.rootElement) ;
|
1797
|
-
this.addClassName('hidden') ;
|
1798
|
-
this.set('displayIsVisible', false) ;
|
1799
|
-
},
|
1800
|
-
|
1801
|
-
// ..........................................
|
1802
|
-
// DEPRECATED. DO NOT USE
|
1803
|
-
//
|
1804
|
-
|
1805
|
-
// deprecated. Included only for compatibility.
|
1806
|
-
animateVisible: function(key, value) {
|
1807
|
-
if (value !== undefined) return this.set('isAnimationEnabled',value) ;
|
1808
|
-
return this.get('isAnimationEnabled');
|
1809
|
-
}.property('isAnimationEnabled'),
|
1810
|
-
|
1811
|
-
|
1812
|
-
// ..........................................
|
1813
|
-
// PRIVATE METHODS
|
1814
|
-
//
|
1815
|
-
|
1816
|
-
// this will set the rootElement, cleaning up any old element.
|
1817
|
-
_attachRootElement: function(el) {
|
1818
|
-
if (this.rootElement) this.rootElement._configured = null ;
|
1819
|
-
this.rootElement = el ;
|
1820
|
-
el._configured = this._guid ;
|
1821
|
-
},
|
1822
|
-
|
1823
|
-
// This method is called internally after you add or remove a child view.
|
1824
|
-
// It will rebuild the childNodes array to reflect all children.
|
1825
|
-
_rebuildChildNodes: function() {
|
1826
|
-
var ret = [] ; var view = this.firstChild;
|
1827
|
-
while(view) { ret.push(view); view = view.nextSibling; }
|
1828
|
-
this.set('childNodes', ret) ;
|
1829
|
-
},
|
1830
|
-
|
1831
|
-
_toolTipObserver: function() {
|
1832
|
-
var toolTip = this.get('toolTip') ;
|
1833
|
-
if (this.get('localize')) toolTip = toolTip.loc() ;
|
1834
|
-
this.rootElement.title = toolTip ;
|
1835
|
-
}.observes("toolTip"),
|
1836
|
-
|
1837
|
-
_isVisibleObserver: function() {
|
1838
|
-
var flag = this.get('isVisible') ;
|
1839
|
-
if ((this._isVisible === undefined) || (flag != this._isVisible)) {
|
1840
|
-
this._isVisible = flag ;
|
1841
|
-
if (flag) {
|
1842
|
-
this._show() ;
|
1843
|
-
} else this._hide() ;
|
1844
|
-
|
1845
|
-
// update parent state.
|
1846
|
-
this._updateIsVisibleInWindow() ;
|
1847
|
-
}
|
1848
|
-
}.observes('isVisible'),
|
1849
|
-
|
1850
|
-
_updateIsVisibleInWindow: function(parentNodeState) {
|
1851
|
-
if (parentNodeState === undefined) {
|
1852
|
-
var parentNode = this.get('parentNode') ;
|
1853
|
-
parentNodeState = (parentNode) ? parentNode.get('isVisibleInWindow') : false ;
|
1854
|
-
}
|
1855
|
-
|
1856
|
-
var visible = parentNodeState && this.get('isVisible') ;
|
1857
|
-
|
1858
|
-
// if state changes, update and notify children.
|
1859
|
-
if (visible != this.get('isVisibleInWindow')) {
|
1860
|
-
this.set('isVisibleInWindow', visible) ;
|
1861
|
-
this.recacheFrames() ;
|
1862
|
-
var child = this.get('firstChild') ;
|
1863
|
-
while(child) {
|
1864
|
-
child._updateIsVisibleInWindow(visible) ;
|
1865
|
-
child = child.get('nextSibling') ;
|
1866
|
-
}
|
1867
|
-
}
|
1868
|
-
},
|
1869
|
-
|
1870
|
-
// Calling this method will show the view. Don't call this method
|
1871
|
-
// directly but instead set the isVisible property to true. You can
|
1872
|
-
// override this method to provide your own show capabilities.
|
1873
|
-
_show: function(anchorView, triggerEvent) {
|
1874
|
-
// compatibility
|
1875
|
-
if (this.showView) return this.showView() ;
|
1876
|
-
|
1877
|
-
// if this is a type of pane, call the pane manager.
|
1878
|
-
var paneType = this.get('paneType') ;
|
1879
|
-
if (this.get('isPanel')) paneType = SC.PANEL_PANE; // compatibility
|
1880
|
-
if (paneType) {
|
1881
|
-
if (anchorView === undefined) anchorView = null ;
|
1882
|
-
if (triggerEvent === undefined) triggerEvent = null ;
|
1883
|
-
SC.PaneManager.manager().showPaneView(this, paneType, anchorView, triggerEvent) ;
|
1884
|
-
this.set('displayIsVisible', true) ;
|
1885
|
-
|
1886
|
-
// if an animation is defined and animations are configured, use that.
|
1887
|
-
// the displayIsVisible property will be set to true when the animation
|
1888
|
-
// completes.
|
1889
|
-
} else if (this.visibleAnimation && this.get('isAnimationEnabled')) {
|
1890
|
-
this._transitionVisibleTo(1.0) ;
|
1891
|
-
|
1892
|
-
// at this point the animation has been reset to the beginng. Run the
|
1893
|
-
// core show() method immediately so the animation will be visible.
|
1894
|
-
this.show() ;
|
1895
|
-
|
1896
|
-
// otherwise, just change over visible settings.
|
1897
|
-
} else {
|
1898
|
-
this._visibleAnimator = null ;
|
1899
|
-
this.show() ;
|
1900
|
-
}
|
1901
|
-
|
1902
|
-
return this ;
|
1903
|
-
},
|
1904
|
-
|
1905
|
-
_hide: function() {
|
1906
|
-
// compatibility
|
1907
|
-
if (this.hideView) return this.hideView() ;
|
1908
|
-
|
1909
|
-
// if this is a type of pane, call the pane manager.
|
1910
|
-
var isPane = (!!this.get('paneType')) || this.get('isPanel') ;
|
1911
|
-
if (isPane) {
|
1912
|
-
SC.PaneManager.manager().hidePaneView(this) ;
|
1913
|
-
this.set('displayIsVisible', false) ;
|
1914
|
-
|
1915
|
-
// if an animation is defined and animations are configured, use that.
|
1916
|
-
// the displayIsVisible property will be set to false when the animation
|
1917
|
-
// completes.
|
1918
|
-
} else if (this.visibleAnimation && this.get('isAnimationEnabled')) {
|
1919
|
-
this._transitionVisibleTo(0.0) ;
|
1920
|
-
|
1921
|
-
// otherwise, just change over visible settings.
|
1922
|
-
} else {
|
1923
|
-
this._visibleAnimator = null;
|
1924
|
-
this.hide();
|
1925
|
-
}
|
1926
|
-
|
1927
|
-
return this ;
|
1928
|
-
},
|
1929
|
-
|
1930
|
-
|
1931
|
-
_transitionVisibleTo: function(target) {
|
1932
|
-
var a ;
|
1933
|
-
|
1934
|
-
// if an animator already exists, just transition to the new state.
|
1935
|
-
if (this._visibleAnimator) {
|
1936
|
-
this.transitionTo(target,this._visibleAnimator);
|
1937
|
-
|
1938
|
-
// otherwise, build the animator from the options passed. Patch in our
|
1939
|
-
// own onComplete handler.
|
1940
|
-
} else {
|
1941
|
-
var opts = this.visibleAnimation ;
|
1942
|
-
var style = [opts.hidden,opts.visible] ;
|
1943
|
-
opts.onComplete =
|
1944
|
-
this._animateVisibleDidComplete.bind(this,opts.onComplete) ;
|
1945
|
-
this._visibleAnimator = this.transitionTo(target,style,opts);
|
1946
|
-
}
|
1947
|
-
},
|
1948
|
-
|
1949
|
-
// This is called when the animation completes. Finish cleaning up the
|
1950
|
-
// visibility section.
|
1951
|
-
_animateVisibleDidComplete: function(chainFunc) {
|
1952
|
-
if (!this.get('isVisible')) this.hide() ;
|
1953
|
-
if (chainFunc) chainFunc(this) ;
|
1954
|
-
},
|
1955
|
-
|
1956
|
-
_firstResponderObserver: function(target, key, value) {
|
1957
|
-
this.setClassName('focus',value) ;
|
1958
|
-
}.observes('isFirstResponder'),
|
1959
|
-
|
1960
|
-
_dropTargetObserver: function() {
|
1961
|
-
if (this.get('isDropTarget')) {
|
1962
|
-
SC.Drag.addDropTarget(this) ;
|
1963
|
-
} else SC.Drag.removeDropTarget(this) ;
|
1964
|
-
}.observes('isDropTarget'),
|
1965
|
-
|
1966
|
-
// .............................................
|
1967
|
-
// SPECIAL TYPES OF VIEWS
|
1968
|
-
//
|
1969
|
-
|
1970
|
-
// This will show the pane as a popup or picker (depending on the paneType
|
1971
|
-
// you have set.) This works just like setting isVisible to true, except
|
1972
|
-
// that it also passes the anchorView and triggerEvent you pass in.
|
1973
|
-
popup: function(anchorView, triggerEvent) {
|
1974
|
-
|
1975
|
-
// this will bypass the normal observer machinery, calling the private
|
1976
|
-
// _show method ourselves. To avoid triggering _show twice, we patch up
|
1977
|
-
// the internal _isVisible property.
|
1978
|
-
this._isVisible = true ;
|
1979
|
-
this._show(anchorView, triggerEvent) ;
|
1980
|
-
this.set('isVisible', true);
|
1981
|
-
},
|
1982
|
-
|
1983
|
-
// This can be used to manually add observers to the rootElement for the
|
1984
|
-
// methods in the passed map. You generally don't want to do this since we
|
1985
|
-
// handle event propgation through the responder chain.
|
1986
|
-
configureObserverMethods: function(methodMap) {
|
1987
|
-
for(var name in methodMap) {
|
1988
|
-
if (!methodMap.hasOwnProperty(name)) continue ;
|
1989
|
-
if (this[name]) {
|
1990
|
-
var method = this[name].bindAsEventListener(this);
|
1991
|
-
Event.observe(this.rootElement,methodMap[name],method) ;
|
1992
|
-
}
|
1993
|
-
}
|
1994
|
-
}//,
|
1995
|
-
|
1996
|
-
// toString: function() {
|
1997
|
-
// var el = this.rootElement ;
|
1998
|
-
// var tagName = (!!el.tagName) ? el.tagName.toLowerCase() : 'document' ;
|
1999
|
-
//
|
2000
|
-
// var className = el.className ;
|
2001
|
-
// className = (className && className.length>0) ? 'class=%@'.fmt(className) : null;
|
2002
|
-
//
|
2003
|
-
// var idName = el.id ;
|
2004
|
-
// idName = (idName && idName.length>0) ? 'id=%@'.fmt(idName) : null;
|
2005
|
-
//
|
2006
|
-
// return "%@:%@<%@>".fmt(this._type, this._guid, [tagName,idName, className].compact().join(' ')) ;
|
2007
|
-
// }
|
2008
|
-
|
2009
|
-
}) ;
|
2010
|
-
|
2011
|
-
// Class Methods
|
2012
|
-
SC.View.mixin({
|
2013
|
-
|
2014
|
-
// this is the global registry of views. It's used to map elements back
|
2015
|
-
// to the views that own them.
|
2016
|
-
_view: {},
|
2017
|
-
|
2018
|
-
findViewForElement: function(el) {
|
2019
|
-
var guid = el._configured ;
|
2020
|
-
return (guid) ? SC.View._view[guid] : null ;
|
2021
|
-
},
|
2022
|
-
|
2023
|
-
// ..........................................
|
2024
|
-
// SETUP
|
2025
|
-
//
|
2026
|
-
// This works much like create except that it works on the passed in
|
2027
|
-
// element instead of trying to find something new. If you pass null for
|
2028
|
-
// the first parameter, then a new element will be created with the html
|
2029
|
-
// you set in content.
|
2030
|
-
viewFor: function(el,config) {
|
2031
|
-
if (el) el = $(el) ;
|
2032
|
-
|
2033
|
-
var r = SC.idt.active ; var vStart ;
|
2034
|
-
if (r) SC.idt.v_count++;
|
2035
|
-
|
2036
|
-
if (r) vStart = new Date().getTime() ;
|
2037
|
-
|
2038
|
-
// find or build the element.
|
2039
|
-
if (!el) {
|
2040
|
-
var emptyElement = this.prototype._cachedEmptyElement || this.prototype.emptyElement;
|
2041
|
-
|
2042
|
-
// if the emptyElement is a string not starting with '<', treat it like
|
2043
|
-
// an id and find it in the doc. If an element is found, cache it for
|
2044
|
-
// future use.
|
2045
|
-
var isString = typeof(emptyElement) == 'string' ;
|
2046
|
-
if (isString && (emptyElement.slice(0,1) != '<')) {
|
2047
|
-
var el = $sel(emptyElement) ;
|
2048
|
-
if (el) {
|
2049
|
-
this.prototype.emptyElement = emptyElement = el ;
|
2050
|
-
isString = false ;
|
2051
|
-
}
|
2052
|
-
}
|
2053
|
-
|
2054
|
-
// if still a string, then use it to create HTML. Save the generated
|
2055
|
-
// element so that we can avoid doing this over again.
|
2056
|
-
if (isString) {
|
2057
|
-
SC._ViewCreator.innerHTML = emptyElement ;
|
2058
|
-
el = $(SC._ViewCreator.firstChild) ;
|
2059
|
-
SC.NodeCache.appendChild(el) ;
|
2060
|
-
this.prototype._cachedEmptyElement = el.cloneNode(true) ;
|
2061
|
-
|
2062
|
-
} else if (typeof(emptyElement) == "object") {
|
2063
|
-
if (emptyElement.tagName) {
|
2064
|
-
el = emptyElement.cloneNode(true) ;
|
2065
|
-
} else el = SC.NodeDescriptor.create(emptyElement) ;
|
2066
|
-
}
|
2067
|
-
}
|
2068
|
-
if (r) SC.idt.vc_t += (new Date().getTime()) - vStart ;
|
2069
|
-
|
2070
|
-
// configure only once.
|
2071
|
-
if (el && el._configured) return SC.View.findViewForElement(el);
|
2072
|
-
|
2073
|
-
// Now that we have found an element, instantiate the view.
|
2074
|
-
var args = SC.$A(arguments) ; args[0] = { rootElement: el } ;
|
2075
|
-
if (r) vStart = new Date().getTime();
|
2076
|
-
var ret = new this(args,this) ; // create instance.
|
2077
|
-
if (r) SC.idt.v_t += (new Date().getTime()) - vStart;
|
2078
|
-
el._configured = ret._guid ;
|
2079
|
-
|
2080
|
-
// return the view.
|
2081
|
-
SC.View._view[ret._guid] = ret ;
|
2082
|
-
return ret ;
|
2083
|
-
},
|
2084
|
-
|
2085
|
-
// create in the view work is like viewFor but with 'null' for el
|
2086
|
-
create: function(configs) {
|
2087
|
-
var args = SC.$A(arguments) ;
|
2088
|
-
args.unshift(null) ;
|
2089
|
-
return this.viewFor.apply(this,args) ;
|
2090
|
-
},
|
2091
|
-
|
2092
|
-
// extend works just like a normal extend except that we need to delete the cached empty
|
2093
|
-
// element.
|
2094
|
-
extend: function(configs) {
|
2095
|
-
var ret = SC.Object.extend.apply(this, arguments) ;
|
2096
|
-
ret.prototype._cachedEmptyElement = null ;
|
2097
|
-
return ret ;
|
2098
|
-
},
|
2099
|
-
|
2100
|
-
/**
|
2101
|
-
Defines a view as an outlet. This will return an function that
|
2102
|
-
can be executed at a later time to actually create itself as an outlet.
|
2103
|
-
*/
|
2104
|
-
outletFor: function(path) {
|
2105
|
-
var viewClass = this ; // save the view class
|
2106
|
-
var func = function() {
|
2107
|
-
if (SC.BENCHMARK_OUTLETS) SC.Benchmark.start("OUTLET(%@)".format(path)) ;
|
2108
|
-
|
2109
|
-
// if no path was passed, then create the view from scratch
|
2110
|
-
if (path == null) {
|
2111
|
-
var ret = viewClass.viewFor(null) ;
|
2112
|
-
|
2113
|
-
// otherwise, try to find the HTML element identified by the path.
|
2114
|
-
// If the element cannot be found in the caller (the owner view), then
|
2115
|
-
// search the entire document.
|
2116
|
-
} else {
|
2117
|
-
var ret = (this.$$sel) ? this.$$sel(path) : $$sel(path) ;
|
2118
|
-
|
2119
|
-
// if some HTML has been found, then loop through and create views for each
|
2120
|
-
// one. Be sure to setup the proper parent view.
|
2121
|
-
if (ret) {
|
2122
|
-
var owner = this ; var views = [] ;
|
2123
|
-
for(var loc=0;loc<ret.length;loc++) {
|
2124
|
-
|
2125
|
-
// create the new view instance
|
2126
|
-
var view = viewClass.viewFor(ret[loc], { owner: owner }) ;
|
2127
|
-
|
2128
|
-
// if successful, then we need to determine the new parentNode.
|
2129
|
-
// then walk up the DOM tree to find the first parent element
|
2130
|
-
// managed by a view (including this).
|
2131
|
-
//
|
2132
|
-
// If a matching view is not found, but the view IS in a DOM
|
2133
|
-
// somewhere then make the view a child of either SC.page or
|
2134
|
-
// SC.window.
|
2135
|
-
//
|
2136
|
-
// Add the view to the list of child views also.
|
2137
|
-
//
|
2138
|
-
if (view && view.rootElement && view.rootElement.parentNode) {
|
2139
|
-
var node = view.rootElement.parentNode;
|
2140
|
-
var parentView = null ;
|
2141
|
-
|
2142
|
-
// go up the chain. stop when we find a parent view, or the rootElement
|
2143
|
-
// for SC.page.
|
2144
|
-
while(node && !parentView) {
|
2145
|
-
switch(node) {
|
2146
|
-
case this.rootElement:
|
2147
|
-
parentView = this;
|
2148
|
-
break ;
|
2149
|
-
case SC.page.rootElement:
|
2150
|
-
parentView = SC.page ;
|
2151
|
-
break;
|
2152
|
-
case SC.window.rootElement:
|
2153
|
-
parentView = SC.window ;
|
2154
|
-
break;
|
2155
|
-
default:
|
2156
|
-
node = node.parentNode ;
|
2157
|
-
}
|
2158
|
-
}
|
2159
|
-
|
2160
|
-
// if a parentView was found, then add to parentView.
|
2161
|
-
if (parentView) {
|
2162
|
-
parentView._insertBefore(view,null,false) ;
|
2163
|
-
parentView._rebuildChildNodes() ; // this is not done with _insertBefore.
|
2164
|
-
view._updateIsVisibleInWindow();
|
2165
|
-
}
|
2166
|
-
|
2167
|
-
// view is not in a DOM. nothing to do.
|
2168
|
-
}
|
2169
|
-
|
2170
|
-
// add to return array
|
2171
|
-
views[views.length] = view ;
|
2172
|
-
|
2173
|
-
}
|
2174
|
-
ret = views ;
|
2175
|
-
ret = (ret.length == 0) ? null : ((ret.length == 1) ? ret[0] : ret);
|
2176
|
-
}
|
2177
|
-
|
2178
|
-
}
|
2179
|
-
|
2180
|
-
if (SC.BENCHMARK_OUTLETS) SC.Benchmark.end("OUTLET(%@)".format(path)) ;
|
2181
|
-
return ret ;
|
2182
|
-
} ;
|
2183
|
-
func.isOutlet = true ;
|
2184
|
-
return func ;
|
2185
|
-
},
|
2186
|
-
|
2187
|
-
automaticOutletFor: function() {
|
2188
|
-
var ret = this.outletFor.apply(this, arguments) ;
|
2189
|
-
ret.autoconfiguredOutlet = YES ;
|
2190
|
-
return ret ;
|
2191
|
-
}
|
2192
|
-
|
2193
|
-
}) ;
|
2194
|
-
|
2195
|
-
// IE Specfic Overrides
|
2196
|
-
if (SC.Platform.IE) {
|
2197
|
-
SC.View.prototype.getStyle = function(style) {
|
2198
|
-
var element = this.rootElement ;
|
2199
|
-
|
2200
|
-
// collect value
|
2201
|
-
style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
|
2202
|
-
var value = element.style[style];
|
2203
|
-
if (!value && element.currentStyle) value = element.currentStyle[style];
|
2204
|
-
|
2205
|
-
// handle opacity
|
2206
|
-
if (style === 'opacity') {
|
2207
|
-
if (value = (this.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) {
|
2208
|
-
if (value[1]) value = parseFloat(value[1]) / 100;
|
2209
|
-
}
|
2210
|
-
value = 1.0;
|
2211
|
-
}
|
2212
|
-
|
2213
|
-
// handle auto
|
2214
|
-
if (value === 'auto') {
|
2215
|
-
switch(style) {
|
2216
|
-
case 'width':
|
2217
|
-
if (this.getStyle('display') === 'none') {
|
2218
|
-
value = null ;
|
2219
|
-
} else if (element.currentStyle) {
|
2220
|
-
var paddingLeft = parseInt(element.currentStyle.paddingLeft,0)||0;
|
2221
|
-
var paddingRight = parseInt(element.currentStyle.paddingRight,0)||0;
|
2222
|
-
var borderLeftWidth = parseInt(element.currentStyle.borderLeftWidth, 0) || 0 ;
|
2223
|
-
var borderRightWidth = parseInt(element.currentStyle.borderRightWidth, 0) || 0 ;
|
2224
|
-
value = (element.offsetWidth - paddingLeft - paddingRight - borderLeftWidth - borderRightWidth) + 'px' ;
|
2225
|
-
}
|
2226
|
-
break ;
|
2227
|
-
case 'height':
|
2228
|
-
if (this.getStyle('display') === 'none') {
|
2229
|
-
value = null ;
|
2230
|
-
} else if (element.currentStyle) {
|
2231
|
-
var paddingTop = parseInt(element.currentStyle.paddingTop,0)||0;
|
2232
|
-
var paddingBottom = parseInt(element.currentStyle.paddingBottom,0)||0;
|
2233
|
-
var borderTopWidth = parseInt(element.currentStyle.borderTopWidth, 0) || 0 ;
|
2234
|
-
var borderBottomWidth = parseInt(element.currentStyle.borderBottomWidth, 0) || 0 ;
|
2235
|
-
value = (element.offsetHeight - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth) + 'px' ;
|
2236
|
-
}
|
2237
|
-
|
2238
|
-
break ;
|
2239
|
-
default:
|
2240
|
-
value = null ;
|
2241
|
-
}
|
2242
|
-
}
|
2243
|
-
|
2244
|
-
return value;
|
2245
|
-
};
|
2246
|
-
|
2247
|
-
// Called from innerFrame to actually collect the values for the innerFrame.
|
2248
|
-
// Normally the value we want for the width/height is stored in clientWidth/
|
2249
|
-
// height but in IE this is only good if the element hasLayout. In this
|
2250
|
-
// case always use the scrollWidth/Height.
|
2251
|
-
SC.View._collectInnerFrame = function() {
|
2252
|
-
var el = this.rootElement ;
|
2253
|
-
var hasLayout = (el.currentStyle) ? el.currentStyle.hasLayout : false ;
|
2254
|
-
var borderTopWidth = parseInt(el.currentStyle.borderTopWidth, 0) || 0 ;
|
2255
|
-
var borderBottomWidth = parseInt(el.currentStyle.borderBottomWidth, 0) || 0 ;
|
2256
|
-
var scrollHeight = el.offsetHeight - borderTopWidth - borderBottomWidth ;
|
2257
|
-
if (el.clientWidth > el.scrollWidth) scrollHeight - 15 ;
|
2258
|
-
|
2259
|
-
return {
|
2260
|
-
x: el.offsetLeft,
|
2261
|
-
y: el.offsetTop,
|
2262
|
-
width: (hasLayout) ? Math.min(el.scrollWidth, el.clientWidth) : el.scrollWidth,
|
2263
|
-
height: (hasLayout) ? Math.min(scrollHeight, el.clientHeight) : scrollHeight
|
2264
|
-
};
|
2265
|
-
} ;
|
2266
|
-
|
2267
|
-
} else {
|
2268
|
-
|
2269
|
-
// Called from innerFrame to actually collect the values for the innerFrame.
|
2270
|
-
// This method should return the smaller of the scrollWidth/height (which
|
2271
|
-
// will be set if the element is scrollable), or the clientWdith/height
|
2272
|
-
// (which is set if the element is not scrollable).
|
2273
|
-
SC.View._collectInnerFrame = function() {
|
2274
|
-
var el = this.rootElement ;
|
2275
|
-
return {
|
2276
|
-
x: el.offsetLeft,
|
2277
|
-
y: el.offsetTop,
|
2278
|
-
width: Math.min(el.scrollWidth, el.clientWidth),
|
2279
|
-
height: Math.min(el.scrollHeight, el.clientHeight)
|
2280
|
-
};
|
2281
|
-
} ;
|
2282
|
-
}
|
2283
|
-
|
2284
|
-
|
2285
|
-
// this handler goes through the guid to avoid any potential memory leaks
|
2286
|
-
SC.View._onscroll = function(evt) { $view(this)._onscroll(evt); } ;
|
2287
|
-
|
2288
|
-
SC.View.WIDTH_PADDING_STYLES = ['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'];
|
2289
|
-
|
2290
|
-
SC.View.HEIGHT_PADDING_STYLES = ['paddingTop', 'paddingBottom', 'borderTopWidth', 'borderBottomWidth'];
|
2291
|
-
|
2292
|
-
SC.View.SCROLL_WIDTH_PADDING_STYLES = ['borderLeftWidth', 'borderRightWidth'];
|
2293
|
-
SC.View.SCROLL_HEIGHT_PADDING_STYLES = ['borderTopWidth', 'borderBottomWidth'];
|
2294
|
-
|
2295
|
-
SC.View.elementFor = SC.View.viewFor ; // Old Sprout Compatibility.
|
2296
|
-
|
2297
|
-
// This div is used to create nodes. It should normally remain empty.
|
2298
|
-
SC._ViewCreator = document.createElement('div') ;
|
2299
|
-
|
2300
|
-
// This div can be used to hold elements you don't want on the page right now.
|
2301
|
-
SC.NodeCache = document.createElement('div') ;
|