sproutcore 1.0.1046 → 1.0.1049.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- data/DISTRIBUTION.yml +7 -1
- data/Gemfile +3 -0
- data/Rakefile +179 -91
- data/VERSION.yml +4 -4
- data/bin/sc-server +1 -2
- data/frameworks/sproutcore/Buildfile +35 -12
- data/frameworks/sproutcore/Gemfile +8 -0
- data/frameworks/sproutcore/Gemfile.lock +33 -0
- data/frameworks/sproutcore/README.md +68 -0
- data/frameworks/sproutcore/apps/docs/english.lproj/loading.rhtml +1 -1
- data/frameworks/sproutcore/apps/greenhouse/README +25 -0
- data/frameworks/sproutcore/apps/greenhouse/TODO +72 -0
- data/frameworks/sproutcore/apps/greenhouse/beautify.js +1058 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/design.js +20 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/file.js +75 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/files.js +40 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/layout.js +53 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/library.js +243 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/page.js +18 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/property.js +19 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/property_editor.js +17 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/target.js +20 -0
- data/frameworks/sproutcore/apps/greenhouse/controllers/targets.js +43 -0
- data/frameworks/sproutcore/apps/greenhouse/core.js +67 -0
- data/frameworks/sproutcore/apps/greenhouse/core_file.js +124 -0
- data/frameworks/sproutcore/apps/greenhouse/data_source.js +250 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/app_page.js +377 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/app-selector.css +111 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/button.css +310 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/dock.css +85 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/general.css +52 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/main-page.css +120 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/menu.css +52 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/modal.css +40 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/picker.css +188 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/search.css +60 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/tabbed.css +68 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/text-field.css +67 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/dialogs.js +278 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.eot +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.otf +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.woff +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.eot +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.otf +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.woff +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/app-selector/choose-app.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/app-selector/list-item-sel.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/regular-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/regular-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/active-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/disabled-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/regular-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-active-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-disabled-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-m.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/disabled-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/disabled-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/regular-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/regular-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-active-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-active-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-r.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/actions-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/actions.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/inspector-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/inspector.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/library-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/library.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/projects-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/projects.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/run-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/run.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/save-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/save.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/logos/greenhouse-l.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/logos/greenhouse-s.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/logos/sproutcore.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/main-bg.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom-left.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom-right.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/close-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/close.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/left.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-bottom.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-left.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-right.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-top.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/right.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/search-active.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/search.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/top-left.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/top-right.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/top.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/toolbar-bg.png +0 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/inspectors.js +365 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/loading.rhtml +9 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/main_page.js +95 -0
- data/frameworks/sproutcore/apps/greenhouse/english.lproj/strings.js +84 -0
- data/frameworks/sproutcore/apps/greenhouse/fixtures/file.js +35 -0
- data/frameworks/sproutcore/apps/greenhouse/main.js +28 -0
- data/frameworks/sproutcore/apps/greenhouse/mixins/drop_down.js +97 -0
- data/frameworks/sproutcore/apps/greenhouse/models/design.js +22 -0
- data/frameworks/sproutcore/apps/greenhouse/models/dir.js +92 -0
- data/frameworks/sproutcore/apps/greenhouse/models/file.js +51 -0
- data/frameworks/sproutcore/apps/greenhouse/models/target.js +82 -0
- data/frameworks/sproutcore/apps/greenhouse/models/view_config.js +49 -0
- data/frameworks/sproutcore/apps/greenhouse/resources/test_page.js +37 -0
- data/frameworks/sproutcore/apps/greenhouse/states/inspector.js +144 -0
- data/frameworks/sproutcore/apps/greenhouse/states/library.js +133 -0
- data/frameworks/sproutcore/apps/greenhouse/states/main.js +223 -0
- data/frameworks/sproutcore/apps/greenhouse/states/modals.js +281 -0
- data/frameworks/sproutcore/apps/greenhouse/states/ready.js +197 -0
- data/frameworks/sproutcore/apps/greenhouse/tests/controllers/design.js +15 -0
- data/frameworks/sproutcore/apps/greenhouse/tests/controllers/designs.js +15 -0
- data/frameworks/sproutcore/apps/greenhouse/tests/controllers/file.js +15 -0
- data/frameworks/sproutcore/apps/greenhouse/tests/controllers/files.js +15 -0
- data/frameworks/sproutcore/apps/greenhouse/tests/models/file.js +15 -0
- data/frameworks/sproutcore/apps/greenhouse/tests/models/view_config.js +15 -0
- data/frameworks/sproutcore/apps/greenhouse/tests/views/list_item.js +15 -0
- data/frameworks/sproutcore/apps/greenhouse/views/anchor.js +277 -0
- data/frameworks/sproutcore/apps/greenhouse/views/application_list_item.js +19 -0
- data/frameworks/sproutcore/apps/greenhouse/views/event_blocker.js +32 -0
- data/frameworks/sproutcore/apps/greenhouse/views/label_designer.js +16 -0
- data/frameworks/sproutcore/apps/greenhouse/views/list_item.js +42 -0
- data/frameworks/sproutcore/apps/greenhouse/views/plist_item.js +39 -0
- data/frameworks/sproutcore/apps/greenhouse/views/simple_button.js +157 -0
- data/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js +56 -0
- data/frameworks/sproutcore/apps/greenhouse/views/web.js +44 -0
- data/frameworks/sproutcore/apps/test_controls/Buildfile +0 -0
- data/frameworks/sproutcore/apps/test_controls/controllers/categories.js +108 -0
- data/frameworks/sproutcore/apps/test_controls/controllers/category.js +31 -0
- data/frameworks/sproutcore/apps/test_controls/core.js +29 -0
- data/frameworks/sproutcore/apps/test_controls/main.js +14 -0
- data/frameworks/sproutcore/apps/test_controls/resources/buttons_page.js +124 -0
- data/frameworks/sproutcore/apps/test_controls/resources/checkboxes_page.js +45 -0
- data/frameworks/sproutcore/apps/test_controls/resources/flow_layout_page.js +77 -0
- data/frameworks/sproutcore/apps/test_controls/resources/list_page.js +40 -0
- data/frameworks/sproutcore/apps/test_controls/resources/loading.rhtml +9 -0
- data/frameworks/sproutcore/apps/test_controls/resources/main_page.css +54 -0
- data/frameworks/sproutcore/apps/test_controls/resources/main_page.js +136 -0
- data/frameworks/sproutcore/apps/test_controls/resources/progress_page.js +42 -0
- data/frameworks/sproutcore/apps/test_controls/resources/radio_page.js +41 -0
- data/frameworks/sproutcore/apps/test_controls/resources/scroll_page.js +76 -0
- data/frameworks/sproutcore/apps/test_controls/resources/segmented_page.js +75 -0
- data/frameworks/sproutcore/apps/test_controls/resources/select_page.js +60 -0
- data/frameworks/sproutcore/apps/test_controls/resources/sliders_page.js +53 -0
- data/frameworks/sproutcore/apps/test_controls/resources/strings.js +50 -0
- data/frameworks/sproutcore/apps/test_controls/resources/tab_page.js +15 -0
- data/frameworks/sproutcore/apps/test_controls/resources/text_field_page.js +40 -0
- data/frameworks/sproutcore/apps/tests/core.js +1 -1
- data/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +1 -1
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +2 -2
- data/frameworks/sproutcore/apps/tests/main.js +0 -1
- data/frameworks/sproutcore/apps/tests/states/no_targets.js +1 -1
- data/frameworks/sproutcore/apps/tests/states/ready.js +1 -1
- data/frameworks/sproutcore/apps/tests/states/ready_detail.js +1 -1
- data/frameworks/sproutcore/apps/tests/states/ready_empty.js +1 -1
- data/frameworks/sproutcore/apps/tests/states/ready_list.js +1 -1
- data/frameworks/sproutcore/apps/tests/states/ready_loading.js +1 -1
- data/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +1 -1
- data/frameworks/sproutcore/apps/tests/states/start.js +1 -1
- data/frameworks/sproutcore/apps/welcome/controllers/targets.js +7 -0
- data/frameworks/sproutcore/apps/welcome/core.js +1 -1
- data/frameworks/sproutcore/apps/welcome/english.lproj/images/main-bg.png +0 -0
- data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +24 -6
- data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +36 -46
- data/frameworks/sproutcore/bin/edit_json.rb +14 -0
- data/frameworks/sproutcore/bin/erubis +14 -0
- data/frameworks/sproutcore/bin/prettify_json.rb +14 -0
- data/frameworks/sproutcore/bin/rackup +14 -0
- data/frameworks/sproutcore/bin/rake2thor +14 -0
- data/frameworks/sproutcore/bin/sc-build +14 -0
- data/frameworks/sproutcore/bin/sc-build-number +14 -0
- data/frameworks/sproutcore/bin/sc-docs +14 -0
- data/frameworks/sproutcore/bin/sc-gen +14 -0
- data/frameworks/sproutcore/bin/sc-init +14 -0
- data/frameworks/sproutcore/bin/sc-manifest +14 -0
- data/frameworks/sproutcore/bin/sc-server +14 -0
- data/frameworks/sproutcore/bin/sproutcore +14 -0
- data/frameworks/sproutcore/bin/thin +14 -0
- data/frameworks/sproutcore/bin/thor +14 -0
- data/frameworks/sproutcore/design/greenhouse-statechart.graffle +9025 -0
- data/frameworks/sproutcore/design/greenhouse-statechart.pdf +0 -0
- data/frameworks/sproutcore/design/iphone-webapp-loading.psd +0 -0
- data/frameworks/sproutcore/frameworks/animation/core.js +349 -116
- data/frameworks/sproutcore/frameworks/animation/tests/core.js +78 -16
- data/frameworks/sproutcore/frameworks/bootstrap/core.js +1 -1
- data/frameworks/sproutcore/frameworks/bootstrap/setup_body_class_names.js +3 -1
- data/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +5 -4
- data/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +5 -2
- data/frameworks/sproutcore/frameworks/core_tools/data_source.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/core.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/debug/json.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +122 -0
- data/frameworks/sproutcore/frameworks/datastore/models/child_record.js +105 -0
- data/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +81 -0
- data/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +247 -82
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +27 -13
- data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/system/child_array.js +242 -0
- data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +3 -3
- data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +34 -18
- data/frameworks/sproutcore/frameworks/datastore/system/query.js +124 -47
- data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/system/store.js +106 -22
- data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +12 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +235 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +337 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +421 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +304 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/parentless.js +134 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +30 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +35 -4
- data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +49 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/core_methods.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare.js +15 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/contains.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/containsRecordTypes.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/copy.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +2 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/expandedRecordTypes.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +15 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/queryWithScope.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +2 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +15 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/error_methods.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +6 -6
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +1 -1
- data/frameworks/sproutcore/frameworks/datejs/core.js +1 -1
- data/frameworks/sproutcore/frameworks/datejs/extras.js +1 -1
- data/frameworks/sproutcore/frameworks/debug/core.js +13 -2
- data/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +40 -25
- data/frameworks/sproutcore/frameworks/designer/coders/design.js +1 -10
- data/frameworks/sproutcore/frameworks/designer/coders/localization.js +0 -8
- data/frameworks/sproutcore/frameworks/designer/controllers/controllers.js +16 -0
- data/frameworks/sproutcore/frameworks/designer/controllers/design.js +37 -0
- data/frameworks/sproutcore/frameworks/designer/controllers/designs.js +134 -0
- data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +44 -1
- data/frameworks/sproutcore/frameworks/designer/controllers/page_files.js +22 -0
- data/frameworks/sproutcore/frameworks/designer/core.js +16 -0
- data/frameworks/sproutcore/frameworks/designer/css/css_rule.js +1 -1
- data/frameworks/sproutcore/frameworks/designer/css/css_style.js +1 -1
- data/frameworks/sproutcore/frameworks/designer/css/css_style_sheet.js +1 -1
- data/frameworks/sproutcore/frameworks/designer/{views → designers}/button.js +2 -2
- data/frameworks/sproutcore/frameworks/designer/{views → designers}/label.js +1 -1
- data/frameworks/sproutcore/frameworks/designer/designers/object_designer.js +296 -0
- data/frameworks/sproutcore/frameworks/designer/{views → designers}/tab.js +3 -1
- data/frameworks/sproutcore/frameworks/designer/designers/text_field.js +15 -0
- data/frameworks/sproutcore/frameworks/designer/{views/designer.js → designers/view_designer.js} +282 -22
- data/frameworks/sproutcore/frameworks/designer/english.lproj/css/designer.css +96 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/design_page.js +55 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/high_light.css +10 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/controller.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-bg.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-bg.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-divider.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-sel-bg.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-sel-divider.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/main-bg.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/page.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/pane.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/english.lproj/images/view.png +0 -0
- data/frameworks/sproutcore/frameworks/designer/ext/object.js +26 -0
- data/frameworks/sproutcore/frameworks/designer/ext/page.js +1 -1
- data/frameworks/sproutcore/frameworks/designer/ext/view.js +16 -0
- data/frameworks/sproutcore/frameworks/designer/mixins/snap_lines.js +221 -0
- data/frameworks/sproutcore/frameworks/designer/views/designer_drop_target.js +138 -0
- data/frameworks/sproutcore/frameworks/designer/views/drawing.js +219 -0
- data/frameworks/sproutcore/frameworks/designer/views/high_light.js +66 -0
- data/frameworks/sproutcore/frameworks/designer/views/page_item_view.js +130 -0
- data/frameworks/sproutcore/frameworks/designer/views/selection_handles.js +1 -0
- data/frameworks/sproutcore/frameworks/desktop/core.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +1 -1
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +7 -11
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/cap.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/downbutton.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-bottom.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-center.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-top.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/track.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/upbutton.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +27 -3
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +3 -5
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +18 -39
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +2 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +30 -38
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +7 -5
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +0 -70
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +0 -3
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +0 -1
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/video.css +3 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/border.js +108 -23
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +681 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +130 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +6 -0
- data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +8 -7
- data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +944 -501
- data/frameworks/sproutcore/frameworks/desktop/panes/modal.js +4 -1
- data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +10 -1
- data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +5 -22
- data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +268 -56
- data/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +249 -110
- data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +93 -33
- data/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +9 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/button.js +147 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/checkbox.js +87 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/checkbox_control.js +103 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/disclosure.js +82 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/disclosure_control.js +103 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/image_button.js +33 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/list_item.js +334 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/masterDetail.js +23 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/panel.js +34 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/picker.js +50 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/segment.js +79 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/segmented.js +172 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/slider.js +86 -0
- data/frameworks/sproutcore/frameworks/desktop/renderers/workspace.js +22 -0
- data/frameworks/sproutcore/frameworks/desktop/system/drag.js +85 -51
- data/frameworks/sproutcore/frameworks/desktop/tests/datetime_recordattribute.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/mixins/border.js +96 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +4 -4
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +113 -35
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +215 -51
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/pane_page.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +3 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +2 -2
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +28 -4
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +32 -12
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +17 -24
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +14 -18
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/displayProperties.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +13 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +46 -5
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +76 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +455 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +45 -6
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +7 -7
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +129 -21
- data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +40 -38
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +24 -17
- data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +68 -36
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +22 -63
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller.js +90 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +8 -8
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +8 -4
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +144 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select/ui.js +216 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +46 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/well/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/button.js +249 -79
- data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +63 -89
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +358 -96
- data/frameworks/sproutcore/frameworks/desktop/views/date_field.js +319 -0
- data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +31 -17
- data/frameworks/sproutcore/frameworks/desktop/views/file.js +112 -0
- data/frameworks/sproutcore/frameworks/desktop/views/grid.js +30 -34
- data/frameworks/sproutcore/frameworks/desktop/views/list.js +28 -14
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +480 -262
- data/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +249 -0
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +443 -381
- data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +74 -66
- data/frameworks/sproutcore/frameworks/desktop/views/navigation.js +237 -0
- data/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +181 -0
- data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +175 -57
- data/frameworks/sproutcore/frameworks/desktop/views/progress.js +29 -21
- data/frameworks/sproutcore/frameworks/desktop/views/radio.js +196 -204
- data/frameworks/sproutcore/frameworks/desktop/views/scene.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1128 -94
- data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +569 -153
- data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +144 -129
- data/frameworks/sproutcore/frameworks/desktop/views/select.js +804 -0
- data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +15 -13
- data/frameworks/sproutcore/frameworks/desktop/views/slider.js +77 -47
- data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +4 -4
- data/frameworks/sproutcore/frameworks/desktop/views/split.js +426 -269
- data/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +5 -3
- data/frameworks/sproutcore/frameworks/desktop/views/stacked.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/static_content.js +123 -0
- data/frameworks/sproutcore/frameworks/desktop/views/tab.js +59 -63
- data/frameworks/sproutcore/frameworks/desktop/views/thumb.js +5 -1
- data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/web.js +3 -3
- data/frameworks/sproutcore/frameworks/desktop/views/well.js +7 -2
- data/frameworks/sproutcore/frameworks/desktop/views/workspace.js +270 -0
- data/frameworks/sproutcore/frameworks/documentation/core.js +0 -0
- data/frameworks/sproutcore/frameworks/forms/english.lproj/default_styles.css +5 -0
- data/frameworks/sproutcore/frameworks/forms/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/mixins/auto_hide.js +85 -0
- data/frameworks/sproutcore/frameworks/forms/mixins/edit_mode.js +43 -0
- data/frameworks/sproutcore/frameworks/forms/renderers/form.js +24 -0
- data/frameworks/sproutcore/frameworks/forms/renderers/form_row.js +24 -0
- data/frameworks/sproutcore/frameworks/forms/tests/views/form.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/tests/views/form_checkbox_field.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/tests/views/form_field.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/tests/views/form_label.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/tests/views/form_radio_field.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/tests/views/form_row.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/tests/views/form_text_field.js +15 -0
- data/frameworks/sproutcore/frameworks/forms/views/form.js +266 -0
- data/frameworks/sproutcore/frameworks/forms/views/form_row.js +188 -0
- data/frameworks/sproutcore/frameworks/foundation/TESTING +5 -5
- data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +11 -2
- data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +23 -3
- data/frameworks/sproutcore/frameworks/foundation/core.js +34 -3
- data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +2 -3
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +2 -1
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +4 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +109 -81
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-logo.png +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.jpg +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.png +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.jpg +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.png +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup.png +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore.png +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/strings.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +16 -14
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +5 -0
- data/frameworks/sproutcore/frameworks/foundation/ext/object.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +6 -5
- data/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +81 -0
- data/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +142 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +33 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +74 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +4 -2
- data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +88 -15
- data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +3 -1
- data/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +415 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/gestureable.js +106 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +95 -64
- data/frameworks/sproutcore/frameworks/foundation/{system → mixins}/responder_context.js +42 -16
- data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +64 -83
- data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +7 -53
- data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +188 -5
- data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +4 -4
- data/frameworks/sproutcore/frameworks/foundation/panes/main.js +1 -2
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +216 -53
- data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/protocols/inline_editor_delegate.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/renderers/control.js +122 -0
- data/frameworks/sproutcore/frameworks/foundation/renderers/image.js +51 -0
- data/frameworks/sproutcore/frameworks/foundation/renderers/label.js +96 -0
- data/frameworks/sproutcore/frameworks/foundation/renderers/renderer.js +316 -0
- data/frameworks/sproutcore/frameworks/foundation/renderers/title.js +108 -0
- data/frameworks/sproutcore/frameworks/foundation/renderers/view.js +62 -0
- data/frameworks/sproutcore/frameworks/foundation/system/application.js +4 -3
- data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +5 -2
- data/frameworks/sproutcore/frameworks/foundation/system/browser.js +32 -37
- data/frameworks/sproutcore/frameworks/foundation/system/builder.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/system/bundle.js +18 -15
- data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +12 -13
- data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +6 -5
- data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +7 -8
- data/frameworks/sproutcore/frameworks/foundation/system/device.js +143 -0
- data/frameworks/sproutcore/frameworks/foundation/system/event.js +38 -13
- data/frameworks/sproutcore/frameworks/foundation/system/gesture.js +245 -0
- data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +13 -13
- data/frameworks/sproutcore/frameworks/foundation/system/json.js +11 -8
- data/frameworks/sproutcore/frameworks/foundation/system/locale.js +7 -2
- data/frameworks/sproutcore/frameworks/foundation/system/math.js +57 -0
- data/frameworks/sproutcore/frameworks/foundation/system/page.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/system/platform.js +189 -0
- data/frameworks/sproutcore/frameworks/foundation/system/ready.js +9 -7
- data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +155 -62
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +21 -1
- data/frameworks/sproutcore/frameworks/foundation/system/responder.js +6 -3
- data/frameworks/sproutcore/frameworks/foundation/system/response.js +5 -3
- data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +1704 -233
- data/frameworks/sproutcore/frameworks/foundation/system/routes.js +340 -445
- data/frameworks/sproutcore/frameworks/foundation/system/task_queue.js +150 -0
- data/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/system/theme.js +108 -0
- data/frameworks/sproutcore/frameworks/foundation/system/time.js +0 -5
- data/frameworks/sproutcore/frameworks/foundation/system/timer.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +193 -29
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +133 -60
- data/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +41 -0
- data/frameworks/sproutcore/frameworks/foundation/tasks/task.js +17 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/selection_support.js +318 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/empty_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/multiple_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_enumerable_case.js +87 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/selection_support.js +340 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/content.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/content.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/api.js +52 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +227 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/responder_context.js +75 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +17 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +58 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +74 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/renderers/renderer/base.js +170 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/renderers/renderer/inheritance.js +39 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +4 -9
- data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +6 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/math.js +39 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/begin.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/element.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/end.js +6 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +12 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/init.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/join.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/push_text.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +12 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeKeyPane.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMainPane.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMenuPane.js +48 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/routes.js +333 -14
- data/frameworks/sproutcore/frameworks/foundation/tests/system/task_queue.js +43 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/theme.js +86 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invokeLater.js +7 -5
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +34 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +7 -10
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/firstResponder.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/keyPane.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/layout.js +31 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendEvent.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendTouchEvent.js +267 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +99 -5
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/animation.js +321 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/build.js +85 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/build_children.js +89 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createLayer.js +3 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/didAppendToDocument.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/init.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layer.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutChildViews.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutDidChange.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +289 -22
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/nextValidKeyView.js +20 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/parentViewDidChange.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +28 -6
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/removeChild.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/render.js +50 -7
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/renderer.js +443 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/replaceChild.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/theme.js +41 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +4 -4
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayerLocation.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/viewDidResize.js +7 -6
- data/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/validators/date.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +46 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/email.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/validators/number.js +17 -5
- data/frameworks/sproutcore/frameworks/foundation/validators/password.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/validators/positive_integer.js +84 -0
- data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +16 -6
- data/frameworks/sproutcore/frameworks/foundation/views/container.js +25 -22
- data/frameworks/sproutcore/frameworks/foundation/views/field.js +16 -42
- data/frameworks/sproutcore/frameworks/foundation/views/image.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/views/label.js +58 -48
- data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +321 -133
- data/frameworks/sproutcore/frameworks/foundation/views/view.js +1853 -353
- data/frameworks/sproutcore/frameworks/jquery/jquery.js +6240 -0
- data/frameworks/sproutcore/frameworks/media/resources/controls.png +0 -0
- data/frameworks/sproutcore/frameworks/media/resources/playeras3.fla +0 -0
- data/frameworks/sproutcore/frameworks/media/resources/video.css +120 -0
- data/frameworks/sproutcore/frameworks/media/resources/videoCanvas.swf +0 -0
- data/frameworks/sproutcore/frameworks/media/views/audio.js +729 -0
- data/frameworks/sproutcore/frameworks/media/views/controls.js +90 -0
- data/frameworks/sproutcore/frameworks/media/views/mediaSlider.js +243 -0
- data/frameworks/sproutcore/frameworks/media/views/miniControls.js +63 -0
- data/frameworks/sproutcore/frameworks/media/views/simpleControls.js +55 -0
- data/frameworks/sproutcore/frameworks/media/views/video.js +829 -0
- data/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml +2 -3
- data/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js +9 -2
- data/frameworks/sproutcore/frameworks/mobile/views/button.js +5 -4
- data/frameworks/sproutcore/frameworks/runtime/core.js +46 -34
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +36 -2
- data/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +63 -3
- data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +25 -19
- data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +12 -7
- data/frameworks/sproutcore/frameworks/runtime/protocols/observable_protocol.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/protocols/sparse_array_delegate.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/binding.js +60 -7
- data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/error.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +2 -1
- data/frameworks/sproutcore/frameworks/runtime/system/object.js +37 -7
- data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +39 -10
- data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/set.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +3 -3
- data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/comparable.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +12 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +6 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +23 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +126 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/addEach.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +11 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/removeEach.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +30 -12
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/add.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/isEqual.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +1 -1
- data/frameworks/sproutcore/frameworks/statechart/core.js +11 -0
- data/frameworks/sproutcore/frameworks/statechart/mixins/statechart.js +337 -0
- data/frameworks/sproutcore/frameworks/statechart/system/state.js +176 -0
- data/frameworks/sproutcore/frameworks/statechart/tests/basic.js +90 -0
- data/frameworks/sproutcore/frameworks/statechart/tests/history.js +71 -0
- data/frameworks/sproutcore/frameworks/statechart/tests/nested.js +59 -0
- data/frameworks/sproutcore/frameworks/statechart/tests/transient.js +148 -0
- data/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js +41 -0
- data/frameworks/sproutcore/frameworks/table/system/table_column.js +125 -0
- data/frameworks/sproutcore/frameworks/table/views/table.js +438 -0
- data/frameworks/sproutcore/frameworks/table/views/table_cell.js +62 -0
- data/frameworks/sproutcore/frameworks/table/views/table_head.js +158 -0
- data/frameworks/sproutcore/frameworks/table/views/table_header.js +212 -0
- data/frameworks/sproutcore/frameworks/table/views/table_row.js +155 -0
- data/frameworks/sproutcore/frameworks/test +77 -0
- data/frameworks/sproutcore/frameworks/testing/core.js +1 -1
- data/frameworks/sproutcore/frameworks/testing/extras.js +1 -1
- data/frameworks/sproutcore/frameworks/testing/system/dump.js +1 -1
- data/frameworks/sproutcore/frameworks/testing/system/equiv.js +1 -1
- data/frameworks/sproutcore/frameworks/testing/system/plan.js +1 -1
- data/frameworks/sproutcore/frameworks/testing/system/runner.js +2 -2
- data/frameworks/sproutcore/frameworks/testing/system/suite.js +1 -1
- data/frameworks/sproutcore/frameworks/testing/utils.js +1 -1
- data/frameworks/sproutcore/lib/index.rhtml +15 -4
- data/frameworks/sproutcore/themes/ace/Buildfile +0 -0
- data/frameworks/sproutcore/themes/ace/README.md +161 -0
- data/frameworks/sproutcore/themes/ace/build +2 -0
- data/frameworks/sproutcore/themes/ace/build-d +2 -0
- data/frameworks/sproutcore/themes/ace/chance/README.md +113 -0
- data/frameworks/sproutcore/themes/ace/chance/chance.rb +203 -0
- data/frameworks/sproutcore/themes/ace/chance/lib/css.rb +202 -0
- data/frameworks/sproutcore/themes/ace/chance/lib/slicedice.rb +391 -0
- data/frameworks/sproutcore/themes/ace/chance/sc-theme.rb +0 -0
- data/frameworks/sproutcore/themes/ace/chance/scripts/setup.rb +126 -0
- data/frameworks/sproutcore/themes/ace/mockups/dark.png +0 -0
- data/frameworks/sproutcore/themes/ace/mockups/dark.psd +0 -0
- data/frameworks/sproutcore/themes/ace/mockups/light.png +0 -0
- data/frameworks/sproutcore/themes/ace/mockups/light.psd +0 -0
- data/frameworks/sproutcore/themes/ace/resources/images/1.png +0 -0
- data/frameworks/sproutcore/themes/ace/resources/images/2.png +0 -0
- data/frameworks/sproutcore/themes/ace/resources/images/3.png +0 -0
- data/frameworks/sproutcore/themes/ace/resources/theme.css +1832 -0
- data/frameworks/sproutcore/themes/ace/scroll_test/resources/images/1.png +0 -0
- data/frameworks/sproutcore/themes/ace/scroll_test/resources/images/2.png +0 -0
- data/frameworks/sproutcore/themes/ace/scroll_test/resources/images/3.png +0 -0
- data/frameworks/sproutcore/themes/ace/scroll_test/resources/theme.css +147 -0
- data/frameworks/sproutcore/themes/ace/scroll_test/scrollbars.html +326 -0
- data/frameworks/sproutcore/themes/ace/src/body.css +13 -0
- data/frameworks/sproutcore/themes/ace/src/collections/list.css +4 -0
- data/frameworks/sproutcore/themes/ace/src/collections/list_item.css +7 -0
- data/frameworks/sproutcore/themes/ace/src/collections/source_list/selection.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/collections/source_list/selection.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/collections/source_list/source_list_view.css +37 -0
- data/frameworks/sproutcore/themes/ace/src/containers/container.css +3 -0
- data/frameworks/sproutcore/themes/ace/src/containers/masterdetail/master-detail.css +26 -0
- data/frameworks/sproutcore/themes/ace/src/containers/split/split.css +4 -0
- data/frameworks/sproutcore/themes/ace/src/containers/tab/tab.css +9 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button.js +23 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/button_view.css +53 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/normal_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/normal_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/button_view.css +144 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/button_view_30.css +111 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/button_view.css +57 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/normal_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/normal_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/button_view.css +56 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_view.css +64 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox.css +25 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox.css +25 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/checkbox.css +4 -0
- data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/checkbox_control.css +31 -0
- data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view.css +70 -0
- data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_content.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_content.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_indeterminate_content.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_track.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_track.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio.css +61 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_unselected.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_unselected.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/horizontal.css +77 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/thumb.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/thumb.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/thumb.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/thumb.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/vertical.css +74 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented.css +92 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_normal.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_normal.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented.css +87 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_normal.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_normal.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented.css +93 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_normal.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_normal.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented.css +101 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_normal.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_normal.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/segmented.css +73 -0
- data/frameworks/sproutcore/themes/ace/src/controls/segmented/segmented.js +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/select/active_select.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/select/active_select.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/select/menu.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/select/normal_select.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/select/normal_select.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/select/select.css +45 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/slider.css +43 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/slider.css +44 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/slider.css +44 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/track.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/track.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/slider.css +3 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/slider.js +27 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/track.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/slider/track.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_handle.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_handle.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_off.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_off.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_on.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_on.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/core/loading.css +50 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/button_view.css +142 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_capsule.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_capsule.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/button_view_30.css +111 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button_pointer.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button_pointer.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/button.css +20 -0
- data/frameworks/sproutcore/themes/ace/src/dark/buttons/button.js +3 -0
- data/frameworks/sproutcore/themes/ace/src/form/iphone/form.js +21 -0
- data/frameworks/sproutcore/themes/ace/src/form/iphone/form_row.js +24 -0
- data/frameworks/sproutcore/themes/ace/src/form/iphone/iphone.css +51 -0
- data/frameworks/sproutcore/themes/ace/src/form/iphone/iphone.js +14 -0
- data/frameworks/sproutcore/themes/ace/src/form/iphone/label.js +32 -0
- data/frameworks/sproutcore/themes/ace/src/panels/pane.css +3 -0
- data/frameworks/sproutcore/themes/ace/src/panels/panel.css +70 -0
- data/frameworks/sproutcore/themes/ace/src/panels/panel.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/panel.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark_active.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark_active.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/down.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/down.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu.css +154 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu_item.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu_item.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/up.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/up.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/picker.css +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/picker.js +1 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/picker.js +14 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.css +271 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.js +5 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_empty.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_empty.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_notoolbar.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_notoolbar.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers_notoolbar.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers_notoolbar.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_sourcelist.css +5 -0
- data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/workspace.js +51 -0
- data/frameworks/sproutcore/themes/ace/src/theme.js +12 -0
- data/frameworks/sproutcore/themes/ace/src/toolbars/normal/selection.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/toolbars/normal/toolbar.css +8 -0
- data/frameworks/sproutcore/themes/ace/src/toolbars/normal/toolbar.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/toolbars/normal/toolbar.psd +0 -0
- data/frameworks/sproutcore/themes/ace/src/toolbars/panel_header/panel_header.png +0 -0
- data/frameworks/sproutcore/themes/ace/src/toolbars/panel_header/panel_header.psd +0 -0
- data/frameworks/sproutcore/themes/empty_theme/theme.js +16 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +75 -2
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +0 -16
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-repeat-x.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-repeat-y.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-sprite.png +0 -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/menu_item_view.css +26 -2
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +0 -29
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/scroller.css +155 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +64 -69
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +2 -18
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +0 -1
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/table.css +14 -0
- data/gen/responder/Buildfile +18 -0
- data/gen/responder/README +1 -0
- data/gen/responder/USAGE +15 -0
- data/gen/responder/templates/states/@filename@.js +39 -0
- data/{Buildfile → lib/Buildfile} +37 -34
- data/lib/buildtasks/build.rake +103 -0
- data/{buildtasks → lib/buildtasks}/entry.rake +40 -34
- data/{buildtasks → lib/buildtasks}/manifest.rake +285 -239
- data/{buildtasks → lib/buildtasks}/render.rake +5 -5
- data/lib/buildtasks/target.rake +65 -0
- data/lib/sproutcore.rb +58 -53
- data/lib/sproutcore/builders.rb +12 -0
- data/lib/sproutcore/builders/base.rb +19 -20
- data/lib/sproutcore/builders/bundle.rb +17 -17
- data/lib/sproutcore/builders/combine.rb +14 -14
- data/lib/sproutcore/builders/html.rb +68 -62
- data/lib/sproutcore/builders/javascript.rb +40 -26
- data/lib/sproutcore/builders/less.rb +41 -0
- data/lib/sproutcore/builders/minify.rb +20 -25
- data/lib/sproutcore/builders/sass.rb +20 -10
- data/lib/sproutcore/builders/strings.rb +11 -10
- data/lib/sproutcore/builders/stylesheet.rb +28 -12
- data/lib/sproutcore/builders/test.rb +19 -19
- data/lib/sproutcore/builders/test_index.rb +6 -6
- data/lib/sproutcore/buildfile.rb +120 -114
- data/lib/sproutcore/buildfile/build_task.rb +5 -5
- data/lib/sproutcore/buildfile/buildfile_dsl.rb +22 -15
- data/lib/sproutcore/buildfile/cloneable.rb +3 -3
- data/lib/sproutcore/buildfile/early_time.rb +2 -2
- data/lib/sproutcore/buildfile/invocation_chain.rb +3 -3
- data/lib/sproutcore/buildfile/namespace.rb +3 -3
- data/lib/sproutcore/buildfile/string_ext.rb +5 -1
- data/lib/sproutcore/buildfile/task.rb +49 -48
- data/lib/sproutcore/buildfile/task_arguments.rb +28 -8
- data/lib/sproutcore/buildfile/task_manager.rb +19 -17
- data/lib/sproutcore/deprecated/view_helper.rb +2 -2
- data/lib/sproutcore/helpers.rb +11 -0
- data/lib/sproutcore/helpers/cssmin.rb +24 -24
- data/lib/sproutcore/helpers/dom_id_helper.rb +1 -1
- data/lib/sproutcore/helpers/entry_sorter.rb +51 -75
- data/lib/sproutcore/helpers/html5_manifest.rb +88 -0
- data/lib/sproutcore/helpers/packed_optimizer.rb +20 -20
- data/lib/sproutcore/helpers/static_helper.rb +79 -79
- data/lib/sproutcore/helpers/tag_helper.rb +10 -10
- data/lib/sproutcore/helpers/text_helper.rb +2 -2
- data/lib/sproutcore/models.rb +8 -0
- data/lib/sproutcore/models/generator.rb +92 -92
- data/lib/sproutcore/models/hash_struct.rb +42 -27
- data/lib/sproutcore/models/manifest.rb +123 -117
- data/lib/sproutcore/models/manifest_entry.rb +123 -105
- data/lib/sproutcore/models/project.rb +54 -54
- data/lib/sproutcore/models/target.rb +212 -200
- data/lib/sproutcore/rack.rb +7 -0
- data/lib/sproutcore/rack/builder.rb +89 -84
- data/lib/sproutcore/rack/dev.rb +55 -14
- data/lib/sproutcore/rack/docs.rb +4 -4
- data/lib/sproutcore/rack/filesystem.rb +118 -59
- data/lib/sproutcore/rack/proxy.rb +36 -34
- data/lib/sproutcore/rack/service.rb +36 -34
- data/lib/sproutcore/rack/test_runner.rb +4 -4
- data/lib/sproutcore/render_engines/erubis.rb +2 -2
- data/lib/sproutcore/render_engines/haml.rb +2 -2
- data/lib/sproutcore/tools.rb +102 -98
- data/lib/sproutcore/tools/build.rb +27 -22
- data/lib/sproutcore/tools/build_number.rb +3 -3
- data/lib/sproutcore/tools/docs.rb +4 -4
- data/lib/sproutcore/tools/gen.rb +24 -24
- data/lib/sproutcore/tools/init.rb +7 -7
- data/lib/sproutcore/tools/manifest.rb +13 -13
- data/lib/sproutcore/tools/server.rb +11 -11
- data/{vendor → lib/sproutcore/vendor}/github_gem_lint.rb +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/README.txt +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Chain.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Dumper.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Hash.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Link.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Namespace.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Opt.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Reflection.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/String.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Testrun.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/FOODOC.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/DocComment.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/DocTag.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/JsDoc.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/JsPlate.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Lang.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Parser.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/PluginManager.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Symbol.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/TextStream.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Token.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/TokenReader.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/TokenStream.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Util.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Walker.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/main.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/commentSrcJson.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/frameworkPrototype.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/functionCall.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/publishSrcHilite.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/sproutcoreTags.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/symbolLink.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/tagParamConfig.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/tagSynonyms.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/run.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/t/TestDoc.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/t/runner.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/addon.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/anon_inner.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/augments.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/augments2.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/borrows.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/borrows2.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/config.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/constructs.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/encoding.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/encoding_other.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/functions_anon.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/functions_nested.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/global.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/globals.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/ignore.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/inner.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/jsdoc_test.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/lend.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/memberof.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/memberof_constructor.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/name.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/namespace_nested.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/nocode.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/oblit_anon.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/overview.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/param_inline.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/params_optional.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype_nested.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype_oblit.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype_oblit_constructor.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/public.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/shared.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/shared2.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/shortcuts.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/static_this.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/synonyms.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/tosource.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/variable_redefine.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/changes.txt +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/conf/sample.conf +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/java/build.xml +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/java/build_1.4.xml +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/java/classes/js.jar +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/java/src/JsDebugRun.java +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/java/src/JsRun.java +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/jsdebug.jar +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/jsrun.jar +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/t/TestDoc.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/t/runner.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/addon.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/anon_inner.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/augments.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/augments2.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/borrows.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/borrows2.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/config.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/constructs.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/encoding.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/encoding_other.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/functions_anon.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/functions_nested.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/global.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/globals.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/ignore.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/inner.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/jsdoc_test.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/lend.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/memberof.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/memberof_constructor.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/name.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/namespace_nested.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/nocode.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/oblit_anon.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/overview.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/param_inline.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/params_optional.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype_nested.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype_oblit.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype_oblit_constructor.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/public.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/shared.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/shared2.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/shortcuts.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/static_this.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/synonyms.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/tosource.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/jsdoc/test/variable_redefine.js +0 -0
- data/{vendor → lib/sproutcore/vendor}/yui-compressor/SCyuicompressor-2.4.2.jar +0 -0
- data/{vendor → lib/sproutcore/vendor}/yui-compressor/yuicompressor-2.4.2.jar +0 -0
- data/lib/sproutcore/version.rb +11 -0
- data/spec/buildtasks/build/copy_spec.rb +16 -16
- data/spec/buildtasks/build/spec_helper.rb +5 -5
- data/spec/buildtasks/manifest/catalog_spec.rb +9 -9
- data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +15 -15
- data/spec/buildtasks/manifest/localize_spec.rb +14 -14
- data/spec/buildtasks/manifest/prepare_build_tasks/bundle_spec.rb +61 -61
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +52 -44
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +13 -13
- data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +29 -29
- data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +11 -11
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +9 -9
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +23 -23
- data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +15 -15
- data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +11 -11
- data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +28 -28
- data/spec/buildtasks/manifest/prepare_spec.rb +7 -7
- data/spec/buildtasks/manifest/spec_helper.rb +6 -6
- data/spec/buildtasks/target_spec.rb +33 -33
- data/spec/fixtures/builder_tests/apps/less_test/sample.less +4 -0
- data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +1 -0
- data/spec/fixtures/builder_tests/apps/sass_test/sample.scss +4 -0
- data/spec/fixtures/buildfiles/basic/Buildfile +0 -5
- data/spec/fixtures/buildfiles/installed/Buildfile +0 -2
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo3.scss +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo4.less +0 -0
- data/spec/fixtures/real_world/generators/sample_custom/templates/{filename}.js +1 -0
- data/spec/lib/builders/bundle_spec.rb +79 -78
- data/spec/lib/builders/combine_spec.rb +10 -10
- data/spec/lib/builders/html_spec.rb +134 -133
- data/spec/lib/builders/javascript_spec.rb +11 -10
- data/spec/lib/builders/less_spec.rb +51 -0
- data/spec/lib/builders/sass_spec.rb +38 -9
- data/spec/lib/builders/spec_helper.rb +8 -8
- data/spec/lib/builders/strings_spec.rb +14 -11
- data/spec/lib/builders/stylesheet_spec.rb +9 -8
- data/spec/lib/builders/test_index_spec.rb +10 -9
- data/spec/lib/builders/test_spec.rb +36 -35
- data/spec/lib/buildfile/config_for_spec.rb +15 -15
- data/spec/lib/buildfile/define_spec.rb +14 -14
- data/spec/lib/buildfile/dup_spec.rb +19 -19
- data/spec/lib/buildfile/invoke_spec.rb +38 -33
- data/spec/lib/buildfile/load_spec.rb +21 -19
- data/spec/lib/buildfile/task/dup_spec.rb +14 -14
- data/spec/lib/buildfile/task_defined_spec.rb +3 -3
- data/spec/lib/buildfile_commands/build_task_spec.rb +3 -3
- data/spec/lib/buildfile_commands/config_spec.rb +40 -40
- data/spec/lib/buildfile_commands/import_spec.rb +2 -2
- data/spec/lib/buildfile_commands/namespace_spec.rb +3 -3
- data/spec/lib/buildfile_commands/proxies_spec.rb +12 -12
- data/spec/lib/buildfile_commands/replace_task_spec.rb +7 -7
- data/spec/lib/buildfile_commands/task_spec.rb +6 -6
- data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +5 -5
- data/spec/lib/models/hash_struct/deep_clone_spec.rb +8 -8
- data/spec/lib/models/hash_struct/has_options_spec.rb +10 -10
- data/spec/lib/models/hash_struct/hash_spec.rb +17 -19
- data/spec/lib/models/hash_struct/merge_spec.rb +4 -4
- data/spec/lib/models/hash_struct/method_missing.rb +9 -9
- data/spec/lib/models/manifest/add_entry_spec.rb +7 -7
- data/spec/lib/models/manifest/add_transform_spec.rb +17 -15
- data/spec/lib/models/manifest/build_spec.rb +19 -19
- data/spec/lib/models/manifest/entry_for_spec.rb +30 -30
- data/spec/lib/models/manifest/find_entry.rb +20 -20
- data/spec/lib/models/manifest/prepare_spec.rb +13 -13
- data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +8 -8
- data/spec/lib/models/manifest_entry/hyperdomain_prefix.rb +9 -9
- data/spec/lib/models/manifest_entry/prepare_spec.rb +11 -11
- data/spec/lib/models/project/add_target_spec.rb +7 -7
- data/spec/lib/models/project/buildfile_spec.rb +4 -4
- data/spec/lib/models/project/find_targets_for_spec.rb +17 -17
- data/spec/lib/models/project/load_nearest_project_spec.rb +10 -10
- data/spec/lib/models/project/target_for_spec.rb +6 -6
- data/spec/lib/models/project/targets_spec.rb +13 -13
- data/spec/lib/models/target/compute_build_number_spec.rb +24 -23
- data/spec/lib/models/target/config_spec.rb +6 -6
- data/spec/lib/models/target/expand_required_targets_spec.rb +14 -14
- data/spec/lib/models/target/installed_languages_spec.rb +12 -12
- data/spec/lib/models/target/lproj_for_spec.rb +9 -9
- data/spec/lib/models/target/manifest_for_spec.rb +8 -8
- data/spec/lib/models/target/parent_target_spec.rb +3 -3
- data/spec/lib/models/target/prepare_spec.rb +11 -11
- data/spec/lib/models/target/required_targets_spec.rb +28 -28
- data/spec/lib/models/target/target_for_spec.rb +5 -5
- data/spec/lib/tools/build_number_spec.rb +9 -9
- data/spec/lib/tools/gen_spec.rb +34 -33
- data/spec/lib/tools/tools_spec.rb +20 -19
- data/spec/spec_helper.rb +28 -40
- data/sproutcore.gemspec +33 -0
- metadata +1741 -1056
- data/buildtasks/build.rake +0 -87
- data/buildtasks/target.rake +0 -61
- data/frameworks/sproutcore/README +0 -64
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/scroller.css +0 -26
- data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +0 -702
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +0 -72
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +0 -71
@@ -2,13 +2,14 @@
|
|
2
2
|
// Project: SproutCore - JavaScript Application Framework
|
3
3
|
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
4
|
// Portions ©2008-2009 Apple Inc. All rights reserved.
|
5
|
-
// License:
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
8
|
sc_require('system/browser');
|
9
9
|
sc_require('system/event');
|
10
10
|
sc_require('system/cursor');
|
11
11
|
sc_require('system/responder') ;
|
12
|
+
sc_require('system/theme');
|
12
13
|
|
13
14
|
sc_require('mixins/string') ;
|
14
15
|
|
@@ -75,14 +76,49 @@ SC.ANCHOR_CENTER = { centerX: 0, centerY: 0 };
|
|
75
76
|
|
76
77
|
SC.LAYOUT_AUTO = 'auto';
|
77
78
|
|
79
|
+
/**
|
80
|
+
Default property to disable or enable by default the contextMenu
|
81
|
+
*/
|
82
|
+
SC.CONTEXT_MENU_ENABLED = NO;
|
83
|
+
|
84
|
+
/**
|
85
|
+
Default property to disable or enable if the focus can jump to the address
|
86
|
+
bar or not.
|
87
|
+
*/
|
88
|
+
SC.TABBING_ONLY_INSIDE_DOCUMENT = YES;
|
89
|
+
|
90
|
+
/**
|
91
|
+
Tells the property (when fetched with themed()) to get its value from the renderer (if any).
|
92
|
+
*/
|
93
|
+
SC.FROM_THEME = "__FROM_THEME__"; // doesn't really matter what it is, so long as it is unique. Readability is a plus.
|
94
|
+
|
78
95
|
/** @private - custom array used for child views */
|
79
96
|
SC.EMPTY_CHILD_VIEWS_ARRAY = [];
|
80
97
|
SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone = YES;
|
81
98
|
|
99
|
+
/**
|
100
|
+
Map to CSS Transforms
|
101
|
+
*/
|
102
|
+
SC.CSS_TRANSFORM_MAP = {
|
103
|
+
rotate: function(val){
|
104
|
+
if (SC.typeOf(val) === SC.T_NUMBER || val === 0) val += 'deg';
|
105
|
+
return 'rotate('+val+')';
|
106
|
+
},
|
107
|
+
scale: function(val){
|
108
|
+
if (SC.typeOf(val) === SC.T_ARRAY) val = val.join(', ');
|
109
|
+
return 'scale('+val+')';
|
110
|
+
}
|
111
|
+
};
|
112
|
+
|
113
|
+
/**
|
114
|
+
Properties that can be animated
|
115
|
+
*/
|
116
|
+
SC.ANIMATABLE_PROPERTIES = ["top", "left", "bottom", "right", "width", "height", "centerX", "centerY", "opacity", "scale", "rotate"];
|
117
|
+
|
82
118
|
/**
|
83
119
|
@class
|
84
120
|
|
85
|
-
Base class for managing a view.
|
121
|
+
Base class for managing a view. Views provide two functions:
|
86
122
|
|
87
123
|
1. They translate state and events into drawing instructions for the
|
88
124
|
web browser and
|
@@ -119,7 +155,7 @@ SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone = YES;
|
|
119
155
|
override this behavior with your own custom updating code, you can
|
120
156
|
replace updateLayer() with your own implementation instead.
|
121
157
|
|
122
|
-
- *
|
158
|
+
- *didAppendToDocument:* in theory all DOM setup could be done
|
123
159
|
in didCreateLayer() as you already have a DOM element instantiated.
|
124
160
|
However there is cases where the element has to be first appended to the
|
125
161
|
Document because there is either a bug on the browser or you are using
|
@@ -134,7 +170,7 @@ SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone = YES;
|
|
134
170
|
SC.View = SC.Responder.extend(SC.DelegateSupport,
|
135
171
|
/** @scope SC.View.prototype */ {
|
136
172
|
|
137
|
-
concatenatedProperties: 'outlets displayProperties layoutProperties classNames renderMixin didCreateLayerMixin willDestroyLayerMixin'.w(),
|
173
|
+
concatenatedProperties: 'outlets displayProperties layoutProperties classNames renderMixin didCreateLayerMixin willDestroyLayerMixin createRendererMixin updateRendererMixin'.w(),
|
138
174
|
|
139
175
|
/**
|
140
176
|
The current pane.
|
@@ -180,6 +216,185 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
180
216
|
*/
|
181
217
|
backgroundColor: null,
|
182
218
|
|
219
|
+
/**
|
220
|
+
Activates use of brower's static layout. To activate, set this
|
221
|
+
property to YES.
|
222
|
+
|
223
|
+
@property {Boolean}
|
224
|
+
*/
|
225
|
+
useStaticLayout: NO,
|
226
|
+
|
227
|
+
// ..........................................................
|
228
|
+
// THEME SUPPORT
|
229
|
+
//
|
230
|
+
|
231
|
+
_baseThemeName: false,
|
232
|
+
|
233
|
+
/**
|
234
|
+
The base theme to start from; the "theme" property looks in this theme.
|
235
|
+
baseTheme is inherited from parent's theme property.
|
236
|
+
*/
|
237
|
+
baseTheme: null,
|
238
|
+
|
239
|
+
/**
|
240
|
+
This sets the base theme
|
241
|
+
*/
|
242
|
+
_baseThemeProperty: function(key, value) {
|
243
|
+
if (SC.typeOf(value) === SC.T_STRING) {
|
244
|
+
this.set("_baseThemeName", value);
|
245
|
+
}
|
246
|
+
|
247
|
+
// find the base theme by name if we have a name.
|
248
|
+
if (this.get("_baseThemeName")) {
|
249
|
+
var theme = SC.Theme.find(this.get("_baseThemeName"));
|
250
|
+
if (theme) return theme;
|
251
|
+
}
|
252
|
+
|
253
|
+
// otherwise, return parent's theme.
|
254
|
+
var parent = this.get("parentView");
|
255
|
+
if (parent) return parent.get("theme");
|
256
|
+
|
257
|
+
return SC.Theme.find("sc-base");
|
258
|
+
}.property().cacheable(),
|
259
|
+
|
260
|
+
|
261
|
+
_last_theme: null, // used to determine if theme has changed since last time the property was evaluated.
|
262
|
+
_themeName: false,
|
263
|
+
|
264
|
+
// baseTheme is a "property"; since it gets set after extension of the view,
|
265
|
+
// we need an observer in addition to it to actually do notifications.
|
266
|
+
_baseThemeDidChange: function() {
|
267
|
+
this.notifyPropertyChange("theme");
|
268
|
+
}.observes("baseTheme"),
|
269
|
+
|
270
|
+
_themeProperty: function(key, value) {
|
271
|
+
// if it is a string, set theme name
|
272
|
+
if (SC.typeOf(value) === SC.T_STRING) {
|
273
|
+
this.set("_themeName", value);
|
274
|
+
}
|
275
|
+
|
276
|
+
// get the base theme
|
277
|
+
var base = this.get("baseTheme");
|
278
|
+
|
279
|
+
// find theme, if possible
|
280
|
+
if (this.get("_themeName")) {
|
281
|
+
// Note: theme instance "find" function will search every parent
|
282
|
+
// _except_ global (which is not a parent)
|
283
|
+
var theme;
|
284
|
+
if (base) {
|
285
|
+
theme = base.find(this.get("_themeName"));
|
286
|
+
if (theme) return theme;
|
287
|
+
}
|
288
|
+
|
289
|
+
theme = SC.Theme.find(this.get("_themeName"));
|
290
|
+
if (theme) return theme;
|
291
|
+
}
|
292
|
+
|
293
|
+
// can't find anything, return base.
|
294
|
+
return base;
|
295
|
+
}.property().cacheable(),
|
296
|
+
|
297
|
+
_notifyThemeDidChange: function() {
|
298
|
+
var len, idx, childViews = this.get("childViews");
|
299
|
+
len = childViews.length;
|
300
|
+
for (idx = 0; idx < len; idx++){
|
301
|
+
childViews[idx].notifyPropertyChange("baseTheme");
|
302
|
+
childViews[idx].notifyPropertyChange("theme");
|
303
|
+
}
|
304
|
+
},
|
305
|
+
|
306
|
+
/**
|
307
|
+
The current theme. You may only set this to a string, and during runtime, the value
|
308
|
+
(from get()) will always be a theme object or null.
|
309
|
+
*/
|
310
|
+
theme: null,
|
311
|
+
|
312
|
+
/**
|
313
|
+
Detects when the theme changes. Replaces the layer if necessary.
|
314
|
+
*/
|
315
|
+
_themeDidChange: function() {
|
316
|
+
var theme = this.get("theme");
|
317
|
+
if (theme === this._last_theme) return;
|
318
|
+
this._last_theme = theme;
|
319
|
+
|
320
|
+
// replace the layer
|
321
|
+
if (this.get("layer")) this.replaceLayer();
|
322
|
+
|
323
|
+
// notify child views
|
324
|
+
if (this._hasCreatedChildViews) this._notifyThemeDidChange();
|
325
|
+
|
326
|
+
// and now, regenerate renderer
|
327
|
+
this._generateRenderer();
|
328
|
+
}.observes("theme"),
|
329
|
+
|
330
|
+
/**
|
331
|
+
Like "get", but if the value is SC.FROM_THEME, it will find the value from the view's
|
332
|
+
renderer, if any; if none, then it will look for <property>Default and return that.
|
333
|
+
*/
|
334
|
+
themed: function(property) {
|
335
|
+
var val = this.get(property);
|
336
|
+
if (val === SC.FROM_THEME) {
|
337
|
+
if (this.renderer) return this.renderer[property];
|
338
|
+
else return this.get(property + "Default");
|
339
|
+
}
|
340
|
+
return val;
|
341
|
+
},
|
342
|
+
|
343
|
+
/**
|
344
|
+
@private
|
345
|
+
Generates the view's renderer (calling _destroyRenderer on any old ones if needed).
|
346
|
+
*/
|
347
|
+
_generateRenderer: function() {
|
348
|
+
var theme = this.get("theme"); // renderers need a theme
|
349
|
+
|
350
|
+
// reset the renderer (the theme changed, hello!)
|
351
|
+
this._destroyRenderer();
|
352
|
+
|
353
|
+
// now, if we do have a theme, we can try to create the renderer.
|
354
|
+
if (theme && theme.isTheme) {
|
355
|
+
this._viewRenderer = theme.view();
|
356
|
+
|
357
|
+
if (this.createRenderer) {
|
358
|
+
this.renderer = this.createRenderer(theme);
|
359
|
+
|
360
|
+
// the renderer was not necessarily successfully created.
|
361
|
+
if (this.renderer) {
|
362
|
+
var mixins, idx, len;
|
363
|
+
this.renderer.contentProvider = this; // set renderer's content provider to this (it will call renderContent, etc. as needed)
|
364
|
+
if (mixins = this.createRendererMixin) {
|
365
|
+
len = mixins.length;
|
366
|
+
for (idx = 0; idx < len; idx++) mixins[idx].call(this, theme);
|
367
|
+
}
|
368
|
+
}
|
369
|
+
}
|
370
|
+
}
|
371
|
+
|
372
|
+
// update!
|
373
|
+
this._updateViewRenderer();
|
374
|
+
this._updateRenderer();
|
375
|
+
},
|
376
|
+
|
377
|
+
/**
|
378
|
+
@private
|
379
|
+
Updates the view's renderer, if one exists, calling all mixins to renderer as well.
|
380
|
+
*/
|
381
|
+
_updateRenderer: function() {
|
382
|
+
var mixins, idx, len;
|
383
|
+
if (this.renderer){
|
384
|
+
this.updateRenderer(this.renderer);
|
385
|
+
if (mixins = this.updateRendererMixin) {
|
386
|
+
len = mixins.length;
|
387
|
+
for (idx = 0; idx < len; idx++) mixins[idx].call(this, this.renderer);
|
388
|
+
}
|
389
|
+
}
|
390
|
+
},
|
391
|
+
|
392
|
+
_destroyRenderer: function() {
|
393
|
+
if (!this.renderer) return;
|
394
|
+
this.renderer.destroy();
|
395
|
+
this.renderer = null;
|
396
|
+
},
|
397
|
+
|
183
398
|
// ..........................................................
|
184
399
|
// IS ENABLED SUPPORT
|
185
400
|
//
|
@@ -213,6 +428,38 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
213
428
|
if (ret && (pv = this.get('parentView'))) ret = pv.get('isEnabledInPane');
|
214
429
|
return ret ;
|
215
430
|
}.property('parentView', 'isEnabled'),
|
431
|
+
|
432
|
+
/** @private
|
433
|
+
Observes the isEnabled property and resigns first responder if set to NO.
|
434
|
+
This will avoid cases where, for example, a disabled text field retains
|
435
|
+
its focus rings.
|
436
|
+
|
437
|
+
@observes isEnabled
|
438
|
+
*/
|
439
|
+
_sc_view_isEnabledDidChange: function(){
|
440
|
+
if(!this.get('isEnabled') && this.get('isFirstResponder')){
|
441
|
+
this.resignFirstResponder();
|
442
|
+
}
|
443
|
+
}.observes('isEnabled'),
|
444
|
+
|
445
|
+
// ..........................................................
|
446
|
+
// MULTITOUCH SUPPORT
|
447
|
+
//
|
448
|
+
/**
|
449
|
+
Set to YES if you want to receive touch events for each distinct touch (rather than only
|
450
|
+
the first touch start and last touch end).
|
451
|
+
*/
|
452
|
+
acceptsMultitouch: NO,
|
453
|
+
|
454
|
+
/**
|
455
|
+
Is YES if the view is currently being touched. NO otherwise.
|
456
|
+
*/
|
457
|
+
hasTouch: NO,
|
458
|
+
|
459
|
+
/**
|
460
|
+
Whether to route touch events to mouse events (defaults to YES)
|
461
|
+
*/
|
462
|
+
routeTouch: YES,
|
216
463
|
|
217
464
|
// ..........................................................
|
218
465
|
// IS VISIBLE IN WINDOW SUPPORT
|
@@ -240,6 +487,14 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
240
487
|
*/
|
241
488
|
isVisibleInWindow: NO,
|
242
489
|
|
490
|
+
/**
|
491
|
+
By default we don't disable the context menu. Overriding this property
|
492
|
+
can enable/disable the context menu per view.
|
493
|
+
*/
|
494
|
+
isContextMenuEnabled: function() {
|
495
|
+
return SC.CONTEXT_MENU_ENABLED;
|
496
|
+
}.property(),
|
497
|
+
|
243
498
|
/**
|
244
499
|
Recomputes the isVisibleInWindow property based on the visibility of the
|
245
500
|
view and its parent. If the recomputed value differs from the current
|
@@ -256,45 +511,74 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
256
511
|
@returns {SC.View} receiver
|
257
512
|
*/
|
258
513
|
recomputeIsVisibleInWindow: function(parentViewIsVisible) {
|
259
|
-
var
|
260
|
-
|
514
|
+
var previous = this.get('isVisibleInWindow'),
|
515
|
+
current = this.get('isVisible'),
|
516
|
+
parentView;
|
261
517
|
|
262
518
|
// isVisibleInWindow = isVisible && parentView.isVisibleInWindow
|
263
519
|
// this approach only goes up to the parentView if necessary.
|
264
|
-
if (
|
265
|
-
|
266
|
-
|
267
|
-
|
520
|
+
if (current) {
|
521
|
+
// If we weren't passed in 'parentViewIsVisible' (we generally aren't;
|
522
|
+
// it's an optimization), then calculate it.
|
523
|
+
if (parentViewIsVisible === undefined) {
|
524
|
+
parentView = this.get('parentView');
|
525
|
+
parentViewIsVisible = parentView ? parentView.get('isVisibleInWindow') : NO;
|
526
|
+
}
|
527
|
+
current = current && parentViewIsVisible;
|
268
528
|
}
|
269
529
|
|
270
|
-
//
|
271
|
-
//
|
272
|
-
|
273
|
-
this.
|
530
|
+
// If our visibility has changed, then set the new value and notify our
|
531
|
+
// child views to update their value.
|
532
|
+
//if (previous !== current) {
|
533
|
+
this.set('isVisibleInWindow', current) ;
|
274
534
|
|
275
535
|
var childViews = this.get('childViews'), len = childViews.length, idx;
|
276
536
|
for(idx=0;idx<len;idx++) {
|
277
|
-
childViews[idx].recomputeIsVisibleInWindow(
|
537
|
+
childViews[idx].recomputeIsVisibleInWindow(current);
|
278
538
|
}
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
539
|
+
|
540
|
+
|
541
|
+
// We'll also kick off some necessary work when the visibility changes.
|
542
|
+
// This more appropriately belongs in a 'isVisibleInWindow' observer or
|
543
|
+
// some such helper method because this work is not strictly related to
|
544
|
+
// computing the visibility, but view performance is critical, so
|
545
|
+
// avoiding the extra observer is worthwhile.
|
546
|
+
if (current) {
|
547
|
+
// If we just became visible, update layer + layout if needed...
|
548
|
+
this.displayDidChange();
|
549
|
+
|
284
550
|
if (this.get('childViewsNeedLayout')) {
|
285
551
|
this.invokeOnce(this.layoutChildViewsIfNeeded);
|
286
552
|
}
|
287
553
|
}
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
554
|
+
else {
|
555
|
+
// We need to set some internal state to indicate that we went from
|
556
|
+
// visible to invisible.
|
557
|
+
//
|
558
|
+
// (Typically, invisible views are not updated for performance
|
559
|
+
// reasons, but if we went from visible to invisible, we need to
|
560
|
+
// update once.)
|
561
|
+
this._forceLayerUpdateDueToVisibilityChange = YES;
|
562
|
+
this.displayDidChange();
|
563
|
+
|
564
|
+
// Also, if we were previously 'firstResponder', resign it.
|
565
|
+
if (this.get('isFirstResponder')) this.resignFirstResponder();
|
566
|
+
}
|
567
|
+
//}
|
568
|
+
return this;
|
569
|
+
},
|
570
|
+
|
571
|
+
|
572
|
+
/** @private
|
573
|
+
Whenever the view’s visibility changes, we need to recompute whether it is
|
574
|
+
actually visible inside the window (a view is only visible in the window
|
575
|
+
if it is marked as visibile and its parent view is as well).
|
576
|
+
*/
|
577
|
+
_sc_isVisibleDidChange: function() {
|
578
|
+
this.recomputeIsVisibleInWindow();
|
297
579
|
}.observes('isVisible'),
|
580
|
+
|
581
|
+
|
298
582
|
|
299
583
|
// ..........................................................
|
300
584
|
// CHILD VIEW SUPPORT
|
@@ -371,7 +655,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
371
655
|
if (view.parentView !== this) {
|
372
656
|
throw "%@.removeChild(%@) must belong to parent".fmt(this,view);
|
373
657
|
}
|
374
|
-
|
658
|
+
|
659
|
+
// Animation cleanup
|
660
|
+
if (SC.platform.supportsCSSTransitions) this.resetAnimation();
|
661
|
+
|
375
662
|
// notify views
|
376
663
|
if (view.willRemoveFromParent) view.willRemoveFromParent() ;
|
377
664
|
if (this.willRemoveChild) this.willRemoveChild(view) ;
|
@@ -380,8 +667,8 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
380
667
|
view.set('parentView', null) ;
|
381
668
|
|
382
669
|
// remove view from childViews array.
|
383
|
-
var childViews = this.get('childViews')
|
384
|
-
|
670
|
+
var childViews = this.get('childViews'),
|
671
|
+
idx = childViews.indexOf(view) ;
|
385
672
|
if (idx>=0) childViews.removeAt(idx);
|
386
673
|
|
387
674
|
// The DOM will need some fixing up, note this on the view.
|
@@ -491,6 +778,8 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
491
778
|
parentViewDidChange: function() {
|
492
779
|
this.recomputeIsVisibleInWindow() ;
|
493
780
|
|
781
|
+
this.resetBuildState();
|
782
|
+
this.notifyPropertyChange("baseTheme");
|
494
783
|
this.set('layerLocationNeedsUpdate', YES) ;
|
495
784
|
this.invokeOnce(this.updateLayerLocationIfNeeded) ;
|
496
785
|
|
@@ -504,7 +793,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
504
793
|
this._invalidatePaneCacheForSelfAndAllChildViews();
|
505
794
|
|
506
795
|
return this ;
|
507
|
-
}
|
796
|
+
},
|
508
797
|
|
509
798
|
/** @private
|
510
799
|
We want to cache the 'pane' property, but it's impossible for us to
|
@@ -515,13 +804,16 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
515
804
|
views, and so on.
|
516
805
|
*/
|
517
806
|
_invalidatePaneCacheForSelfAndAllChildViews: function () {
|
807
|
+
var childView, childViews = this.get('childViews'),
|
808
|
+
len = childViews.length, idx ;
|
809
|
+
|
518
810
|
this.notifyPropertyChange('pane');
|
519
811
|
|
520
|
-
var childViews = this.get('childViews'),
|
521
|
-
len = childViews.length, idx ;
|
522
812
|
for (idx=0; idx<len; ++idx) {
|
523
|
-
|
524
|
-
if (childView._invalidatePaneCacheForSelfAndAllChildViews)
|
813
|
+
childView = childViews[idx];
|
814
|
+
if (childView._invalidatePaneCacheForSelfAndAllChildViews) {
|
815
|
+
childView._invalidatePaneCacheForSelfAndAllChildViews();
|
816
|
+
}
|
525
817
|
}
|
526
818
|
},
|
527
819
|
|
@@ -600,6 +892,27 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
600
892
|
return SC.guidFor(this) ;
|
601
893
|
}.property().cacheable(),
|
602
894
|
|
895
|
+
_lastLayerId: null,
|
896
|
+
/**
|
897
|
+
Handles changes in the layer id.
|
898
|
+
*/
|
899
|
+
layerIdDidChange: function() {
|
900
|
+
var layer = this.get("layer");
|
901
|
+
if (layer && this.get("layerId") !== this._lastLayerId) {
|
902
|
+
// if we had an earlier one, remove from view hash.
|
903
|
+
if (this._lastLayerId) delete SC.View.views[this._lastLayerId];
|
904
|
+
|
905
|
+
// set the current one as the new old one
|
906
|
+
this._lastLayerId = this.get("layerId");
|
907
|
+
|
908
|
+
// and add the new one
|
909
|
+
SC.View.views[this.get("layerId")] = this;
|
910
|
+
|
911
|
+
// and finally, set the actual layer id.
|
912
|
+
layer.id = this.get("layerId");
|
913
|
+
}
|
914
|
+
}.observes("layerId"),
|
915
|
+
|
603
916
|
/**
|
604
917
|
Attempts to discover the layer in the parent layer. The default
|
605
918
|
implementation looks for an element with an ID of layerId (or the view's
|
@@ -654,6 +967,20 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
654
967
|
return elem;
|
655
968
|
},
|
656
969
|
|
970
|
+
/**
|
971
|
+
Returns YES if the receiver is a subview of a given view or if it’s
|
972
|
+
identical to that view. Otherwise, it returns NO.
|
973
|
+
|
974
|
+
@property {SC.View} view
|
975
|
+
*/
|
976
|
+
isDescendantOf: function(view) {
|
977
|
+
var parentView = this.get('parentView');
|
978
|
+
|
979
|
+
if(this===view) return YES;
|
980
|
+
else if(parentView) return parentView.isDescendantOf(view);
|
981
|
+
else return NO;
|
982
|
+
},
|
983
|
+
|
657
984
|
/**
|
658
985
|
This method is invoked whenever a display property changes. It will set
|
659
986
|
the layerNeedsUpdate method to YES. If you need to perform additional
|
@@ -701,14 +1028,13 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
701
1028
|
You should not override this method. Instead override updateLayer() or
|
702
1029
|
render().
|
703
1030
|
|
704
|
-
@param {Boolean} isVisible if true assume view is visible even if it is not.
|
705
1031
|
@returns {SC.View} receiver
|
706
1032
|
@test in updateLayer
|
707
1033
|
*/
|
708
1034
|
updateLayerIfNeeded: function() {
|
709
|
-
var
|
710
|
-
|
711
|
-
|
1035
|
+
var force = this._forceLayerUpdateDueToVisibilityChange,
|
1036
|
+
shouldUpdate = (force || this.get('isVisibleInWindow')) && this.get('layerNeedsUpdate');
|
1037
|
+
if (shouldUpdate) {
|
712
1038
|
// only update a layer if it already exists
|
713
1039
|
if (this.get('layer')) {
|
714
1040
|
this.beginPropertyChanges() ;
|
@@ -718,6 +1044,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
718
1044
|
}
|
719
1045
|
}
|
720
1046
|
else this.set('layerNeedsUpdate', NO) ;
|
1047
|
+
|
1048
|
+
// If we were forcing the layer update for this round, clear the flag.
|
1049
|
+
this._forceLayerUpdateDueToVisibilityChange = NO;
|
1050
|
+
|
721
1051
|
return this ;
|
722
1052
|
},
|
723
1053
|
|
@@ -736,20 +1066,47 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
736
1066
|
do not want your render() method called when updating a layer, then you
|
737
1067
|
should override this method instead.
|
738
1068
|
|
1069
|
+
@param optionalContext provided only for backwards-compatibility.
|
1070
|
+
|
739
1071
|
@returns {SC.View} receiver
|
740
1072
|
*/
|
741
|
-
updateLayer: function() {
|
742
|
-
var
|
743
|
-
this.
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
1073
|
+
updateLayer: function(optionalContext) {
|
1074
|
+
var mixins, idx, len, renderer = this.renderer, viewRenderer = this._viewRenderer;
|
1075
|
+
this.updateViewSettings();
|
1076
|
+
|
1077
|
+
// make sure to update any renderers
|
1078
|
+
this._updateViewRenderer();
|
1079
|
+
this._updateRenderer();
|
1080
|
+
|
1081
|
+
// Now, update using renderer if possible; render() otherwise
|
1082
|
+
if (!this._useRenderFirst && this.createRenderer) {
|
1083
|
+
if (renderer) renderer.update();
|
1084
|
+
if (viewRenderer) viewRenderer.update();
|
1085
|
+
} else {
|
1086
|
+
var context = optionalContext || this.renderContext(this.get('layer')) ;
|
1087
|
+
this.render(context, NO) ;
|
1088
|
+
if (mixins = this.renderMixin) {
|
1089
|
+
len = mixins.length;
|
1090
|
+
for(idx=0; idx<len; ++idx) mixins[idx].call(this, context, NO) ;
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
context.update() ;
|
1094
|
+
if (context._innerHTMLReplaced) {
|
1095
|
+
var pane = this.get('pane');
|
1096
|
+
if(pane && pane.get('isPaneAttached')) {
|
1097
|
+
this._notifyDidAppendToDocument();
|
1098
|
+
}
|
749
1099
|
}
|
750
1100
|
}
|
1101
|
+
|
1102
|
+
// If this view uses static layout, then notify that the frame (likely)
|
1103
|
+
// changed.
|
1104
|
+
if (this.useStaticLayout) this.viewDidResize();
|
1105
|
+
|
751
1106
|
if (this.didUpdateLayer) this.didUpdateLayer(); // call to update DOM
|
752
|
-
if(this.designer && this.designer.viewDidUpdateLayer)
|
1107
|
+
if(this.designer && this.designer.viewDidUpdateLayer) {
|
1108
|
+
this.designer.viewDidUpdateLayer(); //let the designer know
|
1109
|
+
}
|
753
1110
|
return this ;
|
754
1111
|
},
|
755
1112
|
|
@@ -782,7 +1139,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
782
1139
|
var context = this.renderContext(this.get('tagName')) ;
|
783
1140
|
|
784
1141
|
// now prepare the content like normal.
|
785
|
-
this.
|
1142
|
+
this.renderToContext(context) ;
|
786
1143
|
this.set('layer', context.element()) ;
|
787
1144
|
|
788
1145
|
// now notify the view and its child views..
|
@@ -796,7 +1153,20 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
796
1153
|
invokes the same on all child views.
|
797
1154
|
*/
|
798
1155
|
_notifyDidCreateLayer: function() {
|
1156
|
+
// notify, not just the view, but also the view renderers
|
1157
|
+
this.notifyPropertyChange("layer");
|
1158
|
+
this._viewRenderer.attachLayer(this);
|
1159
|
+
if (this.renderer) this.renderer.attachLayer(this);
|
799
1160
|
if (this.didCreateLayer) this.didCreateLayer() ;
|
1161
|
+
|
1162
|
+
// Animation prep
|
1163
|
+
if (SC.platform.supportsCSSTransitions) {
|
1164
|
+
this.resetAnimation();
|
1165
|
+
SC.Event.add(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this._scv_animationEnd);
|
1166
|
+
SC.Event.add(this.get('layer'), "transitionEnd", this, this._scv_animationEnd);
|
1167
|
+
}
|
1168
|
+
|
1169
|
+
// and notify others
|
800
1170
|
var mixins = this.didCreateLayerMixin, len, idx,
|
801
1171
|
childViews = this.get('childViews');
|
802
1172
|
if (mixins) {
|
@@ -832,10 +1202,26 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
832
1202
|
destroyLayer: function() {
|
833
1203
|
var layer = this.get('layer') ;
|
834
1204
|
if (layer) {
|
1205
|
+
|
1206
|
+
// Teardown animations
|
1207
|
+
if (SC.platform.supportsCSSTransitions) {
|
1208
|
+
SC.Event.remove(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this._scv_animationEnd);
|
1209
|
+
SC.Event.remove(this.get('layer'), "transitionEnd", this, this._scv_animationEnd);
|
1210
|
+
}
|
1211
|
+
|
835
1212
|
// Now notify the view and its child views. It will also set the
|
836
1213
|
// layer property to null.
|
837
1214
|
this._notifyWillDestroyLayer() ;
|
838
1215
|
|
1216
|
+
if (this._viewRenderer) {
|
1217
|
+
this._viewRenderer.detachLayer();
|
1218
|
+
}
|
1219
|
+
|
1220
|
+
// tell the renderer the layer has gone away
|
1221
|
+
if (this.renderer) {
|
1222
|
+
this.renderer.detachLayer();
|
1223
|
+
}
|
1224
|
+
|
839
1225
|
// do final cleanup
|
840
1226
|
if (layer.parentNode) layer.parentNode.removeChild(layer) ;
|
841
1227
|
layer = null ;
|
@@ -874,53 +1260,134 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
874
1260
|
this.set('layer', null) ;
|
875
1261
|
},
|
876
1262
|
|
1263
|
+
|
1264
|
+
isLayerProvider: YES,
|
1265
|
+
/**
|
1266
|
+
@private (semi)
|
1267
|
+
Returns the layer. Meant only for use from renderers and such—this is a layer provider function.
|
1268
|
+
*/
|
1269
|
+
getLayer: function() {
|
1270
|
+
return this.get("layer");
|
1271
|
+
},
|
1272
|
+
|
1273
|
+
/**
|
1274
|
+
@private
|
1275
|
+
|
1276
|
+
Renders to a context.
|
1277
|
+
Rendering only happens for the initial rendering. Further updates happen in updateLayer,
|
1278
|
+
and are not done to contexts, but to layers.
|
1279
|
+
|
1280
|
+
Both renderToContext and updateLayer will call render(context, firstTime) as needed
|
1281
|
+
to maintain backwards compatibility, but prefer calling createRenderer.
|
1282
|
+
|
1283
|
+
Note: You should not generally override nor directly call this method. This method is only
|
1284
|
+
called by createLayer to set up the layer initially, and by renderChildViews, to write to
|
1285
|
+
a context.
|
1286
|
+
|
1287
|
+
@param {SC.RenderContext} context the render context.
|
1288
|
+
@param {Boolean} firstTime Provided for compatibility when rendering legacy views only.
|
1289
|
+
*/
|
1290
|
+
renderToContext: function(context, firstTime) {
|
1291
|
+
var mixins, idx, len;
|
1292
|
+
|
1293
|
+
this.beginPropertyChanges() ;
|
1294
|
+
this.set('layerNeedsUpdate', NO) ;
|
1295
|
+
|
1296
|
+
this.renderViewSettings(context);
|
1297
|
+
|
1298
|
+
/* Now, the actual rendering, which will use a renderer if possible */
|
1299
|
+
// the renderer will have been created when the theme was found; if it is around,
|
1300
|
+
// we just need to ensure it is up-to-date
|
1301
|
+
if (this.createRenderer) {
|
1302
|
+
// our private version does mixins too! Yay!
|
1303
|
+
this._updateRenderer();
|
1304
|
+
}
|
1305
|
+
|
1306
|
+
if (!this._useRenderFirst && this.createRenderer) {
|
1307
|
+
if (this.renderer) this.renderer.render(context);
|
1308
|
+
} else {
|
1309
|
+
if (SC.none(firstTime)) firstTime = YES;
|
1310
|
+
|
1311
|
+
this.render(context, firstTime);
|
1312
|
+
if (mixins = this.renderMixin) {
|
1313
|
+
len = mixins.length;
|
1314
|
+
for(idx=0; idx<len; ++idx) mixins[idx].call(this, context, firstTime) ;
|
1315
|
+
}
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
this.endPropertyChanges() ;
|
1319
|
+
},
|
1320
|
+
|
1321
|
+
/**
|
1322
|
+
@private
|
1323
|
+
Updates the properties of the renderer used for the view
|
1324
|
+
*/
|
1325
|
+
_updateViewRenderer: function() {
|
1326
|
+
if (!this._viewRenderer) return;
|
1327
|
+
|
1328
|
+
var classNames = this.get('classNames');
|
1329
|
+
if (this.get('theme')) {
|
1330
|
+
classNames = classNames.concat(this.get("theme").classNames);
|
1331
|
+
}
|
1332
|
+
|
1333
|
+
this._scv_willRenderAnimations();
|
1334
|
+
|
1335
|
+
this._viewRenderer.attr({
|
1336
|
+
layerId: this.layerId ? this.get('layerId') : SC.guidFor(this),
|
1337
|
+
classNames: classNames,
|
1338
|
+
backgroundColor: this.get('backgroundColor'),
|
1339
|
+
cursor: this.get('cursor'),
|
1340
|
+
layoutStyle: this.get('layoutStyle'),
|
1341
|
+
isTextSelectable: this.get('isTextSelectable'),
|
1342
|
+
isEnabled: this.get('isEnabled'),
|
1343
|
+
isVisible: this.get('isVisible'),
|
1344
|
+
isFirstResponder: this.get('isFirstResponder'),
|
1345
|
+
hasStaticLayout: this.get('useStaticLayout')
|
1346
|
+
});
|
1347
|
+
},
|
1348
|
+
|
1349
|
+
/**
|
1350
|
+
@private
|
1351
|
+
Renders view settings (class names and id, for instance) to the context.
|
1352
|
+
*/
|
1353
|
+
renderViewSettings: function(context) {
|
1354
|
+
this._updateViewRenderer();
|
1355
|
+
this.renderLayout(context, YES); // provide backwards compatibility
|
1356
|
+
this._viewRenderer.render(context);
|
1357
|
+
},
|
1358
|
+
|
1359
|
+
/**
|
1360
|
+
@private
|
1361
|
+
Updates view settings on the context (including class names).
|
1362
|
+
*/
|
1363
|
+
updateViewSettings: function() {
|
1364
|
+
this._updateViewRenderer();
|
1365
|
+
this._viewRenderer.update();
|
1366
|
+
},
|
1367
|
+
|
877
1368
|
/**
|
1369
|
+
@private
|
1370
|
+
|
878
1371
|
Invoked by createLayer() and updateLayer() to actually render a context.
|
879
1372
|
This method calls the render() method on your view along with any
|
880
1373
|
renderMixin() methods supplied by mixins you might have added.
|
881
1374
|
|
882
|
-
You should not override this method directly.
|
883
|
-
this method if you choose to override updateLayer() or createLayer().
|
1375
|
+
You should not override this method directly. Nor should you call it. It is OLD.
|
884
1376
|
|
885
1377
|
@param {SC.RenderContext} context the render context
|
886
1378
|
@param {Boolean} firstTime YES if this is creating a layer
|
887
1379
|
@returns {void}
|
888
1380
|
*/
|
889
1381
|
prepareContext: function(context, firstTime) {
|
890
|
-
|
891
|
-
|
892
|
-
//
|
1382
|
+
// eventually, firstTime will be removed because it is ugly.
|
1383
|
+
// for now, we will sense whether we are doing things the ugly way or not.
|
1384
|
+
// if ugly, we will allow updates through.
|
1385
|
+
if (SC.none(firstTime)) firstTime = YES; // the GOOD code path :)
|
893
1386
|
if (firstTime) {
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
context.id(layerId).classNames(this.get('classNames'), YES) ;
|
898
|
-
this.renderLayout(context, firstTime) ;
|
899
|
-
}else{
|
900
|
-
context.resetClassNames();
|
901
|
-
context.classNames(this.get('classNames'), YES);
|
902
|
-
}
|
903
|
-
|
904
|
-
// do some standard setup...
|
905
|
-
if (this.get('isTextSelectable')) context.addClass('allow-select') ;
|
906
|
-
if (!this.get('isEnabled')) context.addClass('disabled') ;
|
907
|
-
if (!this.get('isVisible')) context.addClass('hidden') ;
|
908
|
-
if (this.get('isFirstResponder')) context.addClass('focus');
|
909
|
-
|
910
|
-
bgcolor = this.get('backgroundColor');
|
911
|
-
if (bgcolor) context.addStyle('backgroundColor', bgcolor);
|
912
|
-
|
913
|
-
cursor = this.get('cursor') ;
|
914
|
-
if (cursor) context.addClass(cursor.get('className')) ;
|
915
|
-
|
916
|
-
this.beginPropertyChanges() ;
|
917
|
-
this.set('layerNeedsUpdate', NO) ;
|
918
|
-
this.render(context, firstTime) ;
|
919
|
-
if (mixins = this.renderMixin) {
|
920
|
-
len = mixins.length;
|
921
|
-
for(idx=0; idx<len; ++idx) mixins[idx].call(this, context, firstTime) ;
|
1387
|
+
this.renderToContext(context);
|
1388
|
+
} else {
|
1389
|
+
this.updateLayer(context);
|
922
1390
|
}
|
923
|
-
this.endPropertyChanges() ;
|
924
1391
|
},
|
925
1392
|
|
926
1393
|
/**
|
@@ -929,21 +1396,62 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
929
1396
|
walk down the childView chain, rendering all of the children in a nested
|
930
1397
|
way.
|
931
1398
|
|
1399
|
+
If a context is provided, it is always assumed to be firstTime.
|
1400
|
+
|
1401
|
+
@deprecated In SproutCore 1.1. Use renderContent and updateContent explicitly instead.
|
932
1402
|
@param {SC.RenderContext} context the context
|
933
1403
|
@param {Boolean} firstName true if the layer is being created
|
934
1404
|
@returns {SC.RenderContext} the render context
|
935
|
-
@test in render
|
1405
|
+
@test in render and renderer
|
936
1406
|
*/
|
937
1407
|
renderChildViews: function(context, firstTime) {
|
1408
|
+
if (firstTime || context) {
|
1409
|
+
// we pass along firstTime for compatibility. Some older (less wise) views may
|
1410
|
+
// think it will work. Well, it wouldn't, but we'll make it work.
|
1411
|
+
this.renderContent(context, firstTime);
|
1412
|
+
} else {
|
1413
|
+
this.updateContent(context);
|
1414
|
+
}
|
1415
|
+
return context;
|
1416
|
+
},
|
1417
|
+
|
1418
|
+
/**
|
1419
|
+
@private
|
1420
|
+
Views are content suppliers for renderers. That is, views pass themselves to renderers
|
1421
|
+
for renderers' "content" properties. Content providers have two functions: renderContent and updateContent.
|
1422
|
+
This is the first of those.
|
1423
|
+
|
1424
|
+
@param {SC.RenderContext} context
|
1425
|
+
@param {Boolean} firstTime For compatibility (do not use; if not first time, call updateContent).
|
1426
|
+
*/
|
1427
|
+
renderContent: function(context, firstTime) {
|
938
1428
|
var cv = this.get('childViews'), len = cv.length, idx, view ;
|
939
1429
|
for (idx=0; idx<len; ++idx) {
|
940
1430
|
view = cv[idx] ;
|
941
1431
|
if (!view) continue;
|
942
1432
|
context = context.begin(view.get('tagName')) ;
|
943
|
-
view.
|
1433
|
+
view.renderToContext(context, firstTime);
|
944
1434
|
context = context.end() ;
|
945
1435
|
}
|
946
|
-
|
1436
|
+
},
|
1437
|
+
|
1438
|
+
/**
|
1439
|
+
@private
|
1440
|
+
Views are content suppliers for renderers. That is, views pass themselves to renderers
|
1441
|
+
for renderers' "content" properties. Content providers have two functions: renderContent and updateContent.
|
1442
|
+
This is the first of those.
|
1443
|
+
|
1444
|
+
For old-style rendering, the render context created by the parent renderer is passed along
|
1445
|
+
as well.
|
1446
|
+
*/
|
1447
|
+
updateContent: function(optionalContext) {
|
1448
|
+
var cv = this.get('childViews'), len = cv.length, idx, view ;
|
1449
|
+
for (idx=0; idx<len; ++idx) {
|
1450
|
+
view = cv[idx] ;
|
1451
|
+
if (!view) continue;
|
1452
|
+
|
1453
|
+
view.updateLayer(optionalContext);
|
1454
|
+
}
|
947
1455
|
},
|
948
1456
|
|
949
1457
|
/**
|
@@ -965,19 +1473,29 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
965
1473
|
@param {SC.RenderContext} context the render context
|
966
1474
|
@param {Boolean} firstTime YES if this is creating a layer
|
967
1475
|
@returns {void}
|
968
|
-
*/
|
1476
|
+
*/
|
969
1477
|
render: function(context, firstTime) {
|
970
|
-
|
1478
|
+
var renderer = this.renderer;
|
1479
|
+
if (this.createRenderer && renderer) {
|
1480
|
+
if (firstTime) {
|
1481
|
+
renderer.render(context);
|
1482
|
+
} else {
|
1483
|
+
renderer.update();
|
1484
|
+
}
|
1485
|
+
} else {
|
1486
|
+
if (firstTime) this.renderChildViews(context, firstTime);
|
1487
|
+
}
|
971
1488
|
},
|
972
1489
|
|
973
1490
|
|
974
1491
|
/** @private -
|
975
|
-
Invokes the receivers didAppendLayerToDocument() method if it exists and
|
976
|
-
invokes the same on all child views.
|
1492
|
+
Invokes the receivers didAppendLayerToDocument() method if it exists and
|
1493
|
+
then invokes the same on all child views.
|
977
1494
|
*/
|
978
1495
|
|
979
1496
|
_notifyDidAppendToDocument: function() {
|
980
|
-
if(this.didAppendToDocument) this.didAppendToDocument();
|
1497
|
+
if (this.didAppendToDocument) this.didAppendToDocument();
|
1498
|
+
|
981
1499
|
var i=0, child, childLen, children = this.get('childViews');
|
982
1500
|
for(i=0, childLen=children.length; i<childLen; i++) {
|
983
1501
|
child = children[i];
|
@@ -1040,15 +1558,27 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1040
1558
|
displayProperties: ['isFirstResponder', 'isVisible'],
|
1041
1559
|
|
1042
1560
|
/**
|
1043
|
-
You can set this to an SC.Cursor instance;
|
1044
|
-
automatically be added to the layer's classNames
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1561
|
+
You can set this to an SC.Cursor instance; its class name will
|
1562
|
+
automatically be added to the layer's classNames, allowing you
|
1563
|
+
to efficiently change the cursor for a large group of views with
|
1564
|
+
just one change to the SC.Cursor object. The cursor property
|
1565
|
+
is only used when the layer is created, so if you need to change
|
1566
|
+
it to a different cursor object, you will have to destroy and
|
1567
|
+
recreate the view layer. (In this case you might investigate
|
1568
|
+
setting cursors using CSS directly instead of SC.Cursor.)
|
1569
|
+
|
1570
|
+
@property {SC.Cursor String}
|
1049
1571
|
*/
|
1050
1572
|
cursor: null,
|
1051
1573
|
|
1574
|
+
/**
|
1575
|
+
A child view without a cursor of its own inherits its parent's cursor by
|
1576
|
+
default. Set this to NO to prevent this behavior.
|
1577
|
+
|
1578
|
+
@property {Boolean}
|
1579
|
+
*/
|
1580
|
+
shouldInheritCursor: YES,
|
1581
|
+
|
1052
1582
|
// ..........................................................
|
1053
1583
|
// LAYER LOCATION
|
1054
1584
|
//
|
@@ -1117,11 +1647,12 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1117
1647
|
if (!node) {
|
1118
1648
|
this.createLayer() ;
|
1119
1649
|
node = this.get('layer') ;
|
1650
|
+
if (!node) return; // can't do anything without a node.
|
1120
1651
|
}
|
1121
1652
|
|
1122
|
-
var siblings = parentView.get('childViews')
|
1123
|
-
|
1124
|
-
|
1653
|
+
var siblings = parentView.get('childViews'),
|
1654
|
+
nextView = siblings.objectAt(siblings.indexOf(this)+1),
|
1655
|
+
nextNode = (nextView) ? nextView.get('layer') : null ;
|
1125
1656
|
|
1126
1657
|
// before we add to parent node, make sure that the nextNode exists...
|
1127
1658
|
if (nextView && (!nextNode || nextNode.parentNode!==parentNode)) {
|
@@ -1129,12 +1660,9 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1129
1660
|
nextNode = nextView.get('layer') ;
|
1130
1661
|
}
|
1131
1662
|
|
1132
|
-
// add to parentNode if needed.
|
1133
|
-
// that its parentView has resized since joining a parentView has the
|
1134
|
-
// same effect.
|
1663
|
+
// add to parentNode if needed.
|
1135
1664
|
if ((node.parentNode!==parentNode) || (node.nextSibling!==nextNode)) {
|
1136
1665
|
parentNode.insertBefore(node, nextNode) ;
|
1137
|
-
if (this.parentViewDidResize) this.parentViewDidResize() ;
|
1138
1666
|
}
|
1139
1667
|
}
|
1140
1668
|
|
@@ -1172,18 +1700,24 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1172
1700
|
isKeyResponder: NO,
|
1173
1701
|
|
1174
1702
|
/**
|
1175
|
-
This method is invoked just before you lost the key responder status.
|
1176
|
-
|
1177
|
-
|
1703
|
+
This method is invoked just before you lost the key responder status.
|
1704
|
+
The passed view is the view that is about to gain keyResponder status.
|
1705
|
+
This gives you a chance to do any early setup. Remember that you can
|
1706
|
+
gain/lose key responder status either because another view in the same
|
1707
|
+
pane is becoming first responder or because another pane is about to
|
1708
|
+
become key.
|
1178
1709
|
|
1179
1710
|
@param {SC.Responder} responder
|
1180
1711
|
*/
|
1181
1712
|
willLoseKeyResponderTo: function(responder) {},
|
1182
1713
|
|
1183
1714
|
/**
|
1184
|
-
This method is invoked just before you become the key responder. The
|
1185
|
-
|
1186
|
-
|
1715
|
+
This method is invoked just before you become the key responder. The
|
1716
|
+
passed view is the view that is about to lose keyResponder status. You
|
1717
|
+
can use this to do any setup before the view changes.
|
1718
|
+
Remember that you can gain/lose key responder status either because
|
1719
|
+
another view in the same pane is becoming first responder or because
|
1720
|
+
another pane is about to become key.
|
1187
1721
|
|
1188
1722
|
@param {SC.Responder} responder
|
1189
1723
|
*/
|
@@ -1200,7 +1734,11 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1200
1734
|
didBecomeKeyResponderFrom: function(responder) {},
|
1201
1735
|
|
1202
1736
|
/**
|
1203
|
-
This method will process a key input event, attempting to convert it to
|
1737
|
+
This method will process a key input event, attempting to convert it to
|
1738
|
+
an appropriate action method and sending it up the responder chain. The
|
1739
|
+
event is converted using the SC.KEY_BINDINGS hash, which maps key events
|
1740
|
+
into method names. If no key binding is found, then the key event will
|
1741
|
+
be passed along using an insertText() method.
|
1204
1742
|
|
1205
1743
|
@param {SC.Event} event
|
1206
1744
|
@returns {Object} object that handled event, if any
|
@@ -1234,7 +1772,9 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1234
1772
|
},
|
1235
1773
|
|
1236
1774
|
/**
|
1237
|
-
This method is invoked by interpretKeyEvents() when you receive a key
|
1775
|
+
This method is invoked by interpretKeyEvents() when you receive a key
|
1776
|
+
event matching some plain text. You can use this to actually insert the
|
1777
|
+
text into your application, if needed.
|
1238
1778
|
|
1239
1779
|
@param {SC.Event} event
|
1240
1780
|
@returns {Object} receiver or object that handled event
|
@@ -1283,13 +1823,19 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1283
1823
|
@type SC.View
|
1284
1824
|
*/
|
1285
1825
|
nextValidKeyView: function() {
|
1286
|
-
var seen = [],
|
1287
|
-
rootView = this.pane(), ret;
|
1288
|
-
|
1826
|
+
var seen = [],
|
1827
|
+
rootView = this.pane(), ret = this.get('nextKeyView');
|
1828
|
+
|
1829
|
+
if(!ret) ret = rootView._computeNextValidKeyView(this, seen);
|
1830
|
+
|
1831
|
+
if(SC.TABBING_ONLY_INSIDE_DOCUMENT && !ret) {
|
1832
|
+
ret = rootView._computeNextValidKeyView(rootView, seen);
|
1833
|
+
}
|
1834
|
+
|
1289
1835
|
return ret ;
|
1290
1836
|
}.property('nextKeyView'),
|
1291
1837
|
|
1292
|
-
_computeNextValidKeyView: function(currentView, seen) {
|
1838
|
+
_computeNextValidKeyView: function(currentView, seen) {
|
1293
1839
|
var ret = this.get('nextKeyView'),
|
1294
1840
|
children, i, childLen, child;
|
1295
1841
|
if(this !== currentView && seen.indexOf(currentView)!=-1 &&
|
@@ -1301,7 +1847,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1301
1847
|
// find next sibling
|
1302
1848
|
if (!ret) {
|
1303
1849
|
children = this.get('childViews');
|
1304
|
-
for(i=0, childLen= children.length; i<childLen; i++){
|
1850
|
+
for(i=0, childLen = children.length; i<childLen; i++){
|
1305
1851
|
child = children[i];
|
1306
1852
|
if(child.get('isVisibleInWindow') && child.get('isVisible')){
|
1307
1853
|
ret = child._computeNextValidKeyView(currentView, seen);
|
@@ -1329,8 +1875,8 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1329
1875
|
*/
|
1330
1876
|
previousValidKeyView: function() {
|
1331
1877
|
var seen = [],
|
1332
|
-
rootView = this.pane(), ret;
|
1333
|
-
ret = rootView._computePreviousValidKeyView(this, seen);
|
1878
|
+
rootView = this.pane(), ret = this.get('previousKeyView');
|
1879
|
+
if(!ret) ret = rootView._computePreviousValidKeyView(this, seen);
|
1334
1880
|
return ret ;
|
1335
1881
|
}.property('previousKeyView'),
|
1336
1882
|
|
@@ -1374,6 +1920,32 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1374
1920
|
|
1375
1921
|
sc_super() ;
|
1376
1922
|
|
1923
|
+
// set up theme
|
1924
|
+
var baseTheme = this.baseTheme;
|
1925
|
+
this.baseTheme = this._baseThemeProperty;
|
1926
|
+
this.set("baseTheme", baseTheme);
|
1927
|
+
|
1928
|
+
var theme = this.theme;
|
1929
|
+
this.theme = this._themeProperty;
|
1930
|
+
this.set("theme", theme);
|
1931
|
+
|
1932
|
+
// find render path (to be removed in SC 2.0?)
|
1933
|
+
var renderAge = -1, rendererAge = -1, currentAge = 0, c = this.constructor;
|
1934
|
+
while (c && c.prototype.render) {
|
1935
|
+
if (renderAge < 0 && c.prototype.render !== this.render) renderAge = currentAge;
|
1936
|
+
if (rendererAge < 0 && c.prototype.createRenderer !== this.createRenderer) rendererAge = currentAge;
|
1937
|
+
if (rendererAge >= 0 && renderAge >= 0) break;
|
1938
|
+
currentAge = currentAge + 1;
|
1939
|
+
c = c.superclass;
|
1940
|
+
}
|
1941
|
+
|
1942
|
+
// which one?
|
1943
|
+
if (renderAge < rendererAge && renderAge >= 0) {
|
1944
|
+
this._useRenderFirst = YES;
|
1945
|
+
} else {
|
1946
|
+
this._useRenderFirst = NO;
|
1947
|
+
}
|
1948
|
+
|
1377
1949
|
// register for event handling now if we're not a materialized view
|
1378
1950
|
// (materialized views register themselves as needed)
|
1379
1951
|
if (!this.get('isMaterialized')) {
|
@@ -1385,6 +1957,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1385
1957
|
// setup child views. be sure to clone the child views array first
|
1386
1958
|
this.childViews = childViews ? childViews.slice() : [] ;
|
1387
1959
|
this.createChildViews() ; // setup child Views
|
1960
|
+
this._hasCreatedChildViews = YES;
|
1388
1961
|
|
1389
1962
|
// register display property observers ..
|
1390
1963
|
// TODO: Optimize into class setup
|
@@ -1430,18 +2003,20 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1430
2003
|
*/
|
1431
2004
|
destroy: function() {
|
1432
2005
|
if (this.get('isDestroyed')) return this; // nothing to do
|
1433
|
-
|
1434
|
-
|
2006
|
+
|
2007
|
+
this._destroy(); // core destroy method
|
1435
2008
|
|
1436
2009
|
// remove from parent if found
|
1437
2010
|
this.removeFromParent() ;
|
1438
|
-
this._destroy(); // core destroy method
|
1439
2011
|
|
1440
2012
|
// unregister for drags
|
1441
2013
|
if (this.get('isDropTarget')) SC.Drag.removeDropTarget(this) ;
|
1442
2014
|
|
1443
2015
|
// unregister for autoscroll during drags
|
1444
2016
|
if (this.get('isScrollable')) SC.Drag.removeScrollableView(this) ;
|
2017
|
+
|
2018
|
+
//Do generic destroy. It takes care of mixins and sets isDestroyed to YES.
|
2019
|
+
sc_super();
|
1445
2020
|
return this; // done with cleanup
|
1446
2021
|
},
|
1447
2022
|
|
@@ -1456,7 +2031,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1456
2031
|
var childViews = this.get('childViews'), len = childViews.length, idx ;
|
1457
2032
|
if (len) {
|
1458
2033
|
childViews = childViews.slice() ;
|
1459
|
-
for (idx=0; idx<len; ++idx) childViews[idx].
|
2034
|
+
for (idx=0; idx<len; ++idx) childViews[idx].destroy() ;
|
1460
2035
|
}
|
1461
2036
|
|
1462
2037
|
// next remove view from global hash
|
@@ -1464,8 +2039,6 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1464
2039
|
delete this._CQ ;
|
1465
2040
|
delete this.page ;
|
1466
2041
|
|
1467
|
-
// mark as destroyed so we don't do this again
|
1468
|
-
this.set('isDestroyed', YES) ;
|
1469
2042
|
return this ;
|
1470
2043
|
},
|
1471
2044
|
|
@@ -1550,7 +2123,29 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1550
2123
|
// ...........................................
|
1551
2124
|
// LAYOUT
|
1552
2125
|
//
|
1553
|
-
|
2126
|
+
|
2127
|
+
/**
|
2128
|
+
The 'frame' property depends on the 'layout' property as well as the
|
2129
|
+
parent view’s frame. In order to properly invalidate any cached values,
|
2130
|
+
we need to invalidate the cache whenever 'layout' changes. However,
|
2131
|
+
observing 'layout' does not guarantee that; the observer might not be run
|
2132
|
+
immediately.
|
2133
|
+
|
2134
|
+
In order to avoid any window of opportunity where the cached frame could
|
2135
|
+
be invalid, we need to force layoutDidChange() to always immediately run
|
2136
|
+
whenever 'layout' is set.
|
2137
|
+
*/
|
2138
|
+
propertyDidChange: function(key, value, _keepCache) {
|
2139
|
+
// If the key is 'layout', we need to call layoutDidChange() immediately
|
2140
|
+
// so that if the frame has changed any cached values (for both this view
|
2141
|
+
// and any child views) can be appropriately invalidated.
|
2142
|
+
if (key === 'layout') this.layoutDidChange();
|
2143
|
+
|
2144
|
+
// Resume notification as usual.
|
2145
|
+
sc_super();
|
2146
|
+
},
|
2147
|
+
|
2148
|
+
|
1554
2149
|
/**
|
1555
2150
|
This convenience method will take the current layout, apply any changes
|
1556
2151
|
you pass and set it again. It is more convenient than having to do this
|
@@ -1599,13 +2194,221 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1599
2194
|
}
|
1600
2195
|
}
|
1601
2196
|
}
|
2197
|
+
// now set adjusted layout
|
2198
|
+
if (didChange) this.set('layout', layout) ;
|
1602
2199
|
|
2200
|
+
return this ;
|
2201
|
+
},
|
2202
|
+
|
2203
|
+
|
2204
|
+
/**
|
2205
|
+
Animate a given property using CSS animations.
|
2206
|
+
|
2207
|
+
Takes a key, value and either a duration, or a hash of options.
|
2208
|
+
The options hash has the following parameters
|
2209
|
+
- duration: Duration of animation in seconds
|
2210
|
+
- callback: Callback method to run when animation completes
|
2211
|
+
- timing: Animation timing function
|
2212
|
+
|
2213
|
+
@param {String|Hash} key
|
2214
|
+
@param {Object} value
|
2215
|
+
@params {Number|Hash} duration or options
|
2216
|
+
@returns {SC.View} receiver
|
2217
|
+
*/
|
2218
|
+
animate: function(keyOrHash, valueOrOptions, optionsOrCallback, callback) {
|
2219
|
+
var hash, options;
|
2220
|
+
|
2221
|
+
if (SC.typeOf(keyOrHash) === SC.T_HASH) {
|
2222
|
+
hash = keyOrHash;
|
2223
|
+
options = valueOrOptions;
|
2224
|
+
callback = optionsOrCallback;
|
2225
|
+
} else {
|
2226
|
+
hash = {};
|
2227
|
+
hash[keyOrHash] = valueOrOptions;
|
2228
|
+
options = optionsOrCallback;
|
2229
|
+
}
|
2230
|
+
|
2231
|
+
if (SC.typeOf(options) === SC.T_NUMBER) {
|
2232
|
+
options = { duration: options };
|
2233
|
+
} else if (SC.typeOf(options) !== SC.T_HASH) {
|
2234
|
+
throw "Must provide options hash or duration!";
|
2235
|
+
}
|
2236
|
+
|
2237
|
+
if (callback) options.callback = callback;
|
2238
|
+
|
2239
|
+
|
2240
|
+
var layout = SC.clone(this.get('layout')), didChange = NO, value, cur, animValue, curAnim;
|
2241
|
+
|
2242
|
+
for(key in hash) {
|
2243
|
+
if (!hash.hasOwnProperty(key)) continue;
|
2244
|
+
value = hash[key];
|
2245
|
+
cur = layout[key];
|
2246
|
+
|
2247
|
+
if (SC.ANIMATABLE_PROPERTIES.contains(key)) {
|
2248
|
+
curAnim = layout['animate'+key.capitalize()];
|
2249
|
+
|
2250
|
+
if (value === null || value === undefined) {
|
2251
|
+
throw "Can only animate to an actual value!";
|
2252
|
+
} else {
|
2253
|
+
if (cur !== value) didChange = YES;
|
2254
|
+
|
2255
|
+
// FIXME: We should check more than duration
|
2256
|
+
// Also, will we allow people to just set a number instead of a hash? If so, we have to account for that.
|
2257
|
+
if (curAnim && curAnim.duration !== options.duration) didChange = YES ;
|
2258
|
+
|
2259
|
+
layout[key] = value ;
|
2260
|
+
|
2261
|
+
// I'm pretty sure we want to be cloning this because we may be applying it
|
2262
|
+
// to multiple properties which can be edited independently
|
2263
|
+
layout['animate'+key.capitalize()] = SC.clone(options);
|
2264
|
+
}
|
2265
|
+
} else {
|
2266
|
+
if (cur !== value) didChange = YES;
|
2267
|
+
layout[key] = value;
|
2268
|
+
}
|
2269
|
+
}
|
2270
|
+
|
1603
2271
|
// now set adjusted layout
|
1604
2272
|
if (didChange) this.set('layout', layout) ;
|
1605
2273
|
|
1606
2274
|
return this ;
|
1607
2275
|
},
|
1608
|
-
|
2276
|
+
|
2277
|
+
/**
|
2278
|
+
Resets animation, stopping all existing animations.
|
2279
|
+
*/
|
2280
|
+
resetAnimation: function() {
|
2281
|
+
var layout = this.get('layout'), didChange = NO, key;
|
2282
|
+
for (key in layout) {
|
2283
|
+
if (key.substring(0,7) === 'animate') {
|
2284
|
+
didChange = YES;
|
2285
|
+
delete layout[key];
|
2286
|
+
}
|
2287
|
+
}
|
2288
|
+
if (didChange) {
|
2289
|
+
this.set('layout', layout);
|
2290
|
+
this.notifyPropertyChange('layout');
|
2291
|
+
}
|
2292
|
+
return this;
|
2293
|
+
},
|
2294
|
+
|
2295
|
+
_scv_willRenderAnimations: function(){
|
2296
|
+
if (SC.platform.supportsCSSTransitions) {
|
2297
|
+
var layer = this.get('layer'),
|
2298
|
+
currentStyle = layer ? layer.style : null,
|
2299
|
+
newStyle = this.get('layoutStyle'),
|
2300
|
+
transitionStyle = newStyle[SC.platform.domCSSPrefix+"Transition"],
|
2301
|
+
layout = this.get('layout'),
|
2302
|
+
key;
|
2303
|
+
|
2304
|
+
// Handle existing animations
|
2305
|
+
if (this._activeAnimations) {
|
2306
|
+
for(key in this._activeAnimations){
|
2307
|
+
// TODO: Check for more than duration
|
2308
|
+
if (
|
2309
|
+
newStyle[key] !== currentStyle[key] ||
|
2310
|
+
!this._pendingAnimations || !this._pendingAnimations[key] ||
|
2311
|
+
this._activeAnimations[key].duration !== this._pendingAnimations[key].duration
|
2312
|
+
) {
|
2313
|
+
var callback = this._activeAnimations[key].callback;
|
2314
|
+
if (callback) {
|
2315
|
+
if (this._animatedTransforms && this._animatedTransforms.length > 0) {
|
2316
|
+
for (idx=0; idx < this._animatedTransforms.length; idx++) {
|
2317
|
+
this._scv_runAnimationCallback(callback, null, this._animatedTransforms[idx], YES);
|
2318
|
+
}
|
2319
|
+
this._animatedTransforms = null;
|
2320
|
+
} else {
|
2321
|
+
this._scv_runAnimationCallback(callback, null, key, YES);
|
2322
|
+
}
|
2323
|
+
}
|
2324
|
+
|
2325
|
+
this._scv_removeAnimationFromLayout(key, YES);
|
2326
|
+
}
|
2327
|
+
}
|
2328
|
+
}
|
2329
|
+
|
2330
|
+
this._activeAnimations = this._pendingAnimations;
|
2331
|
+
this._pendingAnimations = null;
|
2332
|
+
} else {
|
2333
|
+
// Transitions not supported
|
2334
|
+
var key;
|
2335
|
+
for (key in this._pendingAnimations) {
|
2336
|
+
var callback = this._pendingAnimations[key].callback;
|
2337
|
+
if (callback) this._scv_runAnimationCallback(callback, null, key, NO);
|
2338
|
+
this._scv_removeAnimationFromLayout(key, NO, YES);
|
2339
|
+
}
|
2340
|
+
this._activeAnimations = this._pendingAnimations = null;
|
2341
|
+
}
|
2342
|
+
},
|
2343
|
+
|
2344
|
+
_scv_removeAnimationFromLayout: function(propertyName, updateStyle, isPending) {
|
2345
|
+
|
2346
|
+
if (updateStyle) {
|
2347
|
+
var layer = this.get('layer'),
|
2348
|
+
updatedCSS = [], key;
|
2349
|
+
for(key in this._activeAnimations) {
|
2350
|
+
if (key !== propertyName) updatedCSS.push(this._activeAnimations[key].css);
|
2351
|
+
}
|
2352
|
+
|
2353
|
+
// FIXME: Not really sure this is the right way to do it, but we don't want to trigger a layout update
|
2354
|
+
layer.style[SC.platform.domCSSPrefix+"Transition"] = updatedCSS.join(', ');
|
2355
|
+
}
|
2356
|
+
|
2357
|
+
|
2358
|
+
var layout = this.get('layout');
|
2359
|
+
|
2360
|
+
if (propertyName === '-'+SC.platform.cssPrefix+'-transform' && this._animatedTransforms && this._animatedTransforms.length > 0) {
|
2361
|
+
for(idx=0; idx < this._animatedTransforms.length; idx++) {
|
2362
|
+
delete layout['animate'+this._animatedTransforms[idx].capitalize()];
|
2363
|
+
}
|
2364
|
+
this._animatedTransforms = null;
|
2365
|
+
}
|
2366
|
+
delete layout['animate'+propertyName.capitalize()];
|
2367
|
+
|
2368
|
+
if (!isPending) delete this._activeAnimations[propertyName];
|
2369
|
+
},
|
2370
|
+
|
2371
|
+
_scv_runAnimationCallback: function(callback, evt, propertyName, cancelled) {
|
2372
|
+
if (callback) {
|
2373
|
+
if (SC.typeOf(callback) !== SC.T_HASH) callback = { action: callback };
|
2374
|
+
callback.source = this;
|
2375
|
+
if (!callback.target) callback.target = this;
|
2376
|
+
}
|
2377
|
+
SC.View.runCallback(callback, { event: evt, propertyName: propertyName, view: this, isCancelled: cancelled });
|
2378
|
+
},
|
2379
|
+
|
2380
|
+
/**
|
2381
|
+
Called when animation ends, should not usually be called manually
|
2382
|
+
*/
|
2383
|
+
_scv_animationEnd: function(evt){
|
2384
|
+
// WARNING: Sometimes this will get called more than once for a property. Not sure why.
|
2385
|
+
|
2386
|
+
var propertyName = evt.originalEvent.propertyName,
|
2387
|
+
layout = this.get('layout'),
|
2388
|
+
animation;
|
2389
|
+
|
2390
|
+
animation = this._activeAnimations ? this._activeAnimations[propertyName] : null;
|
2391
|
+
|
2392
|
+
if(animation) {
|
2393
|
+
if (animation.callback) {
|
2394
|
+
// Charles says this is a good idea
|
2395
|
+
SC.RunLoop.begin();
|
2396
|
+
// We're using invokeLater so we don't trigger any layout changes from the callbacks until the animations are done
|
2397
|
+
if (this._animatedTransforms && this._animatedTransforms.length > 0) {
|
2398
|
+
for (idx=0; idx < this._animatedTransforms.length; idx++) {
|
2399
|
+
this.invokeLater('_scv_runAnimationCallback', 1, animation.callback, evt, this._animatedTransforms[idx], NO);
|
2400
|
+
}
|
2401
|
+
} else {
|
2402
|
+
this.invokeLater('_scv_runAnimationCallback', 1, animation.callback, evt, propertyName, NO);
|
2403
|
+
}
|
2404
|
+
SC.RunLoop.end();
|
2405
|
+
}
|
2406
|
+
|
2407
|
+
this._scv_removeAnimationFromLayout(propertyName, YES);
|
2408
|
+
}
|
2409
|
+
},
|
2410
|
+
|
2411
|
+
|
1609
2412
|
/**
|
1610
2413
|
The layout describes how you want your view to be positions on the
|
1611
2414
|
screen. You can define the following properties:
|
@@ -1660,10 +2463,6 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1660
2463
|
convertFrameToView: function(frame, targetView) {
|
1661
2464
|
var myX=0, myY=0, targetX=0, targetY=0, view = this, f ;
|
1662
2465
|
|
1663
|
-
if (this.get('useStaticLayout')) {
|
1664
|
-
throw "convertFrameToView is not available with static layout";
|
1665
|
-
}
|
1666
|
-
|
1667
2466
|
// walk up this side
|
1668
2467
|
while (view) {
|
1669
2468
|
f = view.get('frame'); myX += f.x; myY += f.y ;
|
@@ -1704,15 +2503,12 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1704
2503
|
@test in converFrames
|
1705
2504
|
*/
|
1706
2505
|
convertFrameFromView: function(frame, targetView) {
|
1707
|
-
var myX=0, myY=0, targetX=0, targetY=0, view = this,
|
1708
|
-
|
1709
|
-
if (this.get('useStaticLayout')) {
|
1710
|
-
throw "convertFrameToView is not available with static layout";
|
1711
|
-
}
|
2506
|
+
var myX=0, myY=0, targetX=0, targetY=0, view = this, f ;
|
1712
2507
|
|
1713
2508
|
// walk up this side
|
1714
|
-
|
1715
|
-
|
2509
|
+
//Note: Intentional assignment of variable f
|
2510
|
+
while (view && (f = view.get('frame'))) {
|
2511
|
+
myX += f.x; myY += f.y ;
|
1716
2512
|
view = view.get('parentView') ;
|
1717
2513
|
}
|
1718
2514
|
|
@@ -1760,7 +2556,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1760
2556
|
*/
|
1761
2557
|
frame: function() {
|
1762
2558
|
return this.computeFrameWithParentFrame(null) ;
|
1763
|
-
}.property('
|
2559
|
+
}.property('useStaticLayout').cacheable(), // We depend on the layout, but layoutDidChange will call viewDidChange to check the frame for us
|
1764
2560
|
|
1765
2561
|
/**
|
1766
2562
|
Computes what the frame of this view would be if the parent were resized
|
@@ -1780,108 +2576,158 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1780
2576
|
computeFrameWithParentFrame: function(pdim) {
|
1781
2577
|
var layout = this.get('layout'),
|
1782
2578
|
f = {} , error, layer, AUTO = SC.LAYOUT_AUTO,
|
1783
|
-
stLayout = this.get('useStaticLayout')
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
2579
|
+
stLayout = this.get('useStaticLayout'),
|
2580
|
+
pv = this.get('parentView'),
|
2581
|
+
dH, dW, //shortHand for parentDimensions
|
2582
|
+
borderTop, borderLeft,
|
2583
|
+
lR = layout.right,
|
2584
|
+
lL = layout.left,
|
2585
|
+
lT = layout.top,
|
2586
|
+
lB = layout.bottom,
|
2587
|
+
lW = layout.width,
|
2588
|
+
lH = layout.height,
|
2589
|
+
lcX = layout.centerX,
|
2590
|
+
lcY = layout.centerY;
|
2591
|
+
|
2592
|
+
if (lW !== undefined &&
|
2593
|
+
lW === SC.LAYOUT_AUTO &&
|
1787
2594
|
stLayout !== undefined && !stLayout) {
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
2595
|
+
error = SC.Error.desc(("%@.layout() cannot use width:auto if "+
|
2596
|
+
"staticLayout is disabled").fmt(this), "%@".fmt(this), -1);
|
2597
|
+
console.error(error.toString()) ;
|
2598
|
+
throw error ;
|
1791
2599
|
}
|
1792
2600
|
|
1793
|
-
if (
|
1794
|
-
|
2601
|
+
if (lH !== undefined &&
|
2602
|
+
lH === SC.LAYOUT_AUTO &&
|
1795
2603
|
stLayout !== undefined && !stLayout) {
|
1796
|
-
|
1797
|
-
|
2604
|
+
error = SC.Error.desc(("%@.layout() cannot use height:auto if "+
|
2605
|
+
"staticLayout is disabled").fmt(this),"%@".fmt(this), -1);
|
2606
|
+
console.error(error.toString()) ;
|
1798
2607
|
throw error ;
|
1799
2608
|
}
|
1800
2609
|
|
1801
|
-
if (stLayout)
|
2610
|
+
if (stLayout) {
|
2611
|
+
// need layer to be able to compute rect
|
2612
|
+
if (layer = this.get('layer')) {
|
2613
|
+
f = SC.viewportOffset(layer); // x,y
|
2614
|
+
if (pv) f = pv.convertFrameFromView(f, null);
|
2615
|
+
|
2616
|
+
/*
|
2617
|
+
TODO Can probably have some better width/height values - CC
|
2618
|
+
*/
|
2619
|
+
f.width = layer.offsetWidth;
|
2620
|
+
f.height = layer.offsetHeight;
|
2621
|
+
return f;
|
2622
|
+
}
|
2623
|
+
return null; // can't compute
|
2624
|
+
}
|
2625
|
+
|
2626
|
+
|
2627
|
+
if (!pdim) pdim = this.computeParentDimensions(layout) ;
|
2628
|
+
dH = pdim.height;
|
2629
|
+
dW = pdim.width;
|
1802
2630
|
|
1803
2631
|
// handle left aligned and left/right
|
1804
|
-
if (!SC.none(
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
}
|
1810
|
-
|
1811
|
-
|
2632
|
+
if (!SC.none(lL)) {
|
2633
|
+
if(SC.isPercentage(lL)){
|
2634
|
+
f.x = dW*lL;
|
2635
|
+
}else{
|
2636
|
+
f.x = lL ;
|
2637
|
+
}
|
2638
|
+
if (lW !== undefined) {
|
2639
|
+
if(lW === AUTO) f.width = AUTO ;
|
2640
|
+
else if(SC.isPercentage(lW)) f.width = dW*lW ;
|
2641
|
+
else f.width = lW ;
|
2642
|
+
} else { // better have lR!
|
2643
|
+
f.width = dW - f.x ;
|
2644
|
+
if(lR && SC.isPercentage(lR)) f.width = f.width - (lR*dW) ;
|
2645
|
+
else f.width = f.width - (lR || 0) ;
|
1812
2646
|
}
|
1813
|
-
|
1814
2647
|
// handle right aligned
|
1815
|
-
} else if (!SC.none(
|
1816
|
-
if (
|
1817
|
-
|
1818
|
-
f.width =
|
2648
|
+
} else if (!SC.none(lR)) {
|
2649
|
+
if (SC.none(lW)) {
|
2650
|
+
if (SC.isPercentage(lL)) f.width = dW - (dW*lR) ;
|
2651
|
+
else f.width = dW - lR ;
|
1819
2652
|
f.x = 0 ;
|
1820
2653
|
} else {
|
1821
|
-
if(
|
1822
|
-
else f.width =
|
1823
|
-
f.
|
2654
|
+
if(lW === AUTO) f.width = AUTO ;
|
2655
|
+
else if(SC.isPercentage(lW)) f.width = dW*lW ;
|
2656
|
+
else f.width = (lW || 0) ;
|
2657
|
+
if (SC.isPercentage(lW)) f.x = dW - (lR*dW) - f.width ;
|
2658
|
+
else f.x = dW - lR - f.width ;
|
1824
2659
|
}
|
1825
2660
|
|
1826
2661
|
// handle centered
|
1827
|
-
} else if (!SC.none(
|
1828
|
-
if
|
1829
|
-
if(
|
1830
|
-
else f.width =
|
1831
|
-
f.x =
|
2662
|
+
} else if (!SC.none(lcX)) {
|
2663
|
+
if(lW === AUTO) f.width = AUTO ;
|
2664
|
+
else if (SC.isPercentage(lW)) f.width = lW*dW ;
|
2665
|
+
else f.width = (lW || 0) ;
|
2666
|
+
if(SC.isPercentage(lcX)) f.x = (dW - f.width)/2 + (lcX*dW) ;
|
2667
|
+
else f.x = (dW - f.width)/2 + lcX ;
|
1832
2668
|
} else {
|
1833
2669
|
f.x = 0 ; // fallback
|
1834
|
-
if (SC.none(
|
1835
|
-
|
1836
|
-
f.width = Math.floor(pdim.width) ;
|
2670
|
+
if (SC.none(lW)) {
|
2671
|
+
f.width = dW ;
|
1837
2672
|
} else {
|
1838
|
-
if(
|
1839
|
-
|
2673
|
+
if(lW === AUTO) f.width = AUTO ;
|
2674
|
+
if (SC.isPercentage(lW)) f.width = lW*dW ;
|
2675
|
+
else f.width = (lW || 0) ;
|
1840
2676
|
}
|
1841
2677
|
}
|
1842
2678
|
|
1843
2679
|
// handle top aligned and top/bottom
|
1844
|
-
if (!SC.none(
|
1845
|
-
f.y =
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
2680
|
+
if (!SC.none(lT)) {
|
2681
|
+
if(SC.isPercentage(lT)) f.y = lT*dH ;
|
2682
|
+
else f.y = lT ;
|
2683
|
+
if (lH !== undefined) {
|
2684
|
+
if(lH === AUTO) f.height = AUTO ;
|
2685
|
+
else if(SC.isPercentage(lH)) f.height = lH*dH ;
|
2686
|
+
else f.height = lH ;
|
2687
|
+
} else { // better have lB!
|
2688
|
+
if(lB && SC.isPercentage(lB)) f.height = dH - f.y - (lB*dH) ;
|
2689
|
+
else f.height = dH - f.y - (lB || 0) ;
|
1852
2690
|
}
|
1853
2691
|
|
1854
2692
|
// handle bottom aligned
|
1855
|
-
} else if (!SC.none(
|
1856
|
-
if (
|
1857
|
-
|
1858
|
-
f.height =
|
2693
|
+
} else if (!SC.none(lB)) {
|
2694
|
+
if (SC.none(lH)) {
|
2695
|
+
if (SC.isPercentage(lB)) f.height = dH - (lB*dH) ;
|
2696
|
+
else f.height = dH - lB ;
|
1859
2697
|
f.y = 0 ;
|
1860
2698
|
} else {
|
1861
|
-
if(
|
1862
|
-
|
1863
|
-
f.
|
2699
|
+
if(lH === AUTO) f.height = AUTO ;
|
2700
|
+
if (lH && SC.isPercentage(lH)) f.height = lH*dH ;
|
2701
|
+
else f.height = (lH || 0) ;
|
2702
|
+
if (SC.isPercentage(lB)) f.y = dH - (lB*dH) - f.height ;
|
2703
|
+
else f.y = dH - lB - f.height ;
|
1864
2704
|
}
|
1865
2705
|
|
1866
2706
|
// handle centered
|
1867
|
-
} else if (!SC.none(
|
1868
|
-
if
|
1869
|
-
if(
|
1870
|
-
else f.height =
|
1871
|
-
f.y =
|
2707
|
+
} else if (!SC.none(lcY)) {
|
2708
|
+
if(lH === AUTO) f.height = AUTO ;
|
2709
|
+
if (lH && SC.isPercentage(lH)) f.height = lH*dH ;
|
2710
|
+
else f.height = (lH || 0) ;
|
2711
|
+
if (SC.isPercentage(lcY)) f.y = (dH - f.height)/2 + (lcY*dH) ;
|
2712
|
+
else f.y = (dH - f.height)/2 + lcY ;
|
1872
2713
|
|
1873
2714
|
// fallback
|
1874
2715
|
} else {
|
1875
2716
|
f.y = 0 ; // fallback
|
1876
|
-
if (SC.none(
|
1877
|
-
|
1878
|
-
f.height = Math.floor(pdim.height) ;
|
2717
|
+
if (SC.none(lH)) {
|
2718
|
+
f.height = dH ;
|
1879
2719
|
} else {
|
1880
|
-
if(
|
1881
|
-
|
2720
|
+
if(lH === AUTO) f.height = AUTO ;
|
2721
|
+
if (SC.isPercentage(lH)) f.height = lH*dH ;
|
2722
|
+
else f.height = lH || 0 ;
|
1882
2723
|
}
|
1883
2724
|
}
|
1884
2725
|
|
2726
|
+
f.x = Math.floor(f.x);
|
2727
|
+
f.y = Math.floor(f.y);
|
2728
|
+
if(f.height !== AUTO) f.height = Math.floor(f.height);
|
2729
|
+
if(f.width !== AUTO) f.width = Math.floor(f.width);
|
2730
|
+
|
1885
2731
|
// if width or height were set to auto and we have a layer, try lookup
|
1886
2732
|
if (f.height === AUTO || f.width === AUTO) {
|
1887
2733
|
layer = this.get('layer');
|
@@ -1889,6 +2735,24 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1889
2735
|
if (f.width === AUTO) f.width = layer ? layer.clientWidth : 0;
|
1890
2736
|
}
|
1891
2737
|
|
2738
|
+
// views with SC.Border mixin applied applied
|
2739
|
+
if (this.get('hasBorder')) {
|
2740
|
+
borderTop = this.get('borderTop');
|
2741
|
+
borderLeft = this.get('borderLeft');
|
2742
|
+
f.height -= borderTop+this.get('borderBottom');
|
2743
|
+
f.y += borderTop;
|
2744
|
+
f.width -= borderLeft+this.get('borderRight');
|
2745
|
+
f.x += borderLeft;
|
2746
|
+
}
|
2747
|
+
|
2748
|
+
// Account for special cases inside ScrollView, where we adjust the
|
2749
|
+
// element's scrollTop/scrollLeft property for performance reasons.
|
2750
|
+
if (pv && pv.isScrollContainer) {
|
2751
|
+
pv = pv.get('parentView');
|
2752
|
+
f.x -= pv.get('horizontalScrollOffset');
|
2753
|
+
f.y -= pv.get('verticalScrollOffset');
|
2754
|
+
}
|
2755
|
+
|
1892
2756
|
// make sure the width/height fix min/max...
|
1893
2757
|
if (!SC.none(layout.maxHeight) && (f.height > layout.maxHeight)) {
|
1894
2758
|
f.height = layout.maxHeight ;
|
@@ -1930,36 +2794,72 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1930
2794
|
|
1931
2795
|
/**
|
1932
2796
|
The clipping frame returns the visible portion of the view, taking into
|
1933
|
-
account the
|
1934
|
-
clippingFrame is in the context of the view itself, not it's parent
|
1935
|
-
|
1936
|
-
Normally this will be calculate based on the intersection of your own
|
1937
|
-
clippingFrame and your parentView's clippingFrame.
|
2797
|
+
account the contentClippingFrame of the parent view. Keep in mind that
|
2798
|
+
the clippingFrame is in the context of the view itself, not it's parent
|
2799
|
+
view.
|
1938
2800
|
|
2801
|
+
Normally this will be calculated based on the intersection of your own
|
2802
|
+
clippingFrame and your parentView's contentClippingFrame.
|
2803
|
+
|
1939
2804
|
@property {Rect}
|
1940
2805
|
*/
|
1941
2806
|
clippingFrame: function() {
|
1942
|
-
var
|
2807
|
+
var f = this.get('frame'),
|
2808
|
+
ret = f,
|
2809
|
+
pv, cf;
|
2810
|
+
|
2811
|
+
if (!f) return null;
|
2812
|
+
pv = this.get('parentView');
|
1943
2813
|
if (pv) {
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
ret.
|
1949
|
-
|
2814
|
+
cf = pv.get('contentClippingFrame');
|
2815
|
+
if (!cf) return f;
|
2816
|
+
ret = SC.intersectRects(cf, f);
|
2817
|
+
}
|
2818
|
+
ret.x -= f.x;
|
2819
|
+
ret.y -= f.y;
|
2820
|
+
|
2821
|
+
return ret;
|
1950
2822
|
}.property('parentView', 'frame').cacheable(),
|
1951
2823
|
|
2824
|
+
/**
|
2825
|
+
The clipping frame child views should intersect with. Normally this is
|
2826
|
+
the same as the regular clippingFrame. However, you may override this
|
2827
|
+
method if you want the child views to actually draw more or less content
|
2828
|
+
than is actually visible for some reason.
|
2829
|
+
|
2830
|
+
Usually this is only used by the ScrollView to optimize drawing on touch
|
2831
|
+
devices.
|
2832
|
+
|
2833
|
+
@property {Rect}
|
2834
|
+
*/
|
2835
|
+
contentClippingFrame: function() {
|
2836
|
+
return this.get("clippingFrame");
|
2837
|
+
}.property('clippingFrame').cacheable(),
|
2838
|
+
|
1952
2839
|
/** @private
|
1953
|
-
|
1954
|
-
child
|
2840
|
+
This method is invoked whenever the clippingFrame changes, notifying
|
2841
|
+
each child view that its clippingFrame has also changed.
|
1955
2842
|
*/
|
1956
2843
|
_sc_view_clippingFrameDidChange: function() {
|
1957
2844
|
var cvs = this.get('childViews'), len = cvs.length, idx, cv ;
|
1958
2845
|
for (idx=0; idx<len; ++idx) {
|
1959
2846
|
cv = cvs[idx] ;
|
1960
|
-
|
2847
|
+
|
2848
|
+
// In SC 1.0 views with static layout did not receive notifications
|
2849
|
+
// of frame changes because they didn't support frames. In SC 1.1 they
|
2850
|
+
// do support frames, so they should receive notifications. Also in
|
2851
|
+
// SC 1.1 SC.StaticLayout is merged into SC.View. The mixin is only
|
2852
|
+
// for compatibility. This property is defined on the mixin.
|
2853
|
+
//
|
2854
|
+
// frame changes should be sent all the time unless this property is
|
2855
|
+
// present to indicate that we want the old 1.0 API behavior instead.
|
2856
|
+
//
|
2857
|
+
if (!cv.useStaticLayout) {
|
2858
|
+
cv.notifyPropertyChange('clippingFrame') ;
|
2859
|
+
cv._sc_view_clippingFrameDidChange();
|
2860
|
+
}
|
1961
2861
|
}
|
1962
|
-
}
|
2862
|
+
},
|
1963
2863
|
|
1964
2864
|
/**
|
1965
2865
|
This method may be called on your view whenever the parent view resizes.
|
@@ -1972,40 +2872,68 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
1972
2872
|
@test in viewDidResize
|
1973
2873
|
*/
|
1974
2874
|
parentViewDidResize: function() {
|
1975
|
-
var layout = this.get('layout') ;
|
2875
|
+
var layout = this.get('layout'), isPercentageFunc, isPercentage, isFixed;
|
1976
2876
|
|
1977
2877
|
// only resizes if the layout does something other than left/top - fixed
|
1978
2878
|
// size.
|
1979
|
-
|
2879
|
+
isFixed = (
|
1980
2880
|
(layout.left !== undefined) && (layout.top !== undefined) &&
|
1981
2881
|
(layout.width !== undefined) && (layout.height !== undefined)
|
1982
2882
|
);
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
2883
|
+
|
2884
|
+
isPercentageFunc = SC.isPercentage;
|
2885
|
+
isPercentage = (isPercentageFunc(layout.left) ||
|
2886
|
+
isPercentageFunc(layout.top) ||
|
2887
|
+
isPercentageFunc(layout.width) ||
|
2888
|
+
isPercentageFunc(layout.right) ||
|
2889
|
+
isPercentageFunc(layout.centerX) ||
|
2890
|
+
isPercentageFunc(layout.centerY));
|
2891
|
+
|
2892
|
+
// Do we think there's a chance our frame will have changed as a result?
|
2893
|
+
if (!isFixed || isPercentage) {
|
2894
|
+
// There's a chance our frame changed. Invoke viewDidResize(), which
|
2895
|
+
// will notify about our change to 'frame' (if it actually changed) and
|
2896
|
+
// appropriately notify our child views.
|
2897
|
+
this.viewDidResize();
|
1987
2898
|
}
|
1988
2899
|
},
|
1989
|
-
|
2900
|
+
|
2901
|
+
|
2902
|
+
|
1990
2903
|
/**
|
1991
2904
|
This method is invoked on your view when the view resizes due to a layout
|
1992
|
-
change or due to the parent view resizing
|
2905
|
+
change or potentially due to the parent view resizing (if your view’s size
|
2906
|
+
depends on the size of your parent view). You can override this method
|
1993
2907
|
to implement your own layout if you like, such as performing a grid
|
1994
2908
|
layout.
|
1995
2909
|
|
1996
|
-
The default implementation simply
|
1997
|
-
your children.
|
2910
|
+
The default implementation simply notifies about the change to 'frame' and
|
2911
|
+
then calls parentViewDidResize on all of your children.
|
1998
2912
|
|
1999
2913
|
@returns {void}
|
2000
2914
|
*/
|
2001
2915
|
viewDidResize: function() {
|
2916
|
+
this._viewFrameDidChange();
|
2917
|
+
|
2918
|
+
// Also notify our children.
|
2002
2919
|
var cv = this.childViews, len = cv.length, idx, view ;
|
2003
2920
|
for (idx=0; idx<len; ++idx) {
|
2004
|
-
view = cv[idx]
|
2005
|
-
|
2921
|
+
view = cv[idx];
|
2922
|
+
view.parentViewDidResize();
|
2006
2923
|
}
|
2007
|
-
}
|
2008
|
-
|
2924
|
+
},
|
2925
|
+
|
2926
|
+
/** @private
|
2927
|
+
Invoked by other views to notify this view that its frame has changed.
|
2928
|
+
|
2929
|
+
This notifies the view that its frame property has changed,
|
2930
|
+
then propagates those changes to its child views.
|
2931
|
+
*/
|
2932
|
+
_viewFrameDidChange: function() {
|
2933
|
+
this.notifyPropertyChange('frame');
|
2934
|
+
this._sc_view_clippingFrameDidChange();
|
2935
|
+
},
|
2936
|
+
|
2009
2937
|
// Implementation note: As a general rule, paired method calls, such as
|
2010
2938
|
// beginLiveResize/endLiveResize that are called recursively on the tree
|
2011
2939
|
// should reverse the order when doing the final half of the call. This
|
@@ -2066,7 +2994,21 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2066
2994
|
if (this.didEndLiveResize) this.didEndLiveResize() ;
|
2067
2995
|
return this ;
|
2068
2996
|
},
|
2069
|
-
|
2997
|
+
|
2998
|
+
/**
|
2999
|
+
Setting wantsAcceleratedLayer to YES will use transforms to move the
|
3000
|
+
layer when available. On some platforms transforms are hardware accelerated.
|
3001
|
+
*/
|
3002
|
+
wantsAcceleratedLayer: NO,
|
3003
|
+
|
3004
|
+
/**
|
3005
|
+
Specifies whether transforms can be used to move the layer.
|
3006
|
+
*/
|
3007
|
+
hasAcceleratedLayer: function(){
|
3008
|
+
return this.get('wantsAcceleratedLayer') && SC.platform.supportsCSSTransforms;
|
3009
|
+
}.property('wantsAcceleratedLayer').cacheable(),
|
3010
|
+
|
3011
|
+
|
2070
3012
|
/**
|
2071
3013
|
layoutStyle describes the current styles to be written to your element
|
2072
3014
|
based on the layout you defined. Both layoutStyle and frame reset when
|
@@ -2077,69 +3019,143 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2077
3019
|
@property {Hash}
|
2078
3020
|
@readOnly
|
2079
3021
|
*/
|
3022
|
+
|
3023
|
+
|
2080
3024
|
layoutStyle: function() {
|
2081
3025
|
var layout = this.get('layout'), ret = {}, pdim = null, error,
|
2082
3026
|
AUTO = SC.LAYOUT_AUTO,
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
3027
|
+
dims = SC._VIEW_DEFAULT_DIMS, loc = dims.length, x, value, key,
|
3028
|
+
stLayout = this.get('useStaticLayout'),
|
3029
|
+
lR = layout.right,
|
3030
|
+
lL = layout.left,
|
3031
|
+
lT = layout.top,
|
3032
|
+
lB = layout.bottom,
|
3033
|
+
lW = layout.width,
|
3034
|
+
lH = layout.height,
|
3035
|
+
lMW = layout.maxWidth,
|
3036
|
+
lMH = layout.maxHeight,
|
3037
|
+
lcX = layout.centerX,
|
3038
|
+
lcY = layout.centerY,
|
3039
|
+
canUseAcceleratedLayer = this.get('hasAcceleratedLayer'),
|
3040
|
+
translateTop = null,
|
3041
|
+
translateLeft = null;
|
3042
|
+
if (lW !== undefined && lW === SC.LAYOUT_AUTO && !stLayout) {
|
3043
|
+
error= SC.Error.desc("%@.layout() you cannot use width:auto if ".fmt(this) +
|
3044
|
+
"staticLayout is disabled","%@".fmt(this),-1);
|
3045
|
+
console.error(error.toString()) ;
|
3046
|
+
throw error ;
|
2091
3047
|
}
|
2092
3048
|
|
2093
|
-
if (
|
2094
|
-
|
2095
|
-
|
2096
|
-
error = SC.Error.desc("%@.layout() you cannot use height:auto if staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
|
3049
|
+
if (lH !== undefined && lH === SC.LAYOUT_AUTO && !stLayout) {
|
3050
|
+
error = SC.Error.desc("%@.layout() you cannot use height:auto if ".fmt(this) +
|
3051
|
+
"staticLayout is disabled","%@".fmt(this),-1);
|
2097
3052
|
console.error(error.toString()) ;
|
2098
3053
|
throw error ;
|
2099
3054
|
}
|
2100
|
-
|
3055
|
+
|
3056
|
+
if (SC.platform.supportsCSSTransforms) {
|
3057
|
+
// Check to see if we're using transforms
|
3058
|
+
var animatingTransforms = NO, transformAnimationDuration;
|
3059
|
+
for(key in layout){
|
3060
|
+
if (key.substring(0,7) === 'animate') {
|
3061
|
+
if (SC.CSS_TRANSFORM_MAP[key.substring(7).camelize()]) {
|
3062
|
+
animatingTransforms = YES;
|
3063
|
+
|
3064
|
+
if (this._pendingAnimations && this._pendingAnimations['-'+SC.platform.cssPrefix+'-transform']) {
|
3065
|
+
throw "Animations of transforms must be executed simultaneously!";
|
3066
|
+
}
|
3067
|
+
|
3068
|
+
// TODO: If we want to allow it to be set as just a number for duration we need to add support here
|
3069
|
+
if (transformAnimationDuration && layout[key].duration !== transformAnimationDuration) {
|
3070
|
+
console.warn("Can't animate transforms with different durations! Using first duration specified.");
|
3071
|
+
layout[key].duration = transformAnimationDuration;
|
3072
|
+
}
|
3073
|
+
transformAnimationDuration = layout[key].duration;
|
3074
|
+
|
3075
|
+
// FIXME: There will also be problems if we have conflicting timings and callbacks
|
3076
|
+
}
|
3077
|
+
}
|
3078
|
+
}
|
3079
|
+
|
3080
|
+
// If we're animating other transforms at different speeds, don't use acceleratedLayer
|
3081
|
+
if (
|
3082
|
+
animatingTransforms &&
|
3083
|
+
(
|
3084
|
+
(layout['animateTop'] && layout['animateTop'].duration !== transformAnimationDuration) ||
|
3085
|
+
(layout['animateLeft'] && layout['animateLeft'].duration !== transformAnimationDuration)
|
3086
|
+
)
|
3087
|
+
) {
|
3088
|
+
canUseAcceleratedLayer = NO;
|
3089
|
+
}
|
3090
|
+
}
|
3091
|
+
|
2101
3092
|
// X DIRECTION
|
2102
|
-
|
3093
|
+
|
2103
3094
|
// handle left aligned and left/right
|
2104
|
-
if (!SC.none(
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
2108
|
-
|
3095
|
+
if (!SC.none(lL)) {
|
3096
|
+
if(SC.isPercentage(lL)) {
|
3097
|
+
ret.left = (lL*100)+"%"; //percentage left
|
3098
|
+
} else if (canUseAcceleratedLayer && !SC.empty(lW)) {
|
3099
|
+
translateLeft = Math.floor(lL);
|
3100
|
+
ret.left = 0;
|
3101
|
+
} else {
|
3102
|
+
ret.left = Math.floor(lL); //px left
|
3103
|
+
}
|
3104
|
+
ret.marginLeft = 0 ;
|
3105
|
+
|
3106
|
+
if (lW !== undefined) {
|
3107
|
+
if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
|
3108
|
+
else if(SC.isPercentage(lW)) ret.width = (lW*100)+"%"; //percentage width
|
3109
|
+
else ret.width = Math.floor(lW) ; //px width
|
2109
3110
|
ret.right = null ;
|
2110
3111
|
} else {
|
2111
3112
|
ret.width = null ;
|
2112
|
-
|
3113
|
+
if(lR && SC.isPercentage(lR)) ret.right = (lR*100)+"%"; //percentage right
|
3114
|
+
else ret.right = Math.floor(lR || 0) ; //px right
|
2113
3115
|
}
|
2114
|
-
ret.marginLeft = 0 ;
|
2115
3116
|
|
2116
3117
|
// handle right aligned
|
2117
|
-
} else if (!SC.none(
|
2118
|
-
|
3118
|
+
} else if (!SC.none(lR)) {
|
3119
|
+
if(SC.isPercentage(lR)) {
|
3120
|
+
ret.right = Math.floor(lR*100)+"%"; //percentage left
|
3121
|
+
}else{
|
3122
|
+
ret.right = Math.floor(lR) ;
|
3123
|
+
}
|
2119
3124
|
ret.marginLeft = 0 ;
|
2120
3125
|
|
2121
|
-
if (SC.none(
|
2122
|
-
ret.left = 0;
|
3126
|
+
if (SC.none(lW)) {
|
3127
|
+
if (SC.none(lMW)) ret.left = 0;
|
2123
3128
|
ret.width = null;
|
2124
3129
|
} else {
|
2125
3130
|
ret.left = null ;
|
2126
|
-
if(
|
2127
|
-
else
|
3131
|
+
if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
|
3132
|
+
else if(lW && SC.isPercentage(lW)) ret.width = (lW*100)+"%" ; //percentage width
|
3133
|
+
else ret.width = Math.floor(lW || 0) ; //px width
|
2128
3134
|
}
|
2129
3135
|
|
2130
3136
|
// handle centered
|
2131
|
-
} else if (!SC.none(
|
3137
|
+
} else if (!SC.none(lcX)) {
|
2132
3138
|
ret.left = "50%";
|
2133
|
-
|
2134
|
-
ret.
|
3139
|
+
if(lW && SC.isPercentage(lW)) ret.width = (lW*100)+"%" ; //percentage width
|
3140
|
+
else ret.width = Math.floor(lW || 0) ;
|
3141
|
+
if(lW && SC.isPercentage(lW) && (SC.isPercentage(lcX) || SC.isPercentage(lcX*-1))){
|
3142
|
+
ret.marginLeft = Math.floor((lcX - lW/2)*100)+"%" ;
|
3143
|
+
}else if(lW && lW >= 1 && !SC.isPercentage(lcX)){
|
3144
|
+
ret.marginLeft = Math.floor(lcX - ret.width/2) ;
|
3145
|
+
}else {
|
3146
|
+
// This error message happens whenever width is not set.
|
3147
|
+
console.warn("You have to set width and centerX using both percentages or pixels");
|
3148
|
+
ret.marginLeft = "50%";
|
3149
|
+
}
|
2135
3150
|
ret.right = null ;
|
2136
3151
|
|
2137
3152
|
// if width defined, assume top/left of zero
|
2138
|
-
} else if (!SC.none(
|
3153
|
+
} else if (!SC.none(lW)) {
|
2139
3154
|
ret.left = 0;
|
2140
3155
|
ret.right = null;
|
2141
|
-
if(
|
2142
|
-
else ret.width =
|
3156
|
+
if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
|
3157
|
+
else if(SC.isPercentage(lW)) ret.width = (lW*100)+"%";
|
3158
|
+
else ret.width = Math.floor(lW);
|
2143
3159
|
ret.marginLeft = 0;
|
2144
3160
|
|
2145
3161
|
// fallback, full width.
|
@@ -2157,44 +3173,65 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2157
3173
|
|
2158
3174
|
// Y DIRECTION
|
2159
3175
|
|
2160
|
-
// handle
|
2161
|
-
if (!SC.none(
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2165
|
-
|
3176
|
+
// handle top aligned and left/right
|
3177
|
+
if (!SC.none(lT)) {
|
3178
|
+
if(SC.isPercentage(lT)) {
|
3179
|
+
ret.top = (lT*100)+"%";
|
3180
|
+
} else if (canUseAcceleratedLayer && !SC.empty(lH)) {
|
3181
|
+
translateTop = Math.floor(lT);
|
3182
|
+
ret.top = 0;
|
3183
|
+
} else {
|
3184
|
+
ret.top = Math.floor(lT);
|
3185
|
+
}
|
3186
|
+
if (lH !== undefined) {
|
3187
|
+
if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
|
3188
|
+
else if(SC.isPercentage(lH)) ret.height = (lH*100)+"%" ;
|
3189
|
+
else ret.height = Math.floor(lH) ;
|
2166
3190
|
ret.bottom = null ;
|
2167
3191
|
} else {
|
2168
3192
|
ret.height = null ;
|
2169
|
-
|
3193
|
+
if(lB && SC.isPercentage(lB)) ret.bottom = (lB*100)+"%" ;
|
3194
|
+
else ret.bottom = Math.floor(lB || 0) ;
|
2170
3195
|
}
|
2171
3196
|
ret.marginTop = 0 ;
|
2172
3197
|
|
2173
|
-
// handle
|
2174
|
-
} else if (!SC.none(
|
3198
|
+
// handle bottom aligned
|
3199
|
+
} else if (!SC.none(lB)) {
|
2175
3200
|
ret.marginTop = 0 ;
|
2176
|
-
ret.bottom =
|
2177
|
-
|
2178
|
-
|
3201
|
+
if(SC.isPercentage(lB)) ret.bottom = (lB*100)+"%";
|
3202
|
+
else ret.bottom = Math.floor(lB) ;
|
3203
|
+
if (SC.none(lH)) {
|
3204
|
+
if (SC.none(lMH)) ret.top = 0;
|
2179
3205
|
ret.height = null ;
|
2180
3206
|
} else {
|
2181
3207
|
ret.top = null ;
|
2182
|
-
if(
|
2183
|
-
else
|
3208
|
+
if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
|
3209
|
+
else if(lH && SC.isPercentage(lH)) ret.height = (lH*100)+"%" ;
|
3210
|
+
else ret.height = Math.floor(lH || 0) ;
|
2184
3211
|
}
|
2185
3212
|
|
2186
3213
|
// handle centered
|
2187
|
-
} else if (!SC.none(
|
3214
|
+
} else if (!SC.none(lcY)) {
|
2188
3215
|
ret.top = "50%";
|
2189
|
-
ret.height = Math.floor(layout.height || 0) ;
|
2190
|
-
ret.marginTop = Math.floor(layout.centerY - ret.height/2) ;
|
2191
3216
|
ret.bottom = null ;
|
2192
|
-
|
2193
|
-
|
3217
|
+
|
3218
|
+
if(lH && SC.isPercentage(lH)) ret.height = (lH*100)+ "%" ;
|
3219
|
+
else ret.height = Math.floor(lH || 0) ;
|
3220
|
+
|
3221
|
+
if(lH && SC.isPercentage(lH) && (SC.isPercentage(lcY) || SC.isPercentage(lcY*-1))){ //height is percentage and lcy too
|
3222
|
+
ret.marginTop = Math.floor((lcY - lH/2)*100)+"%" ;
|
3223
|
+
}else if(lH && lH >= 1 && !SC.isPercentage(lcY)){
|
3224
|
+
ret.marginTop = Math.floor(lcY - ret.height/2) ;
|
3225
|
+
}else {
|
3226
|
+
console.warn("You have to set height and centerY to use both percentages or pixels");
|
3227
|
+
ret.marginTop = "50%";
|
3228
|
+
}
|
3229
|
+
} else if (!SC.none(lH)) {
|
2194
3230
|
ret.top = 0;
|
2195
3231
|
ret.bottom = null;
|
2196
|
-
if(
|
2197
|
-
else
|
3232
|
+
if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
|
3233
|
+
else if(lH && SC.isPercentage(lH)) ret.height = (lH*100)+"%" ;
|
3234
|
+
else ret.height = Math.floor(lH || 0) ;
|
2198
3235
|
ret.marginTop = 0;
|
2199
3236
|
|
2200
3237
|
// fallback, full width.
|
@@ -2215,7 +3252,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2215
3252
|
|
2216
3253
|
// if zIndex is set, use it. otherwise let default shine through
|
2217
3254
|
ret.zIndex = SC.none(layout.zIndex) ? null : layout.zIndex.toString();
|
2218
|
-
|
3255
|
+
|
3256
|
+
// if opacity is set, use it. otherwise let default shine through
|
3257
|
+
ret.opacity = SC.none(layout.opacity) ? null : layout.opacity.toString();
|
3258
|
+
|
2219
3259
|
// if backgroundPosition is set, use it.
|
2220
3260
|
// otherwise let default shine through
|
2221
3261
|
ret.backgroundPosition = SC.none(layout.backgroundPosition) ?
|
@@ -2224,17 +3264,119 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2224
3264
|
|
2225
3265
|
// set default values to null to allow built-in CSS to shine through
|
2226
3266
|
// currently applies only to marginLeft & marginTop
|
2227
|
-
var dims = SC._VIEW_DEFAULT_DIMS, loc = dims.length, x;
|
2228
3267
|
while(--loc >=0) {
|
2229
3268
|
x = dims[loc];
|
2230
3269
|
if (ret[x]===0) ret[x]=null;
|
2231
3270
|
}
|
2232
|
-
|
3271
|
+
|
3272
|
+
if (SC.platform.supportsCSSTransforms) {
|
3273
|
+
// Handle transforms
|
3274
|
+
var transformAttribute = SC.platform.domCSSPrefix+'Transform',
|
3275
|
+
layer = this.get('layer'),
|
3276
|
+
// FIXME: This is not the best way to do it, we should track these locally
|
3277
|
+
currentTransforms = (layer ? layer.style[transformAttribute] : '').split(' '),
|
3278
|
+
halTransforms, specialTransforms = [], idx;
|
3279
|
+
|
3280
|
+
if (canUseAcceleratedLayer) {
|
3281
|
+
// Remove previous transforms
|
3282
|
+
if (this._lastAcceleratedTransforms) currentTransforms.removeObjects(this._lastAcceleratedTransforms);
|
3283
|
+
|
3284
|
+
halTransforms = ['translateX('+(translateLeft || 0)+'px)', 'translateY('+(translateTop || 0)+'px)'];
|
3285
|
+
|
3286
|
+
// FIXME: This join.match is a bit hackish
|
3287
|
+
if (SC.platform.supportsCSS3DTransforms && !currentTransforms.join(' ').match('translateZ')) {
|
3288
|
+
halTransforms.push('translateZ(0px)');
|
3289
|
+
}
|
3290
|
+
|
3291
|
+
// Store for next time
|
3292
|
+
this._lastAcceleratedTransforms = halTransforms;
|
3293
|
+
}
|
3294
|
+
|
3295
|
+
// Handle special CSS transform attributes
|
3296
|
+
var specialTransforms = [], transformName;
|
3297
|
+
for(transformName in SC.CSS_TRANSFORM_MAP) {
|
3298
|
+
var cleanedTransforms = [], idx;
|
3299
|
+
for(idx=0; idx < currentTransforms.length; idx++) {
|
3300
|
+
if (!currentTransforms[idx].match(new RegExp('^'+transformName+'\\\('))) {
|
3301
|
+
cleanedTransforms.push(currentTransforms[idx]);
|
3302
|
+
}
|
3303
|
+
}
|
3304
|
+
currentTransforms = cleanedTransforms;
|
3305
|
+
|
3306
|
+
if (layout[transformName]) {
|
3307
|
+
specialTransforms.push(SC.CSS_TRANSFORM_MAP[transformName](layout[transformName]));
|
3308
|
+
}
|
3309
|
+
}
|
3310
|
+
specialTransforms = specialTransforms.join(' ');
|
3311
|
+
|
3312
|
+
var allTransforms = currentTransforms.concat(halTransforms, specialTransforms).without(undefined).without('').join(' ');
|
3313
|
+
|
3314
|
+
// Set transform attribute
|
3315
|
+
if (allTransforms !== '') ret[transformAttribute] = allTransforms;
|
3316
|
+
}
|
3317
|
+
|
3318
|
+
// Temporary fix to not break SC.Animatable
|
3319
|
+
if (!this.isAnimatable) {
|
3320
|
+
|
3321
|
+
// Handle animations
|
3322
|
+
var transitions = [], animation, propertyKey;
|
3323
|
+
this._animatedTransforms = [];
|
3324
|
+
|
3325
|
+
for(key in layout) {
|
3326
|
+
if (key.substring(0,7) === 'animate') {
|
3327
|
+
// FIXME: If we want to allow it to be set as just a number for duration we need to add support here
|
3328
|
+
animation = layout[key];
|
3329
|
+
|
3330
|
+
if (animation.timing) {
|
3331
|
+
if (SC.typeOf(animation.timing) != SC.T_STRING) {
|
3332
|
+
animation.timing = "cubic-bezier("+animation.timing[0]+", "+animation.timing[1]+", "+
|
3333
|
+
animation.timing[2]+", "+animation.timing[3]+")";
|
3334
|
+
}
|
3335
|
+
} else {
|
3336
|
+
animation.timing = 'linear';
|
3337
|
+
}
|
3338
|
+
|
3339
|
+
propertyKey = key.substring(7).camelize();
|
3340
|
+
|
3341
|
+
// TODO: This is a weird conditional, we can probably clean it up
|
3342
|
+
if (
|
3343
|
+
SC.platform.supportsCSSTransforms &&
|
3344
|
+
(
|
3345
|
+
(
|
3346
|
+
canUseAcceleratedLayer && (
|
3347
|
+
(propertyKey === 'top' && !SC.empty(translateTop)) ||
|
3348
|
+
(propertyKey === 'left' && !SC.empty(translateLeft))
|
3349
|
+
)
|
3350
|
+
) ||
|
3351
|
+
SC.CSS_TRANSFORM_MAP[propertyKey]
|
3352
|
+
)
|
3353
|
+
) {
|
3354
|
+
this._animatedTransforms.push(propertyKey);
|
3355
|
+
propertyKey = '-'+SC.platform.cssPrefix+'-transform';
|
3356
|
+
}
|
3357
|
+
|
3358
|
+
animation.css = propertyKey + " " + animation.duration + "s " + animation.timing;
|
3359
|
+
|
3360
|
+
// If it's a transform this may have already been set
|
3361
|
+
if (!this._pendingAnimations) this._pendingAnimations = {};
|
3362
|
+
if (!this._pendingAnimations[propertyKey]) {
|
3363
|
+
this._pendingAnimations[propertyKey] = animation;
|
3364
|
+
transitions.push(animation.css);
|
3365
|
+
}
|
3366
|
+
}
|
3367
|
+
}
|
3368
|
+
|
3369
|
+
if (SC.platform.supportsCSSTransitions) ret[SC.platform.domCSSPrefix+"Transition"] = transitions.length > 0 ? transitions.join(", ") : null;
|
3370
|
+
|
3371
|
+
}
|
3372
|
+
|
3373
|
+
|
2233
3374
|
// convert any numbers into a number + "px".
|
2234
|
-
for(
|
2235
|
-
|
3375
|
+
for(key in ret) {
|
3376
|
+
value = ret[key];
|
2236
3377
|
if (typeof value === SC.T_NUMBER) ret[key] = (value + "px");
|
2237
3378
|
}
|
3379
|
+
|
2238
3380
|
return ret ;
|
2239
3381
|
}.property().cacheable(),
|
2240
3382
|
|
@@ -2250,13 +3392,51 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2250
3392
|
This method is called whenever a property changes that invalidates the
|
2251
3393
|
layout of the view. Changing the layout will do this automatically, but
|
2252
3394
|
you can add others if you want.
|
3395
|
+
|
3396
|
+
Implementation Note: In a traditional setup, we would simply observe
|
3397
|
+
'layout' here, but as described above in the documentation for our custom
|
3398
|
+
implementation of propertyDidChange(), this method must always run
|
3399
|
+
immediately after 'layout' is updated to avoid the potential for stale
|
3400
|
+
(incorrect) cached 'frame' values.
|
2253
3401
|
|
2254
3402
|
@returns {SC.View} receiver
|
2255
3403
|
*/
|
2256
3404
|
layoutDidChange: function() {
|
3405
|
+
// Did our layout change in a way that could cause us to be resized? If
|
3406
|
+
// not, then there's no need to invalidate the frames of our child views.
|
3407
|
+
var previousLayout = this._previousLayout,
|
3408
|
+
currentLayout = this.get('layout'),
|
3409
|
+
didResize = YES,
|
3410
|
+
previousWidth, previousHeight, currentWidth, currentHeight;
|
3411
|
+
|
3412
|
+
if (previousLayout && previousLayout !== currentLayout) {
|
3413
|
+
// This is a simple check to see whether we think the view may have
|
3414
|
+
// resized. We could look for a number of cases, but for now we'll
|
3415
|
+
// handle only one simple case: if the width and height are both
|
3416
|
+
// specified, and they have not changed.
|
3417
|
+
previousWidth = previousLayout.width;
|
3418
|
+
if (previousWidth !== undefined) {
|
3419
|
+
currentWidth = currentLayout.width;
|
3420
|
+
if (previousWidth === currentWidth) {
|
3421
|
+
previousHeight = previousLayout.height;
|
3422
|
+
if (previousLayout !== undefined) {
|
3423
|
+
currentHeight = currentLayout.height;
|
3424
|
+
if (previousHeight === currentHeight) didResize = NO;
|
3425
|
+
}
|
3426
|
+
}
|
3427
|
+
}
|
3428
|
+
}
|
3429
|
+
|
2257
3430
|
this.beginPropertyChanges() ;
|
2258
|
-
if (this.frame) this.notifyPropertyChange('frame') ;
|
2259
3431
|
this.notifyPropertyChange('layoutStyle') ;
|
3432
|
+
if (didResize) {
|
3433
|
+
this.viewDidResize();
|
3434
|
+
}
|
3435
|
+
else {
|
3436
|
+
// Even if we didn't resize, our frame might have changed.
|
3437
|
+
// viewDidResize() handles this in the other case.
|
3438
|
+
this._viewFrameDidChange();
|
3439
|
+
}
|
2260
3440
|
this.endPropertyChanges() ;
|
2261
3441
|
|
2262
3442
|
// notify layoutView...
|
@@ -2267,10 +3447,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2267
3447
|
if (layoutView.get('childViewsNeedLayout')) {
|
2268
3448
|
layoutView.invokeOnce(layoutView.layoutChildViewsIfNeeded);
|
2269
3449
|
}
|
2270
|
-
|
3450
|
+
}
|
2271
3451
|
|
2272
3452
|
return this ;
|
2273
|
-
}
|
3453
|
+
},
|
2274
3454
|
|
2275
3455
|
/**
|
2276
3456
|
This this property to YES whenever the view needs to layout its child
|
@@ -2335,13 +3515,12 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2335
3515
|
@returns {void}
|
2336
3516
|
*/
|
2337
3517
|
layoutChildViews: function() {
|
2338
|
-
var set = this._needLayoutViews,
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
3518
|
+
var set = this._needLayoutViews,
|
3519
|
+
len = set ? set.length : 0,
|
3520
|
+
i;
|
3521
|
+
for (i = 0; i < len; ++i) {
|
3522
|
+
set[i].updateLayout();
|
2343
3523
|
}
|
2344
|
-
view = context = layer = null ; // cleanup
|
2345
3524
|
set.clear(); // reset & reuse
|
2346
3525
|
},
|
2347
3526
|
|
@@ -2363,6 +3542,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2363
3542
|
context = this.renderContext(layer);
|
2364
3543
|
this.renderLayout(context);
|
2365
3544
|
context.update();
|
3545
|
+
|
3546
|
+
// If this view uses static layout, then notify if the frame changed.
|
3547
|
+
// (viewDidResize will do a comparison)
|
3548
|
+
if (this.useStaticLayout) this.viewDidResize();
|
2366
3549
|
}
|
2367
3550
|
layer = null ;
|
2368
3551
|
return this ;
|
@@ -2379,7 +3562,11 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2379
3562
|
@test in layoutChildViews
|
2380
3563
|
*/
|
2381
3564
|
renderLayout: function(context, firstTime) {
|
2382
|
-
|
3565
|
+
this._viewRenderer.attr({
|
3566
|
+
layoutStyle: this.get('layoutStyle')
|
3567
|
+
});
|
3568
|
+
this._scv_willRenderAnimations();
|
3569
|
+
this._viewRenderer.render(context);
|
2383
3570
|
},
|
2384
3571
|
|
2385
3572
|
/** walk like a duck */
|
@@ -2404,8 +3591,248 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
|
|
2404
3591
|
*/
|
2405
3592
|
selectStart: function(evt) {
|
2406
3593
|
return this.get('isTextSelectable');
|
2407
|
-
}
|
3594
|
+
},
|
3595
|
+
|
3596
|
+
/**
|
3597
|
+
Used to block the contextMenu per view.
|
3598
|
+
|
3599
|
+
@param evt {SC.Event} the contextmenu event
|
3600
|
+
@returns YES if the contextmenu can show up
|
3601
|
+
*/
|
3602
|
+
contextMenu: function(evt) {
|
3603
|
+
if(!this.get('isContextMenuEnabled')) evt.stop();
|
3604
|
+
return true;
|
3605
|
+
},
|
3606
|
+
|
3607
|
+
/**
|
3608
|
+
A boundary set of distances outside which the touch will not be considered "inside" the view anymore.
|
3609
|
+
|
3610
|
+
By default, up to 50px on each side.
|
3611
|
+
*/
|
3612
|
+
touchBoundary: { left: 50, right: 50, top: 50, bottom: 50 },
|
3613
|
+
|
3614
|
+
/**
|
3615
|
+
@private
|
3616
|
+
A computed property based on frame.
|
3617
|
+
*/
|
3618
|
+
_touchBoundaryFrame: function (){
|
3619
|
+
return this.get("parentView").convertFrameToView(this.get('frame'), null);
|
3620
|
+
}.property("frame", "parentView").cacheable(),
|
3621
|
+
|
3622
|
+
/**
|
3623
|
+
Returns YES if the provided touch is within the boundary.
|
3624
|
+
*/
|
3625
|
+
touchIsInBoundary: function(touch) {
|
3626
|
+
var f = this.get("_touchBoundaryFrame"), maxX = 0, maxY = 0, boundary = this.get("touchBoundary");
|
3627
|
+
var x = touch.pageX, y = touch.pageY;
|
3628
|
+
|
3629
|
+
if (x < f.x) {
|
3630
|
+
x = f.x - x;
|
3631
|
+
maxX = boundary.left;
|
3632
|
+
} else if (x > f.x + f.width) {
|
3633
|
+
x = x - (f.x + f.width);
|
3634
|
+
maxX = boundary.right;
|
3635
|
+
} else {
|
3636
|
+
x = 0;
|
3637
|
+
maxX = 1;
|
3638
|
+
}
|
3639
|
+
|
3640
|
+
if (y < f.y) {
|
3641
|
+
y = f.y - y;
|
3642
|
+
maxY = boundary.top;
|
3643
|
+
} else if (y > f.y + f.height) {
|
3644
|
+
y = y - (f.y + f.height);
|
3645
|
+
maxY = boundary.bottom;
|
3646
|
+
} else {
|
3647
|
+
y = 0;
|
3648
|
+
maxY = 1;
|
3649
|
+
}
|
3650
|
+
|
3651
|
+
if (x > 100 || y > 100) return NO;
|
3652
|
+
return YES;
|
3653
|
+
},
|
3654
|
+
|
3655
|
+
///
|
3656
|
+
/// BUILDING IN/OUT
|
3657
|
+
///
|
3658
|
+
|
3659
|
+
/**
|
3660
|
+
Call this to append a child while building it in. If the child is not
|
3661
|
+
buildable, this is the same as calling appendChild.
|
3662
|
+
*/
|
3663
|
+
buildInChild: function(view) {
|
3664
|
+
view.willBuildInToView(this);
|
3665
|
+
this.appendChild(view);
|
3666
|
+
view.buildInToView(this);
|
3667
|
+
},
|
2408
3668
|
|
3669
|
+
/**
|
3670
|
+
Call to remove a child after building it out. If the child is not buildable,
|
3671
|
+
this will simply call removeChild.
|
3672
|
+
*/
|
3673
|
+
buildOutChild: function(view) {
|
3674
|
+
view.buildOutFromView(this);
|
3675
|
+
},
|
3676
|
+
|
3677
|
+
/**
|
3678
|
+
Called by child view when build in finishes. By default, does nothing.
|
3679
|
+
|
3680
|
+
*/
|
3681
|
+
buildInDidFinishFor: function(child) {
|
3682
|
+
},
|
3683
|
+
|
3684
|
+
/**
|
3685
|
+
@private
|
3686
|
+
Called by child view when build out finishes. By default removes the child view.
|
3687
|
+
*/
|
3688
|
+
buildOutDidFinishFor: function(child) {
|
3689
|
+
this.removeChild(child);
|
3690
|
+
},
|
3691
|
+
|
3692
|
+
/**
|
3693
|
+
Whether the view is currently building in.
|
3694
|
+
*/
|
3695
|
+
isBuildingIn: NO,
|
3696
|
+
|
3697
|
+
/**
|
3698
|
+
Whether the view is currently building out.
|
3699
|
+
*/
|
3700
|
+
isBuildingOut: NO,
|
3701
|
+
|
3702
|
+
/**
|
3703
|
+
Implement this, and call didFinishBuildIn when you are done.
|
3704
|
+
*/
|
3705
|
+
buildIn: function() {
|
3706
|
+
this.buildInDidFinish();
|
3707
|
+
},
|
3708
|
+
|
3709
|
+
/**
|
3710
|
+
Implement this, and call didFinsihBuildOut when you are done.
|
3711
|
+
*/
|
3712
|
+
buildOut: function() {
|
3713
|
+
this.buildOutDidFinish();
|
3714
|
+
},
|
3715
|
+
|
3716
|
+
/**
|
3717
|
+
This should reset (without animation) any internal states; sometimes called before.
|
3718
|
+
|
3719
|
+
It is usually called before a build in, by the parent view.
|
3720
|
+
*/
|
3721
|
+
resetBuild: function() {
|
3722
|
+
|
3723
|
+
},
|
3724
|
+
|
3725
|
+
/**
|
3726
|
+
Implement this if you need to do anything special when cancelling build out;
|
3727
|
+
note that buildIn will subsequently be called, so you usually won't need to do
|
3728
|
+
anything.
|
3729
|
+
|
3730
|
+
This is basically called whenever build in happens.
|
3731
|
+
*/
|
3732
|
+
buildOutDidCancel: function() {
|
3733
|
+
|
3734
|
+
},
|
3735
|
+
|
3736
|
+
/**
|
3737
|
+
Implement this if you need to do anything special when cancelling build in.
|
3738
|
+
You probably won't be able to do anything. I mean, what are you gonna do?
|
3739
|
+
|
3740
|
+
If build in was cancelled, it means build out is probably happening.
|
3741
|
+
So, any timers or anything you had going, you can cancel.
|
3742
|
+
Then buildOut will happen.
|
3743
|
+
*/
|
3744
|
+
buildInDidCancel: function() {
|
3745
|
+
|
3746
|
+
},
|
3747
|
+
|
3748
|
+
/**
|
3749
|
+
Call this when you have built in.
|
3750
|
+
*/
|
3751
|
+
buildInDidFinish: function() {
|
3752
|
+
this.isBuildingIn = NO;
|
3753
|
+
this._buildingInTo.buildInDidFinishFor(this);
|
3754
|
+
this._buildingInTo = null;
|
3755
|
+
},
|
3756
|
+
|
3757
|
+
/**
|
3758
|
+
Call this when you have finished building out.
|
3759
|
+
*/
|
3760
|
+
buildOutDidFinish: function() {
|
3761
|
+
this.isBuildingOut = NO;
|
3762
|
+
this._buildingOutFrom.buildOutDidFinishFor(this);
|
3763
|
+
this._buildingOutFrom = null;
|
3764
|
+
},
|
3765
|
+
|
3766
|
+
/**
|
3767
|
+
Usually called by parentViewDidChange, this resets the build state (calling resetBuild in the process).
|
3768
|
+
*/
|
3769
|
+
resetBuildState: function() {
|
3770
|
+
if (this.isBuildingIn) {
|
3771
|
+
this.buildInDidCancel();
|
3772
|
+
this.isBuildingIn = NO;
|
3773
|
+
}
|
3774
|
+
if (this.isBuildingOut) {
|
3775
|
+
this.buildOutDidCancel();
|
3776
|
+
this.isBuildingOut = NO;
|
3777
|
+
}
|
3778
|
+
|
3779
|
+
// finish cleaning up
|
3780
|
+
this.buildingInTo = null;
|
3781
|
+
this.buildingOutFrom = null;
|
3782
|
+
|
3783
|
+
this.resetBuild();
|
3784
|
+
},
|
3785
|
+
|
3786
|
+
/**
|
3787
|
+
@private (semi)
|
3788
|
+
Called by building parent view's buildInChild method. This prepares
|
3789
|
+
to build in, but unlike buildInToView, this is called _before_ the child
|
3790
|
+
is appended.
|
3791
|
+
|
3792
|
+
Mostly, this cancels any build out _before_ the view is removed through parent change.
|
3793
|
+
*/
|
3794
|
+
willBuildInToView: function(view) {
|
3795
|
+
// stop any current build outs (and if we need to, we also need to build in again)
|
3796
|
+
if (this.isBuildingOut) {
|
3797
|
+
this.buildOutDidCancel();
|
3798
|
+
}
|
3799
|
+
},
|
3800
|
+
|
3801
|
+
/**
|
3802
|
+
@private (semi)
|
3803
|
+
Called by building parent view's buildInChild method.
|
3804
|
+
*/
|
3805
|
+
buildInToView: function(view) {
|
3806
|
+
// if we are already building in, do nothing.
|
3807
|
+
if (this.isBuildingIn) return;
|
3808
|
+
|
3809
|
+
this._buildingInTo = view;
|
3810
|
+
this.isBuildingOut = NO;
|
3811
|
+
this.isBuildingIn = YES;
|
3812
|
+
this.buildIn();
|
3813
|
+
},
|
3814
|
+
|
3815
|
+
/**
|
3816
|
+
@private (semi)
|
3817
|
+
Called by building parent view's buildOutChild method.
|
3818
|
+
|
3819
|
+
The supplied view should always be the parent view.
|
3820
|
+
*/
|
3821
|
+
buildOutFromView: function(view) {
|
3822
|
+
// if we are already building out, do nothing.
|
3823
|
+
if (this.isBuildingOut) return;
|
3824
|
+
|
3825
|
+
// cancel any build ins
|
3826
|
+
if (this.isBuildingIn) {
|
3827
|
+
this.buildInDidCancel();
|
3828
|
+
}
|
3829
|
+
|
3830
|
+
// in any case, we need to build out
|
3831
|
+
this.isBuildingOut = YES;
|
3832
|
+
this.isBuildingIn = NO;
|
3833
|
+
this._buildingOutFrom = view;
|
3834
|
+
this.buildOut();
|
3835
|
+
}
|
2409
3836
|
});
|
2410
3837
|
|
2411
3838
|
SC.View.mixin(/** @scope SC.View */ {
|
@@ -2444,47 +3871,66 @@ SC.View.mixin(/** @scope SC.View */ {
|
|
2444
3871
|
Convert any layout to a Top, Left, Width, Height layout
|
2445
3872
|
*/
|
2446
3873
|
convertLayoutToAnchoredLayout: function(layout, parentFrame){
|
2447
|
-
var ret = {top: 0, left: 0, width: parentFrame.width, height: parentFrame.height}
|
3874
|
+
var ret = {top: 0, left: 0, width: parentFrame.width, height: parentFrame.height},
|
3875
|
+
pFW = parentFrame.width, pFH = parentFrame.height, //shortHand for parentDimensions
|
3876
|
+
lR = layout.right,
|
3877
|
+
lL = layout.left,
|
3878
|
+
lT = layout.top,
|
3879
|
+
lB = layout.bottom,
|
3880
|
+
lW = layout.width,
|
3881
|
+
lH = layout.height,
|
3882
|
+
lcX = layout.centerX,
|
3883
|
+
lcY = layout.centerY;
|
2448
3884
|
|
2449
3885
|
// X Conversion
|
2450
3886
|
// handle left aligned and left/right
|
2451
|
-
if (!SC.none(
|
2452
|
-
ret.left =
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
3887
|
+
if (!SC.none(lL)) {
|
3888
|
+
if(SC.isPercentage(lL)) ret.left = lL*pFW;
|
3889
|
+
else ret.left = lL;
|
3890
|
+
if (lW !== undefined) {
|
3891
|
+
if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
|
3892
|
+
else if(SC.isPercentage(lW)) ret.width = lW*pFW ;
|
3893
|
+
else ret.width = lW ;
|
2456
3894
|
} else {
|
2457
|
-
ret.width =
|
3895
|
+
if (lR && SC.isPercentage(lR)) ret.width = pFW - ret.left - (lR*pFW);
|
3896
|
+
else ret.width = pFW - ret.left - (lR || 0);
|
2458
3897
|
}
|
2459
3898
|
|
2460
3899
|
// handle right aligned
|
2461
|
-
} else if (!SC.none(
|
3900
|
+
} else if (!SC.none(lR)) {
|
2462
3901
|
|
2463
3902
|
// if no width, calculate it from the parent frame
|
2464
|
-
if (SC.none(
|
3903
|
+
if (SC.none(lW)) {
|
2465
3904
|
ret.left = 0;
|
2466
|
-
ret.width =
|
3905
|
+
if(lR && SC.isPercentage(lR)) ret.width = pFW - (lR*pFW);
|
3906
|
+
else ret.width = pFW - (lR || 0);
|
2467
3907
|
|
2468
3908
|
// If has width, calculate the left anchor from the width and right and parent frame
|
2469
3909
|
} else {
|
2470
|
-
if(
|
3910
|
+
if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
|
2471
3911
|
else {
|
2472
|
-
ret.width =
|
2473
|
-
ret.
|
3912
|
+
if (SC.isPercentage(lW)) ret.width = lW*pFW;
|
3913
|
+
else ret.width = lW;
|
3914
|
+
if (SC.isPercentage(lR)) ret.left = pFW - (ret.width + lR);
|
3915
|
+
else ret.left = pFW - (ret.width + lR);
|
2474
3916
|
}
|
2475
3917
|
}
|
2476
3918
|
|
2477
3919
|
// handle centered
|
2478
|
-
} else if (!SC.none(
|
2479
|
-
|
2480
|
-
ret.
|
3920
|
+
} else if (!SC.none(lcX)) {
|
3921
|
+
if(lW && SC.isPercentage(lW)) ret.width = (lW*pFW) ;
|
3922
|
+
else ret.width = (lW || 0) ;
|
3923
|
+
ret.left = ((pFW - ret.width)/2);
|
3924
|
+
if (SC.isPercentage(lcX)) ret.left = ret.left + lcX*pFW;
|
3925
|
+
else ret.left = ret.left + lcX;
|
2481
3926
|
|
2482
3927
|
// if width defined, assume left of zero
|
2483
|
-
} else if (!SC.none(
|
3928
|
+
} else if (!SC.none(lW)) {
|
2484
3929
|
ret.left = 0;
|
2485
|
-
if(
|
3930
|
+
if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
|
2486
3931
|
else {
|
2487
|
-
ret.width =
|
3932
|
+
if(SC.isPercentage(lW)) ret.width = lW*pFW;
|
3933
|
+
else ret.width = lW;
|
2488
3934
|
}
|
2489
3935
|
|
2490
3936
|
// fallback, full width.
|
@@ -2499,48 +3945,67 @@ SC.View.mixin(/** @scope SC.View */ {
|
|
2499
3945
|
|
2500
3946
|
// Y Conversion
|
2501
3947
|
// handle left aligned and top/bottom
|
2502
|
-
if (!SC.none(
|
2503
|
-
ret.top =
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
3948
|
+
if (!SC.none(lT)) {
|
3949
|
+
if(SC.isPercentage(lT)) ret.top = lT*pFH;
|
3950
|
+
else ret.top = lT;
|
3951
|
+
if (lH !== undefined) {
|
3952
|
+
if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
|
3953
|
+
else if (SC.isPercentage(lH)) ret.height = lH*pFH;
|
3954
|
+
else ret.height = lH ;
|
2507
3955
|
} else {
|
2508
|
-
ret.height =
|
3956
|
+
ret.height = pFH - ret.top;
|
3957
|
+
if(lB && SC.isPercentage(lB)) ret.height = ret.height - (lB*pFH);
|
3958
|
+
else ret.height = ret.height - (lB || 0);
|
2509
3959
|
}
|
2510
3960
|
|
2511
3961
|
// handle bottom aligned
|
2512
|
-
} else if (!SC.none(
|
3962
|
+
} else if (!SC.none(lB)) {
|
2513
3963
|
|
2514
3964
|
// if no height, calculate it from the parent frame
|
2515
|
-
if (SC.none(
|
3965
|
+
if (SC.none(lH)) {
|
2516
3966
|
ret.top = 0;
|
2517
|
-
ret.height =
|
3967
|
+
if (lB && SC.isPercentage(lB)) ret.height = pFH - (lB*pFH);
|
3968
|
+
else ret.height = pFH - (lB || 0);
|
2518
3969
|
|
2519
3970
|
// If has height, calculate the top anchor from the height and bottom and parent frame
|
2520
3971
|
} else {
|
2521
|
-
if(
|
3972
|
+
if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
|
2522
3973
|
else {
|
2523
|
-
ret.height =
|
2524
|
-
ret.
|
3974
|
+
if (SC.isPercentage(lH)) ret.height = lH*pFH;
|
3975
|
+
else ret.height = lH;
|
3976
|
+
ret.top = pFH - ret.height;
|
3977
|
+
if (SC.isPercentage(lB)) ret.top = ret.top - (lB*pFH);
|
3978
|
+
else ret.top = ret.top - lB;
|
2525
3979
|
}
|
2526
3980
|
}
|
2527
3981
|
|
2528
3982
|
// handle centered
|
2529
|
-
} else if (!SC.none(
|
2530
|
-
|
2531
|
-
ret.
|
3983
|
+
} else if (!SC.none(lcY)) {
|
3984
|
+
if(lH && SC.isPercentage(lH)) ret.height = (lH*pFH) ;
|
3985
|
+
else ret.height = (lH || 0) ;
|
3986
|
+
ret.top = ((pFH - ret.height)/2);
|
3987
|
+
if(SC.isPercentage(lcY)) ret.top = ret.top + lcY*pFH;
|
3988
|
+
else ret.top = ret.top + lcY;
|
2532
3989
|
|
2533
3990
|
// if height defined, assume top of zero
|
2534
|
-
} else if (!SC.none(
|
3991
|
+
} else if (!SC.none(lH)) {
|
2535
3992
|
ret.top = 0;
|
2536
|
-
if(
|
2537
|
-
else ret.height =
|
3993
|
+
if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
|
3994
|
+
else if (SC.isPercentage(lH)) ret.height = lH*pFH;
|
3995
|
+
else ret.height = lH;
|
2538
3996
|
|
2539
3997
|
// fallback, full height.
|
2540
3998
|
} else {
|
2541
3999
|
ret.top = 0;
|
2542
4000
|
ret.height = 0;
|
2543
4001
|
}
|
4002
|
+
|
4003
|
+
if(ret.top) ret.top = Math.floor(ret.top);
|
4004
|
+
if(ret.bottom) ret.bottom = Math.floor(ret.bottom);
|
4005
|
+
if(ret.left) ret.left = Math.floor(ret.left);
|
4006
|
+
if(ret.right) ret.right = Math.floor(ret.right);
|
4007
|
+
if(ret.width !== SC.LAYOUT_AUTO) ret.width = Math.floor(ret.width);
|
4008
|
+
if(ret.height !== SC.LAYOUT_AUTO) ret.height = Math.floor(ret.height);
|
2544
4009
|
|
2545
4010
|
// handle min/max
|
2546
4011
|
if (layout.minHeight !== undefined) ret.minHeight = layout.minHeight ;
|
@@ -2674,9 +4139,10 @@ SC.View.mixin(/** @scope SC.View */ {
|
|
2674
4139
|
}
|
2675
4140
|
|
2676
4141
|
// apply localization recursively to childViews
|
2677
|
-
var childViews = this.prototype.childViews, idx = childViews.length
|
4142
|
+
var childViews = this.prototype.childViews, idx = childViews.length,
|
4143
|
+
viewClass;
|
2678
4144
|
while(--idx>=0) {
|
2679
|
-
|
4145
|
+
viewClass = childViews[idx];
|
2680
4146
|
loc = childLocs[idx];
|
2681
4147
|
if (loc && viewClass && viewClass.loc) viewClass.loc(loc) ;
|
2682
4148
|
}
|
@@ -2706,25 +4172,59 @@ SC.View.mixin(/** @scope SC.View */ {
|
|
2706
4172
|
define an outlet that points to another view or object. The root object
|
2707
4173
|
used for the path will be the receiver.
|
2708
4174
|
*/
|
2709
|
-
SC.outlet = function(path) {
|
4175
|
+
SC.outlet = function(path, root) {
|
2710
4176
|
return function(key) {
|
2711
|
-
return (this[key] = SC.objectForPropertyPath(path, this)) ;
|
4177
|
+
return (this[key] = SC.objectForPropertyPath(path, (root !== undefined) ? root : this)) ;
|
2712
4178
|
}.property();
|
2713
4179
|
};
|
2714
4180
|
|
2715
4181
|
/** @private on unload clear cached divs. */
|
2716
4182
|
SC.View.unload = function() {
|
2717
|
-
|
2718
4183
|
// delete view items this way to ensure the views are cleared. The hash
|
2719
4184
|
// itself may be owned by multiple view subclasses.
|
2720
4185
|
var views = SC.View.views;
|
2721
4186
|
if (views) {
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
4187
|
+
for(var key in views) {
|
4188
|
+
if (!views.hasOwnProperty(key)) continue ;
|
4189
|
+
delete views[key];
|
4190
|
+
}
|
4191
|
+
}
|
4192
|
+
} ;
|
4193
|
+
|
4194
|
+
SC.View.runCallback = function(callback){
|
4195
|
+
var additionalArgs = SC.$A(arguments).slice(1),
|
4196
|
+
typeOfAction = SC.typeOf(callback.action);
|
4197
|
+
|
4198
|
+
// if the action is a function, just try to call it.
|
4199
|
+
if (typeOfAction == SC.T_FUNCTION) {
|
4200
|
+
callback.action.apply(callback.target, additionalArgs);
|
4201
|
+
|
4202
|
+
// otherwise, action should be a string. If it has a period, treat it
|
4203
|
+
// like a property path.
|
4204
|
+
} else if (typeOfAction === SC.T_STRING) {
|
4205
|
+
if (callback.action.indexOf('.') >= 0) {
|
4206
|
+
var path = callback.action.split('.') ;
|
4207
|
+
var property = path.pop() ;
|
4208
|
+
|
4209
|
+
var target = SC.objectForPropertyPath(path, window) ;
|
4210
|
+
var action = target.get ? target.get(property) : target[property];
|
4211
|
+
if (action && SC.typeOf(action) == SC.T_FUNCTION) {
|
4212
|
+
action.apply(target, additionalArgs);
|
4213
|
+
} else {
|
4214
|
+
throw 'SC.Animator could not find a function at %@'.fmt(callback.action) ;
|
4215
|
+
}
|
4216
|
+
|
4217
|
+
// otherwise, try to execute action direction on target or send down
|
4218
|
+
// responder chain.
|
4219
|
+
// FIXME: Add support for additionalArgs to this
|
4220
|
+
// } else {
|
4221
|
+
// SC.RootResponder.responder.sendAction(callback.action, callback.target, callback.source, callback.source.get("pane"), null, callback.source);
|
2725
4222
|
}
|
2726
4223
|
}
|
2727
|
-
|
2728
|
-
|
4224
|
+
};
|
4225
|
+
|
4226
|
+
|
4227
|
+
//unload views for IE, trying to collect memory.
|
4228
|
+
if(SC.browser.msie) SC.Event.add(window, 'unload', SC.View, SC.View.unload) ;
|
4229
|
+
|
2729
4230
|
|
2730
|
-
SC.Event.add(window, 'unload', SC.View, SC.View.unload) ;
|