sproutcore 1.9.2 → 1.10.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/VERSION.yml +2 -2
- data/bin/sc-build +12 -9
- data/bin/sc-build-number +12 -9
- data/bin/sc-docs +12 -15
- data/bin/sc-gen +12 -9
- data/bin/sc-init +12 -9
- data/bin/sc-manifest +12 -9
- data/bin/sc-server +12 -9
- data/bin/sproutcore +12 -9
- data/lib/frameworks/sproutcore/Buildfile +14 -17
- data/lib/frameworks/sproutcore/CHANGELOG.md +214 -3
- data/lib/frameworks/sproutcore/README.md +4 -1
- data/lib/frameworks/sproutcore/apps/greenhouse/Buildfile +13 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps/greenhouse/README → apps/greenhouse/README.md} +1 -1
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/TODO +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/beautify.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/design.js +3 -3
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/file.js +3 -3
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/files.js +3 -3
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/layout.js +9 -9
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/library.js +23 -23
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/page.js +1 -1
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/property.js +1 -1
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/property_editor.js +2 -2
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/target.js +1 -1
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/targets.js +12 -12
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/view_configs.js +15 -15
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/core.js +14 -14
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/core_file.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/data_source.js +42 -42
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/app_page.js +45 -45
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/app-selector.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/button.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/dock.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/general.css +0 -0
- data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/css/icons.css +5 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/main-page.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/menu.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/modal.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/picker.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/search.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/text-field.css +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/dialogs.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.eot +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.otf +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.woff +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.eot +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.otf +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.woff +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/app-selector/choose-app.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/app-selector/list-item-sel.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/active-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/regular-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-active-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-m.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-r.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/actions-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/actions.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/inspector-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/inspector.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/library-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/library.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/projects-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/projects.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/run-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/run.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/save-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/save.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/greenhouse-l.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/greenhouse-s.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/sproutcore.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/main-bg.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom-left.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom-right.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/close-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/close.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/left.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-bottom.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-left.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-right.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-top.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/right.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/search-active.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/search.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top-left.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top-right.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top.png +0 -0
- data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/images/sc-icon-sproutcore-16.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/toolbar-bg.png +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/inspectors.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/loading.rhtml +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/main_page.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/strings.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/fixtures/file.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/main.js +5 -5
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/mixins/drop_down.js +14 -14
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/design.js +4 -4
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/dir.js +12 -12
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/file.js +7 -9
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/target.js +12 -12
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/view_config.js +10 -10
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/resources/test_page.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/inspector.js +11 -11
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/library.js +10 -10
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/main.js +26 -25
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/modals.js +10 -10
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/ready.js +15 -15
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/design.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/designs.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/file.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/files.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/models/file.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/models/view_config.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/views/list_item.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/views/plist_item.js +1 -5
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/theme.js +6 -6
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/anchor.js +43 -43
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/application_list_item.js +2 -2
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/event_blocker.js +7 -7
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/label_designer.js +0 -0
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/list_item.js +8 -8
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/plist_item.js +23 -23
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/simple_button.js +31 -31
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/tear_off_picker.js +12 -12
- data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/web.js +5 -5
- data/lib/frameworks/sproutcore/apps/media_examples/core.js +5 -6
- data/lib/frameworks/sproutcore/apps/media_examples/views/audio_view.js +16 -17
- data/lib/frameworks/sproutcore/apps/media_examples/views/camera_view.js +4 -5
- data/lib/frameworks/sproutcore/apps/media_examples/views/capabilities_view.js +17 -18
- data/lib/frameworks/sproutcore/apps/media_examples/views/microphone_view.js +4 -5
- data/lib/frameworks/sproutcore/apps/media_examples/views/video_view.js +18 -19
- data/lib/frameworks/sproutcore/apps/showcase/Buildfile +2 -2
- data/lib/frameworks/sproutcore/apps/showcase/README +1 -1
- data/lib/frameworks/sproutcore/apps/showcase/controllers/source_tree_controller.js +27 -7
- data/lib/frameworks/sproutcore/apps/showcase/core.js +6 -4
- data/lib/frameworks/sproutcore/apps/showcase/main.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/patch.diff +529 -0
- data/lib/frameworks/sproutcore/apps/showcase/resources/images/sproutcore-128.png +0 -0
- data/lib/frameworks/sproutcore/apps/showcase/resources/main_page.js +3 -2
- data/lib/frameworks/sproutcore/apps/showcase/resources/stylesheet.css +35 -16
- data/lib/frameworks/sproutcore/apps/showcase/resources/views_page.js +195 -10
- data/lib/frameworks/sproutcore/apps/showcase/system/views_item_content.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/theme.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/checkbox_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/date_field_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/disclosure_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/label_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/list_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/popup_button_views.js +3 -2
- data/lib/frameworks/sproutcore/apps/showcase/views/progress_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/radio_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/scroll_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/segmented_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/select_views.js +10 -9
- data/lib/frameworks/sproutcore/apps/showcase/views/slider_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/source_list_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/split_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/static_content_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/tab_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/text_field_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/toolbar_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/views_item_view.js +15 -6
- data/lib/frameworks/sproutcore/apps/showcase/views/views_list_view.js +5 -4
- data/lib/frameworks/sproutcore/apps/showcase/views/web_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/well_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/workspace_views.js +2 -1
- data/lib/frameworks/sproutcore/apps/statechart_routing/core.js +5 -5
- data/lib/frameworks/sproutcore/apps/statechart_routing/resources/login_page.js +15 -15
- data/lib/frameworks/sproutcore/apps/statechart_routing/resources/styles.css +3 -0
- data/lib/frameworks/sproutcore/apps/tests/controllers/source.js +11 -11
- data/lib/frameworks/sproutcore/apps/tests/controllers/target.js +6 -12
- data/lib/frameworks/sproutcore/apps/tests/controllers/targets.js +28 -33
- data/lib/frameworks/sproutcore/apps/tests/controllers/{detail.js → test.js} +14 -12
- data/lib/frameworks/sproutcore/apps/tests/controllers/tests.js +11 -15
- data/lib/frameworks/sproutcore/apps/tests/core.js +8 -113
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +9 -19
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +81 -92
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/strings.js +3 -1
- data/lib/frameworks/sproutcore/apps/tests/main.js +8 -13
- data/lib/frameworks/sproutcore/apps/tests/statechart.js +268 -0
- data/lib/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +4 -4
- data/lib/frameworks/sproutcore/apps/welcome/controllers/targets.js +16 -16
- data/lib/frameworks/sproutcore/apps/welcome/core.js +9 -9
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/images/sproutcore.png +0 -0
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +22 -25
- data/lib/frameworks/sproutcore/apps/welcome/main.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-landscape.jpg b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-landscape.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-landscape.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-landscape.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-portrait.jpg b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-portrait.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-portrait.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-portrait.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +21 -7
- data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +35 -2
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +142 -75
- data/lib/frameworks/sproutcore/frameworks/bootstrap/tests/system/browser.js +20 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +283 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +284 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +64 -65
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +8 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +19 -19
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/run_loop.js +10 -25
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/selection_support.js +12 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/body_overflow.js +53 -34
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +30 -24
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +44 -40
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/manipulation.js +5 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +105 -176
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/browser.js +225 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/core_query.js +54 -34
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/cursor.js +86 -71
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +35 -35
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +283 -120
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/ready.js +36 -37
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +653 -435
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/responder.js +49 -42
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +422 -396
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +10 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/theme.js +37 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils/rect.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/selection_support.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/cursor.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/platform.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/end.js +17 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_attr.js +9 -9
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_className.js +43 -43
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +4 -14
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/update.js +18 -30
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +78 -43
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/theme.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +31 -15
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +47 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/firstResponder.js +32 -31
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/keyPane.js +23 -22
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/layout.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/sendEvent.js +17 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +626 -211
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +174 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +22 -20
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/childViewLayout_test.js +27 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +11 -10
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertFrames.js +5 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createChildViews.js +10 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +17 -12
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroy.js +60 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroyLayer.js +19 -26
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +14 -13
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/enabled_states_test.js +341 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/findLayerInParentLayer.js +9 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/init.js +26 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +28 -68
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisible.js +35 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisibleInWindow.js +93 -78
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +62 -64
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +69 -18
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +26 -21
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +129 -57
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +436 -238
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/removeChild.js +38 -44
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render.js +14 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render_delegate_support.js +29 -20
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceAllChildren_test.js +229 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayer.js +33 -95
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +87 -39
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +684 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +767 -625
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/acceleration.js +4 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +645 -77
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +218 -19
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +648 -321
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +326 -534
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +120 -126
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +1526 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +18 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/visibility.js +12 -94
- data/lib/frameworks/sproutcore/frameworks/core_tools/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_tools/data_source.js +19 -19
- data/lib/frameworks/sproutcore/frameworks/core_tools/models/target.js +43 -27
- data/lib/frameworks/sproutcore/frameworks/core_tools/models/test.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/core_tools/resources/icons.css +5 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/resources/sc-icon-sproutcore-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +41 -41
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +90 -90
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +31 -31
- data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +2 -8
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +74 -48
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +11 -16
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +187 -253
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/cascade.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +49 -9
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +236 -127
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/instance_management.js +107 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +12 -11
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/loadRecord.js +42 -17
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +20 -15
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +205 -92
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +61 -25
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/resources/strings.js +39 -9
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +45 -1
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/tests/system/datetime.js +88 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/coders/design.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/coders/object.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/controllers.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/design.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/designs.js +19 -19
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/page_design.js +44 -44
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/page_files.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/core.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_rule.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_style.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_style_sheet.js +37 -37
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/button.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/label.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/object_designer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/tab.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/text_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/view_designer.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/css/designer.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/design_page.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/high_light.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/controller.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-divider.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-sel-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-sel-divider.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/main-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/page.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/pane.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/view.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/selection_handles.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/binding.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/object.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/page.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/view.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/mixins/button.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/mixins/snap_lines.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/tests/coders/page.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/tests/designers/view_designer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/designer_drop_target.js +36 -37
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/drawing.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/high_light.js +17 -17
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/page_item_view.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/selection_handles.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +51 -51
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/mixins/split_child.js +63 -52
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/mixins/split_thumb.js +64 -59
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +113 -112
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +182 -203
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +51 -29
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +513 -307
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +69 -217
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +31 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +15 -20
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/collection.js +2 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/image_button.js +25 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/panel.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/picker.js +29 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/popup_button.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +19 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +14 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +24 -24
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/render_delegates/split.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/render_delegates/split_divider.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/modal.css +2 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/panel.css +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +24 -98
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +446 -442
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +42 -21
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +19 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +26 -28
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/pane_page.js +11 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +5 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +32 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +27 -22
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/methods.js +5 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/ui.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +11 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/displayProperties.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/keyEquivalents.js +9 -11
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +23 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +15 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/{mixins → views/collection}/collection_fast_path.js +18 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +46 -53
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +101 -47
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +26 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +89 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +27 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +32 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +6 -11
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/drag_and_drop.js +103 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +76 -38
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/image_button/ui.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/drag_and_drop.js +91 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +2 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +70 -38
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +17 -19
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +10 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +37 -30
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +18 -20
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +115 -28
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +37 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +194 -182
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/ui.js +2 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +18 -21
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +5 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/slider/methods.js +5 -4
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/children.js +15 -15
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/dividers.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +341 -45
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/split_child.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/split_thumb.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +6 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +49 -52
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +23 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/toolbar/ui.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +4 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +47 -38
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +24 -24
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +887 -740
- data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +68 -55
- data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +8 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +189 -167
- data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +55 -54
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +8 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +145 -146
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +21 -21
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +66 -66
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +40 -44
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +203 -200
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +11 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +6 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +87 -112
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +192 -179
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_button.js +23 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +64 -64
- data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +56 -56
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +784 -714
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +21 -39
- data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +45 -41
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +4 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +9 -47
- data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +40 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +62 -50
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +0 -9
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +45 -45
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js +16 -16
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +46 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphism/simple.js +16 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/desktop_scroller.js +12 -12
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/ui.js +38 -40
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +8 -8
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +20 -20
- data/lib/frameworks/sproutcore/frameworks/formatters/formatters/date_formatter.js +16 -16
- data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +26 -14
- data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +43 -43
- data/lib/frameworks/sproutcore/frameworks/foundation/debug/test-image.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +11 -11
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +63 -41
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +60 -61
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +72 -72
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +142 -142
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gesturable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +10 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +36 -29
- data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/protocols/swap_transition_protocol.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +54 -29
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/image.js +23 -18
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +12 -11
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/benchmark.css +21 -20
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-128.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-256.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-32.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-48.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-512.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-64.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/label.css +5 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/app_cache.js +412 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +2 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +11 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +21 -21
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +8 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/selection_support.js +33 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/delegates/inline_text_field/inline_text_field.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_display.js +9 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +5 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +49 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +29 -21
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +8 -10
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/app_cache_test.js +81 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/image_queue.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/pointInElement.js +0 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +40 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +143 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +5 -7
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +187 -84
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +6 -41
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +51 -7
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +11 -16
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_bounce_transition.js +80 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_smooth_transition.js +39 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_spring_transition.js +77 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/bounce_transition.js +211 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js +57 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/pop_transition.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js +54 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/slide_transition.js +140 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/spring_transition.js +203 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_dissolve_transition.js +67 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_fade_color_transition.js +81 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_move_in_transition.js +104 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_push_transition.js +181 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_reveal_transition.js +90 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/validator.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +483 -95
- data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +65 -65
- data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +111 -100
- data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +30 -222
- data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +38 -24
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +74 -62
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-1.8.3-patched.js +9485 -0
- data/lib/frameworks/sproutcore/frameworks/media/media_capabilities.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/media/render_delegates/media_slider.js +20 -20
- data/lib/frameworks/sproutcore/frameworks/media/resources/video.css +18 -17
- data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +19 -19
- data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +10 -11
- data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +7 -8
- data/lib/frameworks/sproutcore/frameworks/media/views/video.js +24 -24
- data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +32 -21
- data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +72 -53
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +164 -156
- data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +20 -20
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +145 -140
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +393 -370
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1045 -999
- data/lib/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +41 -36
- data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +10 -4
- data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +11 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +275 -205
- data/lib/frameworks/sproutcore/frameworks/runtime/system/function.js +27 -27
- data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +229 -193
- data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +24 -24
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +186 -188
- data/lib/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +138 -65
- data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +11 -10
- data/lib/frameworks/sproutcore/frameworks/runtime/system/string.js +8 -4
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +4 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/chained.js +112 -23
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +71 -18
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +97 -57
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +22 -22
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/infinite.js +184 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/observer_set.js +63 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +73 -36
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +100 -25
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/string.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/debug/sequence_matcher.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/statechart/private/state_path_matcher.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/statechart/system/history_state.js +32 -32
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +449 -422
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state_route_handler_context.js +19 -19
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +612 -562
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/routing/with_concurrent_states/basic.js +115 -62
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/routing/without_concurrent_states/basic.js +145 -64
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/respond_to_event.js +17 -1
- data/lib/frameworks/sproutcore/frameworks/table/views/table_head.js +30 -30
- data/lib/frameworks/sproutcore/frameworks/table/views/table_row.js +34 -34
- data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/bind.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/collection.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/view.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/template_view/tests/panes/template.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/template_view/views/template.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/template_view/views/template_collection.js +15 -21
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +35 -35
- data/lib/frameworks/sproutcore/scripts/run_sc_server_master.sh +34 -0
- data/lib/frameworks/sproutcore/tests/phantomjs_runner.phantomjs +606 -0
- data/lib/frameworks/sproutcore/themes/ace/designs/psds/panel/PanelPane.opacity +0 -0
- data/lib/frameworks/sproutcore/themes/ace/designs/psds/panel/Pointers.opacity +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/active_button@2x.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/normal_button@2x.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_active_button@2x.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_button@2x.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/popup/select.css +3 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +18 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel@2x.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/panel.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/panel@2x.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.css +34 -14
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/pointers.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/pointers@2x.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented.css +5 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented.css +7 -2
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented.css +5 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented.css +6 -3
- data/lib/frameworks/sproutcore/themes/ace/resources/toolbar/toolbar.css +7 -5
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/button.js +7 -7
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/progress.js +37 -37
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/slider.js +12 -12
- data/lib/sproutcore/helpers/static_helper.rb +35 -27
- data/sproutcore.gemspec +1 -0
- metadata +529 -451
- data/lib/frameworks/sproutcore/apps/showcase/resources/images/sproutcore-logo.png +0 -0
- data/lib/frameworks/sproutcore/apps/showcase/views/button_views.js +0 -55
- data/lib/frameworks/sproutcore/apps/showcase/views/container_views.js +0 -29
- data/lib/frameworks/sproutcore/apps/showcase/views/grid_views.js +0 -28
- data/lib/frameworks/sproutcore/apps/showcase/views/image_button_views.js +0 -22
- data/lib/frameworks/sproutcore/apps/showcase/views/image_views.js +0 -51
- data/lib/frameworks/sproutcore/apps/tests/states/no_targets.js +0 -26
- data/lib/frameworks/sproutcore/apps/tests/states/ready.js +0 -56
- data/lib/frameworks/sproutcore/apps/tests/states/ready_detail.js +0 -41
- data/lib/frameworks/sproutcore/apps/tests/states/ready_empty.js +0 -48
- data/lib/frameworks/sproutcore/apps/tests/states/ready_list.js +0 -41
- data/lib/frameworks/sproutcore/apps/tests/states/ready_loading.js +0 -44
- data/lib/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +0 -31
- data/lib/frameworks/sproutcore/apps/tests/states/start.js +0 -39
- data/lib/frameworks/sproutcore/apps/welcome/tests/controllers/targets.js +0 -15
- data/lib/frameworks/sproutcore/frameworks/animation/Buildfile +0 -3
- data/lib/frameworks/sproutcore/frameworks/animation/LICENSE +0 -25
- data/lib/frameworks/sproutcore/frameworks/animation/README.md +0 -79
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +0 -1208
- data/lib/frameworks/sproutcore/frameworks/animation/tests/core.js +0 -152
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/parentViewDidChange.js +0 -67
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/prepareContext.js +0 -203
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayerLocation.js +0 -213
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +0 -163
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/mixins/border.js +0 -97
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/methods.js +0 -312
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split.js +0 -961
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split_divider.js +0 -40
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/thumb.js +0 -27
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-logo.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffer.js +0 -394
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +0 -133
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-sc.js +0 -18
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +0 -8981
- data/lib/frameworks/sproutcore/frameworks/jquery/tests/set_class.js +0 -40
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.js +0 -0
@@ -1,31 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: SproutCore - JavaScript Application Framework
|
3
|
-
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
4
|
-
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
|
-
// License: Licensed under MIT license (see license.js)
|
6
|
-
// ==========================================================================
|
7
|
-
/*globals TestRunner */
|
8
|
-
|
9
|
-
/**
|
10
|
-
Displayed when the app has no targets.
|
11
|
-
*/
|
12
|
-
TestRunner.READY_NO_TESTS = SC.Responder.create({
|
13
|
-
|
14
|
-
nextResponder: TestRunner.READY,
|
15
|
-
|
16
|
-
/**
|
17
|
-
Show loading targets view.
|
18
|
-
*/
|
19
|
-
didBecomeFirstResponder: function() {
|
20
|
-
TestRunner.set('currentScene', 'noTests');
|
21
|
-
|
22
|
-
// this is always the final route since we can't load any tests
|
23
|
-
var target = TestRunner.sourceController.get('selection').firstObject();
|
24
|
-
TestRunner.updateRoute(target, null, YES);
|
25
|
-
},
|
26
|
-
|
27
|
-
willLoseFirstResponder: function() {
|
28
|
-
TestRunner.set('currentScene', null);
|
29
|
-
}
|
30
|
-
|
31
|
-
});
|
@@ -1,39 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: SproutCore - JavaScript Application Framework
|
3
|
-
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
4
|
-
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
|
-
// License: Licensed under MIT license (see license.js)
|
6
|
-
// ==========================================================================
|
7
|
-
/*globals TestRunner */
|
8
|
-
|
9
|
-
/**
|
10
|
-
Initial state of application before it has loaded targets.
|
11
|
-
*/
|
12
|
-
TestRunner.START = SC.Responder.create({
|
13
|
-
|
14
|
-
/**
|
15
|
-
Show loading targets view.
|
16
|
-
*/
|
17
|
-
didBecomeFirstResponder: function() {
|
18
|
-
TestRunner.set('currentScene', 'targetsLoading');
|
19
|
-
TestRunner.targetsController.reload(); // load the targets.
|
20
|
-
},
|
21
|
-
|
22
|
-
willLoseFirstResponder: function() {
|
23
|
-
TestRunner.set('currentScene', null);
|
24
|
-
},
|
25
|
-
|
26
|
-
/**
|
27
|
-
Called when the targets have loaded. Pass param whether we have targets
|
28
|
-
or not.
|
29
|
-
*/
|
30
|
-
targetsDidChange: function() {
|
31
|
-
if (TestRunner.getPath('targets.status') !== SC.Record.READY_CLEAN) return NO;
|
32
|
-
|
33
|
-
var hasTargets = TestRunner.getPath('targets.length') >0;
|
34
|
-
if (hasTargets) TestRunner.makeFirstResponder(TestRunner.READY_EMPTY);
|
35
|
-
else TestRunner.makeFirstResponder(TestRunner.NO_TARGETS);
|
36
|
-
return YES;
|
37
|
-
}
|
38
|
-
|
39
|
-
});
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: Welcome.targetsController Unit Test
|
3
|
-
// Copyright: ©2011 Apple Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals Welcome module test ok equals same stop start */
|
6
|
-
|
7
|
-
module("Welcome.targetsController");
|
8
|
-
|
9
|
-
// TODO: Replace with real unit test for Welcome.targetsController
|
10
|
-
test("test description", function() {
|
11
|
-
var expected = "test";
|
12
|
-
var result = "test";
|
13
|
-
equals(result, expected, "test should equal test");
|
14
|
-
});
|
15
|
-
|
@@ -1,25 +0,0 @@
|
|
1
|
-
Copyright (C) 2009 Alex Iskander and TPSi. All Rights Reserved.
|
2
|
-
|
3
|
-
Redistribution and use in source and binary forms, with or without
|
4
|
-
modification, are permitted provided that the following conditions
|
5
|
-
are met:
|
6
|
-
1. Redistributions of source code must retain the above copyright
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
8
|
-
2. Redistributions in binary form must reproduce the above copyright
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
10
|
-
documentation and/or other materials provided with the distribution.
|
11
|
-
3. Neither the name of Technical Programming Services, Inc. ("TPSi") nor the
|
12
|
-
names of its contributors may be used to endorse or promote products
|
13
|
-
derived from this software without specific prior written permission.
|
14
|
-
|
15
|
-
THIS SOFTWARE IS PROVIDED BY TPSi ``AS IS'' AND ANY
|
16
|
-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
18
|
-
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TPSi OR
|
19
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
20
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
21
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
22
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
23
|
-
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
24
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
25
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -1,79 +0,0 @@
|
|
1
|
-
SC.ANIMATABLE
|
2
|
-
=============
|
3
|
-
|
4
|
-
A simple mixin called SC.Animatable is provided. What does it do?
|
5
|
-
It makes CSS transitions for you, and if they aren't available,
|
6
|
-
implements them in JavaScript.
|
7
|
-
|
8
|
-
Current good things:
|
9
|
-
* Animates 300 SC.LabelViews acceptably with only JavaScript. Animates >500
|
10
|
-
just as well (if not better) with CSS transitions.
|
11
|
-
* Automatically detects if CSS transitions are available.
|
12
|
-
|
13
|
-
Current flaws:
|
14
|
-
* Supports only a limited subset of properties. For instance, no support for
|
15
|
-
animating background colors.
|
16
|
-
|
17
|
-
Example Usage:
|
18
|
-
|
19
|
-
aView: SC.LabelView.design(SC.Animatable, {
|
20
|
-
transitions: {
|
21
|
-
left: .25,
|
22
|
-
top: {duration: .25}
|
23
|
-
width: { duration: .25, timing: SC.Animatable.TIMING_EASE_IN_OUT }, // with timing curve
|
24
|
-
height: { duration: .5, timing: [0, 0, 0.58, 1.0] } // with custom timing curve
|
25
|
-
}
|
26
|
-
})
|
27
|
-
|
28
|
-
|
29
|
-
Including in your Project
|
30
|
-
===============================================================================
|
31
|
-
In your project-level Buildfile, there is a line like this:
|
32
|
-
config :all, :required => :sproutcore
|
33
|
-
|
34
|
-
Add the animate framework to it by changing it to this:
|
35
|
-
config :all, :required => [:sproutcore, 'sproutcore/animation']
|
36
|
-
|
37
|
-
Now, you should be able to use it in any view, as demonstrated above!
|
38
|
-
|
39
|
-
|
40
|
-
Reference
|
41
|
-
===============================================================================
|
42
|
-
The API is simple. You set up transitions in the "transitions" property, and can
|
43
|
-
supply them with a few parameters:
|
44
|
-
* duration: The amount of time in seconds that the animation should last.
|
45
|
-
* timing: The timing curve to use. Defaults to SC.Animatable.defaultTimingFunction. See "Timing"
|
46
|
-
|
47
|
-
|
48
|
-
Timing
|
49
|
-
------
|
50
|
-
Timing is handled using beziér curves (like in CSS transitions).
|
51
|
-
|
52
|
-
The variable SC.Animatable.defaultTimingFunction can be used to globally set the timing
|
53
|
-
curve; any transition that has "null" as its timing curve will use this default
|
54
|
-
timing curve.
|
55
|
-
|
56
|
-
For example, you could include this line in one of your JavaScript files:
|
57
|
-
SC.Animatable.defaultTimingFunction = SC.Animatable.TRANSITION_EASE_IN_OUT;
|
58
|
-
|
59
|
-
There are a few built-in timing curves (shown here with their values). The curves
|
60
|
-
with CSS in their name are CSS-only versions; JavaScript-based animations will use
|
61
|
-
linear. The big benefit of CSS-only timing functions is that JavaScript performance
|
62
|
-
is not impacted; to handle timing curves, JavaScript has to do some semi-heavy calculations
|
63
|
-
**each frame**. Using CSS-only transitions gives a graceful degradation of sorts.
|
64
|
-
|
65
|
-
* SC.Animatable.TRANSITION_NONE: "linear"
|
66
|
-
* SC.Animatable.TRANSITION_CSS_EASE: "ease"
|
67
|
-
* SC.Animatable.TRANSITION_CSS_EASE_IN: "ease-in"
|
68
|
-
* SC.Animatable.TRANSITION_CSS_EASE_OUT: "ease-out"
|
69
|
-
* SC.Animatable.TRANSITION_CSS_EASE_OUT: "ease-in-out"
|
70
|
-
* SC.Animatable.TRANSITION_EASE: [0.25, 0.1, 0.25, 1.0]
|
71
|
-
* SC.Animatable.TRANSITION_LINEAR: [0.0, 0.0, 1.0, 1.0]
|
72
|
-
* SC.Animatable.TRANSITION_EASE_IN: [0.42, 0.0, 1.0, 1.0]
|
73
|
-
* SC.Animatable.TRANSITION_EASE_OUT: [0, 0, 0.58, 1.0]
|
74
|
-
* SC.Animatable.TRANSITION_EASE_IN_OUT: [0.42, 0, 0.58, 1.0]
|
75
|
-
|
76
|
-
|
77
|
-
**Note**: The TRANSITION_NONE value is technically a CSS-only "linear" curve; as CSS-only
|
78
|
-
curves make JavaScript use linear, it all works out.
|
79
|
-
|
@@ -1,1208 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: SproutCore Animation
|
3
|
-
// Copyright: ©2010 TPSi
|
4
|
-
// Copyright: ©2010 Alex Iskander
|
5
|
-
// Portions © Apple Inc under BSD License:
|
6
|
-
// See: http://trac.webkit.org/browser/trunk/WebCore/platform/graphics/UnitBezier.h
|
7
|
-
// ==========================================================================
|
8
|
-
/*globals */
|
9
|
-
|
10
|
-
/** @deprecated
|
11
|
-
@namespace
|
12
|
-
A simple mixin called Animatable is provided. What does it do?
|
13
|
-
It makes CSS transitions for you, and if they aren't available,
|
14
|
-
implements them in JavaScript.
|
15
|
-
|
16
|
-
## Animatable things:
|
17
|
-
|
18
|
-
- layout. You can animate any layout property, even centerX and centerY
|
19
|
-
- opacity.
|
20
|
-
- display, in a way. All animating display does is delay setting display:none
|
21
|
-
until <em>after</em> the transition duration has passed. This allows you
|
22
|
-
to set display:none after fading out. If mixing with CSS transitions, you will
|
23
|
-
need to set the delay a tad longer to accommodate any delays in beginning the
|
24
|
-
transition.
|
25
|
-
|
26
|
-
## Example Usage:
|
27
|
-
|
28
|
-
aView: SC.LabelView.design(SC.Animatable, {
|
29
|
-
transitions: {
|
30
|
-
left: {duration: .25},
|
31
|
-
top: .25, // only possible during design; otherwise you must use long form.
|
32
|
-
width: {duration: .25, timing: SC.Animatable.TRANSITION_EASE_IN_OUT }
|
33
|
-
}
|
34
|
-
})
|
35
|
-
*/
|
36
|
-
SC.warn("SC.Animatable is deprecated and will be removed in the next release. Animation can be achieved by using the .animate method on SC.View.");
|
37
|
-
|
38
|
-
SC.Animatable = {
|
39
|
-
/** @scope SC.Animatable.prototype */
|
40
|
-
|
41
|
-
/**
|
42
|
-
Walks like a duck.
|
43
|
-
*/
|
44
|
-
isAnimatable: YES,
|
45
|
-
|
46
|
-
transitions: {},
|
47
|
-
concatenatedProperties: ["transitions"],
|
48
|
-
|
49
|
-
/**
|
50
|
-
The style properties. Works somewhat similarly to layout properties, though
|
51
|
-
is a tad bit simpler, as it does not involve parent views at all.
|
52
|
-
*/
|
53
|
-
style: { },
|
54
|
-
|
55
|
-
// collections of CSS transitions we have available
|
56
|
-
_cssTransitionFor: {
|
57
|
-
"left": "left", "top": "top",
|
58
|
-
"right": "right", "bottom": "bottom",
|
59
|
-
"width": "width", "height": "height",
|
60
|
-
"opacity": "opacity",
|
61
|
-
"transform": (SC.platform.supportsCSSTransforms ? '-'+SC.platform.cssPrefix+'-transform' : "transform")
|
62
|
-
},
|
63
|
-
|
64
|
-
// properties that adjust should relay to style
|
65
|
-
_styleProperties: [ "display", "transform" ],
|
66
|
-
_layoutStyles: SC.String.w('width height top bottom marginLeft marginTop left right zIndex minWidth maxWidth minHeight maxHeight centerX centerY opacity border borderTop borderRight borderBottom borderLeft'),
|
67
|
-
|
68
|
-
// we cache this dictionary so we don't generate a new one each time we make
|
69
|
-
// a new animation. It is used so we can start the animations in order—
|
70
|
-
// for instance, centerX and centerY need to be animated _after_ width and height.
|
71
|
-
_animationsToStart: {},
|
72
|
-
|
73
|
-
// and, said animation order
|
74
|
-
_animationOrder: ["top", "left", "bottom", "right", "width", "height", "centerX", "centerY", "opacity", "display", "transform"],
|
75
|
-
|
76
|
-
|
77
|
-
initMixin: function()
|
78
|
-
{
|
79
|
-
this._animatable_original_didCreateLayer = this.didCreateLayer || function(){};
|
80
|
-
this.didCreateLayer = this._animatable_didCreateLayer;
|
81
|
-
|
82
|
-
this._animatable_original_willDestroyLayer = this.willDestroyLayer || function(){};
|
83
|
-
this.willDestroyLayer = this._animatable_willDestroyLayer;
|
84
|
-
|
85
|
-
this._animatable_original_willRemoveFromParent = this.willRemoveFromParent || function(){};
|
86
|
-
this.willRemoveFromParent = this._animatable_will_remove_from_parent;
|
87
|
-
|
88
|
-
this._animatable_original_hasAcceleratedLayer = this.hasAcceleratedLayer || function(){};
|
89
|
-
this.hasAcceleratedLayer = this._animatable_hasAcceleratedLayer;
|
90
|
-
|
91
|
-
this._animatable_original_animate = this.animate || function(){};
|
92
|
-
this.animate = this._animatable_animate;
|
93
|
-
|
94
|
-
// auto observers do not work when mixed in live, so make sure we do a manual observer
|
95
|
-
this.addObserver("style", this, "styleDidChange");
|
96
|
-
|
97
|
-
// for debugging
|
98
|
-
this._animateTickPixel.displayName = "animate-tick";
|
99
|
-
|
100
|
-
// if transitions was concatenated...
|
101
|
-
var i;
|
102
|
-
if (SC.isArray(this.transitions))
|
103
|
-
{
|
104
|
-
var tl = {}; // prepare a new one mixed in
|
105
|
-
for (i = 0; i < this.transitions.length; i++)
|
106
|
-
{
|
107
|
-
SC.mixin(tl, this.transitions[i]);
|
108
|
-
}
|
109
|
-
this.transitions = tl;
|
110
|
-
}
|
111
|
-
|
112
|
-
// go through transitions and make duration-only ones follow normal pattern
|
113
|
-
for (i in this.transitions)
|
114
|
-
{
|
115
|
-
if (typeof this.transitions[i] == "number")
|
116
|
-
{
|
117
|
-
this.transitions[i] = { duration: this.transitions[i] };
|
118
|
-
}
|
119
|
-
}
|
120
|
-
|
121
|
-
// live animators
|
122
|
-
this._animatableCurrentStyle = null;
|
123
|
-
this._animators = {}; // keyAnimated => object describing it.
|
124
|
-
this._animatableSetCSS = "";
|
125
|
-
this._last_transition_css = ""; // to keep from re-setting unnecessarily
|
126
|
-
// Setting this conditionally allows us to disableAnimation in the init method, before initMixin gets called
|
127
|
-
if (this._disableAnimation === undefined) this._disableAnimation = 0; // calls to disableAnimation add one; enableAnimation remove one.
|
128
|
-
this._transitionCallbacks = {}; // define callback set
|
129
|
-
|
130
|
-
// alert if layer already created
|
131
|
-
if (!SC.none(this.get("layer"))) {
|
132
|
-
var o = this._animatable_original_didCreateLayer;
|
133
|
-
this._animatable_original_didCreateLayer = function(){};
|
134
|
-
this.didCreateLayer();
|
135
|
-
this._animatable_original_didCreateLayer = o;
|
136
|
-
|
137
|
-
}
|
138
|
-
},
|
139
|
-
|
140
|
-
_animatable_didCreateLayer: function(){
|
141
|
-
this.resetAnimation();
|
142
|
-
SC.Event.add(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this.transitionEnd);
|
143
|
-
SC.Event.add(this.get('layer'), "transitionend", this, this.transitionEnd);
|
144
|
-
return this._animatable_original_didCreateLayer();
|
145
|
-
},
|
146
|
-
|
147
|
-
_animatable_willDestroyLayer: function(){
|
148
|
-
SC.Event.remove(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this.transitionEnd);
|
149
|
-
SC.Event.remove(this.get('layer'), "transitionend", this, this.transitionEnd);
|
150
|
-
return this._animatable_original_willDestroyLayer();
|
151
|
-
},
|
152
|
-
|
153
|
-
/**
|
154
|
-
Stops all animations on the layer when this occurs by calling resetAnimation.
|
155
|
-
*/
|
156
|
-
_animatable_will_remove_from_parent: function() {
|
157
|
-
this.resetAnimation();
|
158
|
-
},
|
159
|
-
|
160
|
-
/**
|
161
|
-
Disables animation.
|
162
|
-
|
163
|
-
It is like parenthesis. Each "disable" must be matched by an "enable".
|
164
|
-
If you call disable twice, you need two enables to start it. Three times, you need
|
165
|
-
three enables.
|
166
|
-
*/
|
167
|
-
disableAnimation: function() {
|
168
|
-
if (this._disableAnimation < 1) {
|
169
|
-
this.updateStyle();
|
170
|
-
this._disableAnimation = 1;
|
171
|
-
this.updateStyle();
|
172
|
-
} else {
|
173
|
-
this._disableAnimation++;
|
174
|
-
}
|
175
|
-
},
|
176
|
-
|
177
|
-
/**
|
178
|
-
Enables animation if it was disabled (or moves towards that direction, at least).
|
179
|
-
*/
|
180
|
-
enableAnimation: function() {
|
181
|
-
if (this._disableAnimation <= 1) {
|
182
|
-
this.updateStyle();
|
183
|
-
this._disableAnimation = 0;
|
184
|
-
this.updateStyle();
|
185
|
-
} else {
|
186
|
-
this._disableAnimation--;
|
187
|
-
}
|
188
|
-
},
|
189
|
-
|
190
|
-
/**
|
191
|
-
Adds support for some style properties to adjust.
|
192
|
-
|
193
|
-
These added properties are currently:
|
194
|
-
|
195
|
-
- opacity.
|
196
|
-
- display.
|
197
|
-
|
198
|
-
This is a complete rewrite of adjust. Its performance can probably be boosted. Do it!
|
199
|
-
*/
|
200
|
-
adjust: function(dictionary, value)
|
201
|
-
{
|
202
|
-
if (!SC.none(value)) {
|
203
|
-
var key = dictionary;
|
204
|
-
dictionary = { };
|
205
|
-
dictionary[key] = value;
|
206
|
-
}
|
207
|
-
else {
|
208
|
-
dictionary = SC.clone(dictionary);
|
209
|
-
}
|
210
|
-
|
211
|
-
var style = SC.clone(this.get('style')), didChangeStyle = NO, layout = SC.clone(this.get('layout')), didChangeLayout = NO;
|
212
|
-
var sprops = this._styleProperties;
|
213
|
-
for (var i in dictionary)
|
214
|
-
{
|
215
|
-
var didChange = NO;
|
216
|
-
|
217
|
-
var current = (sprops.indexOf(i) >= 0) ? style : layout;
|
218
|
-
var cval = current[i], nval = dictionary[i];
|
219
|
-
|
220
|
-
if (nval !== undefined && cval !== nval)
|
221
|
-
{
|
222
|
-
if (nval === null)
|
223
|
-
{
|
224
|
-
if (cval !== undefined) didChange = YES;
|
225
|
-
delete current[i];
|
226
|
-
}
|
227
|
-
else
|
228
|
-
{
|
229
|
-
current[i] = nval;
|
230
|
-
didChange = YES;
|
231
|
-
}
|
232
|
-
}
|
233
|
-
|
234
|
-
if (didChange) {
|
235
|
-
if (current === style) didChangeStyle = YES; else didChangeLayout = YES;
|
236
|
-
}
|
237
|
-
}
|
238
|
-
|
239
|
-
if (didChangeStyle) this.set('style', style);
|
240
|
-
if (didChangeLayout) this.set('layout', layout);
|
241
|
-
|
242
|
-
// call base with whatever is leftover
|
243
|
-
return this;
|
244
|
-
},
|
245
|
-
|
246
|
-
/**
|
247
|
-
Don't interfere with the built-in animate method.
|
248
|
-
*/
|
249
|
-
_animatable_animate: function(){
|
250
|
-
this.disableAnimation();
|
251
|
-
var ret = this._animatable_original_animate.apply(this, arguments);
|
252
|
-
this.enableAnimation();
|
253
|
-
return ret;
|
254
|
-
},
|
255
|
-
|
256
|
-
transitionEnd: function(evt){
|
257
|
-
SC.run(function() {
|
258
|
-
var propertyName = evt.originalEvent.propertyName,
|
259
|
-
callback = this._transitionCallbacks[propertyName];
|
260
|
-
|
261
|
-
// only callback is animation is not disabled; assume if anim was
|
262
|
-
// disabled we already invoked the callback..
|
263
|
-
if(callback && this._disableAnimation<=0) {
|
264
|
-
SC.Animatable.runCallback(callback);
|
265
|
-
}
|
266
|
-
}, this);
|
267
|
-
},
|
268
|
-
|
269
|
-
|
270
|
-
/**
|
271
|
-
Returns the current set of styles and layout according to JavaScript transitions.
|
272
|
-
|
273
|
-
That is, for transitions managed by JavaScript (rather than CSS), the current position
|
274
|
-
(even mid-transition) will be returned. For CSS-based transitions, the target position
|
275
|
-
will be returned. This function is mostly useful for testing.
|
276
|
-
|
277
|
-
It will return null if there is no such style.
|
278
|
-
*/
|
279
|
-
getCurrentJavaScriptStyles: function() {
|
280
|
-
return this._animatableCurrentStyle;
|
281
|
-
},
|
282
|
-
|
283
|
-
/**
|
284
|
-
Resets animation, stopping all existing animations.
|
285
|
-
*/
|
286
|
-
resetAnimation: function() {
|
287
|
-
this._animatableCurrentStyle = null;
|
288
|
-
this._stopJavaScriptAnimations();
|
289
|
-
this.disableAnimation();
|
290
|
-
this.updateStyle();
|
291
|
-
this.enableAnimation();
|
292
|
-
this.updateStyle();
|
293
|
-
},
|
294
|
-
|
295
|
-
/**
|
296
|
-
Stops all JavaScript animations on the object. In their tracks. Hah hah.
|
297
|
-
@private
|
298
|
-
*/
|
299
|
-
_stopJavaScriptAnimations: function() {
|
300
|
-
for (var i in this._animators) {
|
301
|
-
if (this._animators[i] && this._animators[i].isQueued) {
|
302
|
-
SC.Animatable.removeTimer(this._animators[i]);
|
303
|
-
}
|
304
|
-
}
|
305
|
-
},
|
306
|
-
|
307
|
-
_getStartStyleHash: function(start, target)
|
308
|
-
{
|
309
|
-
// temporarily set layout to "start", in the fastest way possible;
|
310
|
-
// note that start is an entire style structure—get("frame") doesn't care! HAH!
|
311
|
-
var original_layout = this.layout;
|
312
|
-
this.layout = start;
|
313
|
-
|
314
|
-
// get our frame and parent's frame
|
315
|
-
var p = this.computeParentDimensions();
|
316
|
-
var f = this.computeFrameWithParentFrame(p);
|
317
|
-
|
318
|
-
// set back to target
|
319
|
-
this.layout = original_layout;
|
320
|
-
|
321
|
-
// prepare a new style set, empty.
|
322
|
-
var l = {};
|
323
|
-
|
324
|
-
// loop through properties in target
|
325
|
-
for (var i in target)
|
326
|
-
{
|
327
|
-
if (f)
|
328
|
-
{
|
329
|
-
if (i == "left") { l[i] = f.x; continue; }
|
330
|
-
else if (i == "top") { l[i] = f.y; continue; }
|
331
|
-
else if (i == "right") { l[i] = p.width - f.x - f.width; continue; }
|
332
|
-
else if (i == "bottom") { l[i] = p.height - f.y - f.height; continue; }
|
333
|
-
else if (i == "width") { l[i] = f.width; continue; }
|
334
|
-
else if (i == "height") { l[i] = f.height; continue; }
|
335
|
-
else if (i == "centerX") { l[i] = f.x + (f.width / 2) - (p.width / 2); continue; }
|
336
|
-
else if (i == "centerY") { l[i] = f.y + (f.height / 2) - (p.height / 2); continue; }
|
337
|
-
}
|
338
|
-
|
339
|
-
if (SC.none(l[i])) {
|
340
|
-
if (!SC.none(start[i])) l[i] = start[i];
|
341
|
-
else l[i] = target[i];
|
342
|
-
}
|
343
|
-
}
|
344
|
-
return l;
|
345
|
-
},
|
346
|
-
|
347
|
-
_TMP_CSS_TRANSITIONS: [],
|
348
|
-
|
349
|
-
/**
|
350
|
-
@private
|
351
|
-
Returns a string with CSS for the timing portion of a transition.
|
352
|
-
*/
|
353
|
-
cssTimingStringFor: function(transition) {
|
354
|
-
var timing_function = "linear";
|
355
|
-
if (transition.timing || SC.Animatable.defaultTimingFunction) {
|
356
|
-
var timing = transition.timing || SC.Animatable.defaultTimingFunction;
|
357
|
-
if (SC.typeOf(timing) != SC.T_STRING) {
|
358
|
-
timing_function = "cubic-bezier(" + timing[0] + ", " + timing[1] + ", " + timing[2] + ", " + timing[3] + ")";
|
359
|
-
} else {
|
360
|
-
timing_function = timing;
|
361
|
-
}
|
362
|
-
}
|
363
|
-
return timing_function;
|
364
|
-
},
|
365
|
-
|
366
|
-
/**
|
367
|
-
@private
|
368
|
-
Triggers updateStyle at end of run loop.
|
369
|
-
*/
|
370
|
-
styleDidChange: function() {
|
371
|
-
this.invokeLast("updateStyle");
|
372
|
-
}, // observer set up manually in initMixin to allow live mixins
|
373
|
-
|
374
|
-
|
375
|
-
/**
|
376
|
-
Since transforms can only be animated singly, we don't accelerate the layer unless
|
377
|
-
top and left transitions have the same duration.
|
378
|
-
Not cacheable since transitions may be updated without using a setter.
|
379
|
-
*/
|
380
|
-
_animatable_hasAcceleratedLayer: function(){
|
381
|
-
var leftDuration = this.transitions['left'] && this.transitions['left'].duration,
|
382
|
-
topDuration = this.transitions['top'] && this.transitions['top'].duration;
|
383
|
-
|
384
|
-
if (leftDuration !== topDuration) {
|
385
|
-
return NO;
|
386
|
-
} else if ((topDuration || leftDuration) && !SC.platform.supportsCSSTransitions) {
|
387
|
-
return NO;
|
388
|
-
} else {
|
389
|
-
return this._animatable_original_hasAcceleratedLayer();
|
390
|
-
}
|
391
|
-
}.property('wantsAcceleratedLayer', 'transitions'),
|
392
|
-
|
393
|
-
/**
|
394
|
-
Immediately applies styles to elements, and starts any needed transitions.
|
395
|
-
|
396
|
-
Called automatically when style changes, but if you need styles to be adjusted
|
397
|
-
immediately (for instance, if you have temporarily disabled animation to set a
|
398
|
-
start state), you may want to call manually too.
|
399
|
-
*/
|
400
|
-
updateStyle: function()
|
401
|
-
{
|
402
|
-
// get the layer. We need it for a great many things.
|
403
|
-
var layer = this.get("layer");
|
404
|
-
|
405
|
-
// cont. with other stuff
|
406
|
-
var newStyle = this.get("style");
|
407
|
-
|
408
|
-
/* SPECIAL CASES (done now because they need to happen whether or not animation will take place) */
|
409
|
-
////**SPECIAL TRANSFORM CASE**////
|
410
|
-
var specialTransform = NO, specialTransformValue = "";
|
411
|
-
if (this.get('hasAcceleratedLayer')) {
|
412
|
-
|
413
|
-
var nT = newStyle['top'],
|
414
|
-
nB = newStyle['bottom'],
|
415
|
-
nH = newStyle['height'],
|
416
|
-
nL = newStyle['left'],
|
417
|
-
nR = newStyle['right'],
|
418
|
-
nW = newStyle['width'];
|
419
|
-
|
420
|
-
// NOTE: This needs to match exactly the conditions in layoutStyles
|
421
|
-
if (
|
422
|
-
(SC.empty(nT) || (!SC.isPercentage(nT) && !SC.empty(nH))) &&
|
423
|
-
(SC.empty(nL) || (!SC.isPercentage(nL) && !SC.empty(nW))) &&
|
424
|
-
(this.transitions && (this.transitions['top'] || this.transitions['left']))
|
425
|
-
) {
|
426
|
-
specialTransform = YES;
|
427
|
-
this._useSpecialCaseTransform = YES;
|
428
|
-
} else {
|
429
|
-
this._useSpecialCaseTransform = NO;
|
430
|
-
}
|
431
|
-
}
|
432
|
-
////**/SPECIAL TRANSFORM CASE**////
|
433
|
-
|
434
|
-
// make sure there _is_ a previous style to animate from. Otherwise,
|
435
|
-
// we don't animate—and this is sometimes used to temporarily disable animation.
|
436
|
-
var i;
|
437
|
-
if (!this._animatableCurrentStyle || this._disableAnimation > 0 || !layer)
|
438
|
-
{
|
439
|
-
// clone it to be a nice starting point next time.
|
440
|
-
this._animatableSetCSS = "";
|
441
|
-
this._animatableCurrentStyle = {};
|
442
|
-
for (i in newStyle)
|
443
|
-
{
|
444
|
-
if (i[0] != "_") this._animatableCurrentStyle[i] = newStyle[i];
|
445
|
-
}
|
446
|
-
|
447
|
-
if (layer) this._animatableApplyStyles(layer, newStyle);
|
448
|
-
return this;
|
449
|
-
}
|
450
|
-
|
451
|
-
// no use doing anything else if no layer.
|
452
|
-
if (!layer) return;
|
453
|
-
|
454
|
-
// get a normalized starting point based off of our style
|
455
|
-
var startingPoint = this._getStartStyleHash(this._animatableCurrentStyle, newStyle);
|
456
|
-
var endingPoint = {};
|
457
|
-
|
458
|
-
// prepare stuff for timing function calc
|
459
|
-
var timing;
|
460
|
-
|
461
|
-
// also prepare an array of CSS transitions to set up. Do this always so we get (and keep) all transitions.
|
462
|
-
var cssTransitions = this._TMP_CSS_TRANSITIONS;
|
463
|
-
if (SC.platform.supportsCSSTransitions) {
|
464
|
-
// first, handle special cases
|
465
|
-
var timing_function;
|
466
|
-
|
467
|
-
////**SPECIAL TRANSFORM CASE**////
|
468
|
-
// this is a VERY special case. If right or bottom are supplied, can't do it. If left+top need
|
469
|
-
// animation at different speeds: can't do it.
|
470
|
-
if (specialTransform) {
|
471
|
-
var transitionForTiming = this.transitions['left'] || this.transitions['top'];
|
472
|
-
timing_function = this.cssTimingStringFor(transitionForTiming);
|
473
|
-
cssTransitions.push("-"+SC.platform.cssPrefix+"-transform " + transitionForTiming.duration + "s " + timing_function);
|
474
|
-
}
|
475
|
-
////**END SPECIAL TRANSFORM CASE**////
|
476
|
-
|
477
|
-
// loop
|
478
|
-
for (i in this.transitions) {
|
479
|
-
if (!this._cssTransitionFor[i]) continue;
|
480
|
-
|
481
|
-
////**SPECIAL TRANSFORM CASE**////
|
482
|
-
if (specialTransform && (i == "left" || i == "top")) {
|
483
|
-
if (this.transitions["left"].action){
|
484
|
-
this._transitionCallbacks["-"+SC.platform.cssPrefix+"-transform"] = {
|
485
|
-
source: this,
|
486
|
-
target: (this.transitions["left"].target || this),
|
487
|
-
action: this.transitions["left"].action
|
488
|
-
};
|
489
|
-
}
|
490
|
-
|
491
|
-
if (this.transitions["top"].action){
|
492
|
-
this._transitionCallbacks["-"+SC.platform.cssPrefix+"-transform"] = {
|
493
|
-
source: this,
|
494
|
-
target: (this.transitions["top"].target || this),
|
495
|
-
action: this.transitions["top"].action
|
496
|
-
};
|
497
|
-
}
|
498
|
-
continue;
|
499
|
-
}
|
500
|
-
////**END SPECIAL TRANSFORM CASE**////
|
501
|
-
|
502
|
-
// get timing function
|
503
|
-
timing_function = this.cssTimingStringFor(this.transitions[i]);
|
504
|
-
|
505
|
-
// sanitize name
|
506
|
-
cssTransitions.push(this._cssTransitionFor[i] + " " + this.transitions[i].duration + "s " + timing_function);
|
507
|
-
}
|
508
|
-
}
|
509
|
-
|
510
|
-
for (i in newStyle)
|
511
|
-
{
|
512
|
-
if (i[0] == "_") continue; // guid (or something else we can't deal with anyway)
|
513
|
-
|
514
|
-
|
515
|
-
// if it needs to be set right away since it is not animatable, _getStartStyleHash
|
516
|
-
// will have done that. But if we aren't supposed to animate it, we need to know, now.
|
517
|
-
var shouldSetImmediately = !this.transitions[i] || newStyle[i] == startingPoint[i];
|
518
|
-
if (i == "display" && newStyle[i] != "none") shouldSetImmediately = true;
|
519
|
-
|
520
|
-
if (shouldSetImmediately)
|
521
|
-
{
|
522
|
-
// set
|
523
|
-
startingPoint[i] = newStyle[i];
|
524
|
-
|
525
|
-
// you can't easily stop the animator. So just set its endpoint and make it end soon.
|
526
|
-
var animator = this._animators[i];
|
527
|
-
if (animator)
|
528
|
-
{
|
529
|
-
animator.endValue = newStyle[i];
|
530
|
-
animator.end = 0;
|
531
|
-
}
|
532
|
-
continue;
|
533
|
-
}
|
534
|
-
|
535
|
-
// If there is an available CSS transition, use that.
|
536
|
-
if (SC.platform.supportsCSSTransitions && this._cssTransitionFor[i])
|
537
|
-
{
|
538
|
-
// the transition is already set up.
|
539
|
-
// we can just set it as part of the starting point
|
540
|
-
endingPoint[i] = newStyle[i];
|
541
|
-
|
542
|
-
if (this.transitions[i].action){
|
543
|
-
this._transitionCallbacks[this._cssTransitionFor[i]] = {
|
544
|
-
source: this,
|
545
|
-
target: (this.transitions[i].target || this),
|
546
|
-
action: this.transitions[i].action
|
547
|
-
};
|
548
|
-
}
|
549
|
-
|
550
|
-
continue;
|
551
|
-
}
|
552
|
-
|
553
|
-
// well well well... looks like we need to animate. Prepare an animation structure.
|
554
|
-
// (WHY ARE WE ALWAYS PREPARING?)
|
555
|
-
var applier = this._animateTickPixel,
|
556
|
-
property = i,
|
557
|
-
startValue = startingPoint[i],
|
558
|
-
endValue = newStyle[i];
|
559
|
-
|
560
|
-
// special property stuff
|
561
|
-
if (property == "centerX" || property == "centerY")
|
562
|
-
{
|
563
|
-
// uh... need a special applier; it needs to update currentlayout differently than actual
|
564
|
-
// layout, since one gets "layout," and the other gets styles.
|
565
|
-
applier = this._animateTickCenter;
|
566
|
-
}
|
567
|
-
else if (property == "opacity")
|
568
|
-
{
|
569
|
-
applier = this._animateTickNumber;
|
570
|
-
}
|
571
|
-
else if (property == "display")
|
572
|
-
{
|
573
|
-
applier = this._animateTickDisplay;
|
574
|
-
}
|
575
|
-
|
576
|
-
// cache animator objects, not for memory, but so we can modify them.
|
577
|
-
if (!this._animators[i]) this._animators[i] = {};
|
578
|
-
|
579
|
-
// used to mixin a struct. But I think that would create a new struct.
|
580
|
-
// also, why waste cycles on a SC.mixin()? So I go the direct approach.
|
581
|
-
var a = this._animators[i];
|
582
|
-
|
583
|
-
// set settings...
|
584
|
-
// start: Date.now(), // you could put this here. But it is better to wait. The animation is smoother
|
585
|
-
// if its beginning time is whenever the first frame fires.
|
586
|
-
// otherwise, if there is a big delay before the first frame (perhaps we are animating other elements)
|
587
|
-
// the items will "jump" unattractively
|
588
|
-
a.start = null;
|
589
|
-
a.duration = Math.floor(this.transitions[i].duration * 1000);
|
590
|
-
a.startValue = startValue;
|
591
|
-
a.endValue = endValue;
|
592
|
-
a.layer = layer;
|
593
|
-
a.property = property;
|
594
|
-
a.action = applier;
|
595
|
-
a.style = layer.style;
|
596
|
-
a.holder = this;
|
597
|
-
|
598
|
-
if (this.transitions[i].action){
|
599
|
-
a.callback = {
|
600
|
-
source: this,
|
601
|
-
target: (this.transitions[i].target || this),
|
602
|
-
action: this.transitions[i].action
|
603
|
-
};
|
604
|
-
}
|
605
|
-
|
606
|
-
timing = this.transitions[i].timing || SC.Animatable.defaultTimingFunction;
|
607
|
-
if (timing && SC.typeOf(timing) != SC.T_STRING) a.timingFunction = timing;
|
608
|
-
|
609
|
-
// add timer
|
610
|
-
if (!a.going) this._animationsToStart[i] = a;
|
611
|
-
}
|
612
|
-
|
613
|
-
// start animations, in order
|
614
|
-
var ao = this._animationOrder, l = this._animationOrder.length;
|
615
|
-
for (i = 0; i < l; i++)
|
616
|
-
{
|
617
|
-
var nextAnimation = ao[i];
|
618
|
-
if (this._animationsToStart[nextAnimation])
|
619
|
-
{
|
620
|
-
SC.Animatable.addTimer(this._animationsToStart[nextAnimation]);
|
621
|
-
delete this._animationsToStart[nextAnimation];
|
622
|
-
}
|
623
|
-
}
|
624
|
-
|
625
|
-
// and update layout to the normalized start.
|
626
|
-
var css = cssTransitions.join(",");
|
627
|
-
cssTransitions.length = "";
|
628
|
-
this._animatableSetCSS = css;
|
629
|
-
|
630
|
-
// apply starting styles directly to layer
|
631
|
-
this._animatableApplyStyles(layer, startingPoint, endingPoint);
|
632
|
-
|
633
|
-
// all our timers are scheduled, we should be good to go. YAY.
|
634
|
-
return this;
|
635
|
-
|
636
|
-
},
|
637
|
-
|
638
|
-
/**
|
639
|
-
@private
|
640
|
-
Adjusts display and queues a change for the other properties.
|
641
|
-
|
642
|
-
layer: the layer to modify
|
643
|
-
styles: the styles to set
|
644
|
-
delayed: styles to set after a brief delay (if any)
|
645
|
-
*/
|
646
|
-
_animatableApplyStyles: function(layer, styles, delayed)
|
647
|
-
{
|
648
|
-
if (!layer) return;
|
649
|
-
|
650
|
-
// handle a specific style first: display. There is a special case because it disrupts transitions.
|
651
|
-
var needsRender = NO;
|
652
|
-
if (styles["display"] && layer.style["display"] !== styles["display"]) {
|
653
|
-
layer.style["display"] = styles["display"];
|
654
|
-
needsRender = YES;
|
655
|
-
}
|
656
|
-
|
657
|
-
// set CSS transitions very first thing
|
658
|
-
if (this._animatableSetCSS != this._last_transition_css) {
|
659
|
-
layer.style[SC.platform.domCSSPrefix+"Transition"] = this._animatableSetCSS;
|
660
|
-
this._last_transition_css = this._animatableSetCSS;
|
661
|
-
needsRender = YES;
|
662
|
-
}
|
663
|
-
|
664
|
-
if (!this._animators["display-styles"]) this._animators["display-styles"] = {};
|
665
|
-
|
666
|
-
// get timer
|
667
|
-
var timer = this._animators["display-styles"];
|
668
|
-
|
669
|
-
// set settings
|
670
|
-
timer.holder = this;
|
671
|
-
timer.action = this._animatableApplyNonDisplayStylesFromTimer;
|
672
|
-
timer.inLoopAction = this._animatableApplyNonDisplayStyles;
|
673
|
-
timer.layer = layer;
|
674
|
-
timer.styles = styles;
|
675
|
-
timer.delayed = delayed;
|
676
|
-
this._animatableCurrentStyle = styles;
|
677
|
-
|
678
|
-
// schedule.
|
679
|
-
if (this._disableAnimation > 0 || !needsRender) {
|
680
|
-
timer.inLoopAction();
|
681
|
-
} else {
|
682
|
-
// after setting transition or display, we must wait a moment;
|
683
|
-
// otherwise, no animation will happen.
|
684
|
-
SC.Animatable.addTimer(timer);
|
685
|
-
}
|
686
|
-
},
|
687
|
-
|
688
|
-
_animatableApplyNonDisplayStylesFromTimer: function() {
|
689
|
-
SC.run(function() {
|
690
|
-
this.inLoopAction();
|
691
|
-
}, this);
|
692
|
-
},
|
693
|
-
|
694
|
-
_animatableApplyNonDisplayStyles: function(){
|
695
|
-
var layer = this.layer, styles = this.holder._animatableCurrentStyle; // this == timer
|
696
|
-
var styleHelpers = {
|
697
|
-
// more to be added here...
|
698
|
-
};
|
699
|
-
|
700
|
-
var newLayout = {}, updateLayout = NO, style = layer.style;
|
701
|
-
|
702
|
-
// we extract the layout portion so SproutCore can do its own thing...
|
703
|
-
var transform = "";
|
704
|
-
for (var i in styles)
|
705
|
-
{
|
706
|
-
if (i == "display") continue;
|
707
|
-
if (this.holder._layoutStyles.indexOf(i) >= 0)
|
708
|
-
{
|
709
|
-
// otherwise, normal layout
|
710
|
-
newLayout[i] = styles[i];
|
711
|
-
updateLayout = YES;
|
712
|
-
continue;
|
713
|
-
}
|
714
|
-
else if (i == "transform") transform += " " + styles[i];
|
715
|
-
else if (styleHelpers[i]) styleHelpers[i](style, i, styles);
|
716
|
-
else style[i] = styles[i];
|
717
|
-
}
|
718
|
-
|
719
|
-
// apply transform
|
720
|
-
if (!SC.empty(transform)) style[SC.platform.cssPrefix+"Transform"] = transform;
|
721
|
-
|
722
|
-
// don't want to set because we don't want updateLayout... again.
|
723
|
-
if (updateLayout) {
|
724
|
-
var prev = this.holder.layout;
|
725
|
-
this.holder.layout = newLayout;
|
726
|
-
|
727
|
-
// set layout
|
728
|
-
this.holder.notifyPropertyChange("layoutStyle");
|
729
|
-
|
730
|
-
// apply the styles (but we have to mix it in, because we still have transitions, etc. that we set)
|
731
|
-
var ls = this.holder.get("layoutStyle");
|
732
|
-
for (var key in ls) {
|
733
|
-
if (SC.none(ls[key])) style[key] = ""; // because IE is stupid and can't handle delete or null
|
734
|
-
else if (style[key] != ls[key]) style[key] = ls[key];
|
735
|
-
}
|
736
|
-
|
737
|
-
// go back to previous
|
738
|
-
this.holder.layout = prev;
|
739
|
-
}
|
740
|
-
|
741
|
-
// queue up any delayed styles
|
742
|
-
if (this.delayed) {
|
743
|
-
// set settings
|
744
|
-
SC.mixin(this.holder._animatableCurrentStyle, this.delayed);
|
745
|
-
this.styles = this.delayed;
|
746
|
-
this.delayed = undefined;
|
747
|
-
|
748
|
-
// schedule.
|
749
|
-
if (this._disableAnimation > 0) {
|
750
|
-
this.inLoopAction();
|
751
|
-
} else {
|
752
|
-
// after setting transition or display, we must wait a moment;
|
753
|
-
// otherwise, no animation will happen.
|
754
|
-
SC.Animatable.addTimer(this);
|
755
|
-
}
|
756
|
-
}
|
757
|
-
},
|
758
|
-
|
759
|
-
/**
|
760
|
-
Overridden to support animation.
|
761
|
-
|
762
|
-
Works by copying the styles to the object's "style" property.
|
763
|
-
*/
|
764
|
-
updateLayout: function(context, firstTime)
|
765
|
-
{
|
766
|
-
var style = SC.clone(this.get("style"));
|
767
|
-
var newLayout = this.get("layout");
|
768
|
-
var i = 0, ls = this._layoutStyles, lsl = ls.length, didChange = NO;
|
769
|
-
for (i = 0; i < lsl; i++)
|
770
|
-
{
|
771
|
-
var key = ls[i];
|
772
|
-
if (style[key] !== newLayout[key])
|
773
|
-
{
|
774
|
-
if (SC.none(newLayout[key])) style[key] = undefined; // because IE is stupid and can't handle delete or debug.
|
775
|
-
else style[key] = newLayout[key];
|
776
|
-
didChange = YES;
|
777
|
-
}
|
778
|
-
}
|
779
|
-
|
780
|
-
if (didChange) {
|
781
|
-
this.style = style;
|
782
|
-
this.updateStyle(); // updateLayout is already called late, so why delay longer?
|
783
|
-
}
|
784
|
-
|
785
|
-
return this;
|
786
|
-
},
|
787
|
-
|
788
|
-
/**
|
789
|
-
@private
|
790
|
-
Solves cubic bezier curves. Basically, returns the Y for the supplied X.
|
791
|
-
|
792
|
-
I have only a vague idea of how this works. But I do have a vague idea. It is originally
|
793
|
-
from WebKit's source code:
|
794
|
-
http://trac.webkit.org/browser/trunk/WebCore/platform/graphics/UnitBezier.h?rev=31808
|
795
|
-
*/
|
796
|
-
_solveBezierForT: function(ax, ay, bx, by, cx, cy, x, duration) {
|
797
|
-
// determines accuracy. Which means animation is slower for longer duration animations.
|
798
|
-
// that seems ironic, for some reason, but I don't know why.
|
799
|
-
|
800
|
-
// SOME OPTIMIZATIONS COULD BE DONE, LIKE MOVING THIS INTO ITS OWN BIT AT BEGINNING OF ANIMATION.
|
801
|
-
var epsilon = 1.0 / (200.0 * duration);
|
802
|
-
|
803
|
-
// a method I have NO idea about... Newton's method
|
804
|
-
var t0, t1, t2, x2, d2, i;
|
805
|
-
for (t2 = x, i = 0; i < 8; i++) {
|
806
|
-
x2 = ((ax * t2 + bx) * t2 + cx) * t2 - x; // sample curve x for t2, - x
|
807
|
-
if (Math.abs(x2) < epsilon) return t2; // obviously, this is determining the accuracy
|
808
|
-
d2 = (3.0 * ax * t2 + 2.0 * bx) * t2 + cx;
|
809
|
-
if (Math.abs(d2) < Math.pow(10, -6)) break;
|
810
|
-
t2 = t2 - x2 / d2;
|
811
|
-
}
|
812
|
-
|
813
|
-
// fall back to bisection
|
814
|
-
t0 = 0.0;
|
815
|
-
t1 = 1.0;
|
816
|
-
t2 = x;
|
817
|
-
if (t2 < t0) return t0;
|
818
|
-
if (t2 > t1) return t1;
|
819
|
-
while (t0 < t1) {
|
820
|
-
x2 = ((ax * t2 + bx) * t2 + cx) * t2;
|
821
|
-
if (Math.abs(x2 - x) < epsilon) return t2;
|
822
|
-
|
823
|
-
if (x > x2) t0 = t2;
|
824
|
-
else t1 = t2;
|
825
|
-
|
826
|
-
t2 = (t1 - t0) * 0.5 + t0;
|
827
|
-
}
|
828
|
-
|
829
|
-
return t2; // on failure
|
830
|
-
},
|
831
|
-
|
832
|
-
_solveBezier: function(p1x, p1y, p2x, p2y, x, duration) {
|
833
|
-
// calculate coefficients
|
834
|
-
var cx = 3.0 * p1x;
|
835
|
-
var bx = 3.0 * (p2x - p1x) - cx;
|
836
|
-
var ax = 1.0 - cx - bx;
|
837
|
-
|
838
|
-
var cy = 3.0 * p1y;
|
839
|
-
var by = 3.0 * (p2y - p1y) - cy;
|
840
|
-
var ay = 1.0 - cy - by;
|
841
|
-
|
842
|
-
var t = this._solveBezierForT(ax, ay, bx, by, cx, cy, x, duration);
|
843
|
-
|
844
|
-
// now calculate Y
|
845
|
-
return ((ay * t + by) * t + cy) * t;
|
846
|
-
},
|
847
|
-
|
848
|
-
/**
|
849
|
-
@private
|
850
|
-
Manages a single step in a single animation.
|
851
|
-
NOTE: this=>an animator hash
|
852
|
-
*/
|
853
|
-
_animateTickPixel: function(t)
|
854
|
-
{
|
855
|
-
// prepare timing stuff
|
856
|
-
// first, setup this.start if needed (it is lazy, after all)
|
857
|
-
if (SC.none(this.start))
|
858
|
-
{
|
859
|
-
this.start = t;
|
860
|
-
this.end = this.start + this.duration;
|
861
|
-
}
|
862
|
-
|
863
|
-
// the differences
|
864
|
-
var s = this.start, e = this.end;
|
865
|
-
var sv = this.startValue, ev = this.endValue;
|
866
|
-
var d = e - s;
|
867
|
-
var dv = ev - sv;
|
868
|
-
|
869
|
-
// get current percent of animation completed
|
870
|
-
var c = t - s;
|
871
|
-
var percent = Math.min(c / d, 1);
|
872
|
-
|
873
|
-
// call interpolator (if any)
|
874
|
-
if (this.timingFunction) {
|
875
|
-
// this may be slow, but...
|
876
|
-
var timing = this.timingFunction;
|
877
|
-
percent = this.holder._solveBezier(timing[0], timing[1], timing[2], timing[3], percent, d);
|
878
|
-
}
|
879
|
-
|
880
|
-
// calculate new position
|
881
|
-
var value = Math.floor(sv + (dv * percent));
|
882
|
-
this.holder._animatableCurrentStyle[this.property] = value;
|
883
|
-
|
884
|
-
// note: the following tested faster than directly setting this.layer.style.cssText
|
885
|
-
this.style[this.property] = value + "px";
|
886
|
-
|
887
|
-
if (t < e) SC.Animatable.addTimer(this);
|
888
|
-
else {
|
889
|
-
this.going = false;
|
890
|
-
if(this.callback) SC.Animatable.runCallback(this.callback);
|
891
|
-
this.styles = null;
|
892
|
-
this.layer = null;
|
893
|
-
}
|
894
|
-
},
|
895
|
-
|
896
|
-
_animateTickDisplay: function(t)
|
897
|
-
{
|
898
|
-
// prepare timing stuff
|
899
|
-
// first, setup this.start if needed (it is lazy, after all)
|
900
|
-
if (SC.none(this.start))
|
901
|
-
{
|
902
|
-
this.start = t;
|
903
|
-
this.end = this.start + this.duration;
|
904
|
-
}
|
905
|
-
|
906
|
-
// check if we should keep going (we only set display none, and only at end)
|
907
|
-
var e = this.end;
|
908
|
-
if (t < e)
|
909
|
-
{
|
910
|
-
SC.Animatable.addTimer(this);
|
911
|
-
return;
|
912
|
-
}
|
913
|
-
|
914
|
-
this.holder._animatableCurrentStyle[this.property] = this.endValue;
|
915
|
-
this.style[this.property] = this.endValue;
|
916
|
-
|
917
|
-
this.going = false;
|
918
|
-
if(this.callback) SC.Animatable.runCallback(this.callback);
|
919
|
-
this.styles = null;
|
920
|
-
this.layer = null;
|
921
|
-
},
|
922
|
-
|
923
|
-
/**
|
924
|
-
@private
|
925
|
-
Manages a single step in a single animation.
|
926
|
-
NOTE: this=>an animator hash
|
927
|
-
*/
|
928
|
-
_animateTickNumber: function(t)
|
929
|
-
{
|
930
|
-
// prepare timing stuff
|
931
|
-
// first, setup this.start if needed (it is lazy, after all)
|
932
|
-
if (SC.none(this.start))
|
933
|
-
{
|
934
|
-
this.start = t;
|
935
|
-
this.end = this.start + this.duration;
|
936
|
-
}
|
937
|
-
|
938
|
-
// the differences
|
939
|
-
var s = this.start, e = this.end;
|
940
|
-
var sv = this.startValue, ev = this.endValue;
|
941
|
-
var d = e - s;
|
942
|
-
var dv = ev - sv;
|
943
|
-
|
944
|
-
// get current percent of animation completed
|
945
|
-
var c = t - s;
|
946
|
-
var percent = Math.min(c / d, 1);
|
947
|
-
|
948
|
-
// call interpolator (if any)
|
949
|
-
if (this.timingFunction) {
|
950
|
-
// this may be slow, but...
|
951
|
-
var timing = this.timingFunction;
|
952
|
-
percent = this.holder._solveBezier(timing[0], timing[1], timing[2], timing[3], percent, d);
|
953
|
-
}
|
954
|
-
|
955
|
-
// calculate new position
|
956
|
-
var value = Math.round((sv + (dv * percent)) * 100) / 100;
|
957
|
-
this.holder._animatableCurrentStyle[this.property] = value;
|
958
|
-
|
959
|
-
// note: the following tested faster than directly setting this.layer.style.cssText
|
960
|
-
this.style[this.property] = value;
|
961
|
-
if (this.property == "opacity")
|
962
|
-
{
|
963
|
-
this.style["zoom"] = 1;
|
964
|
-
}
|
965
|
-
|
966
|
-
if (t < e) SC.Animatable.addTimer(this);
|
967
|
-
else {
|
968
|
-
this.going = false;
|
969
|
-
if(this.callback) SC.Animatable.runCallback(this.callback);
|
970
|
-
this.styles = null;
|
971
|
-
this.layer = null;
|
972
|
-
}
|
973
|
-
},
|
974
|
-
|
975
|
-
// NOTE: I tested this with two separate functions (one for each X and Y)
|
976
|
-
// no definite performance difference on Safari, at least.
|
977
|
-
_animateTickCenter: function(t)
|
978
|
-
{
|
979
|
-
// prepare timing stuff
|
980
|
-
// first, setup this.start if needed (it is lazy, after all)
|
981
|
-
if (SC.none(this.start))
|
982
|
-
{
|
983
|
-
this.start = t;
|
984
|
-
this.end = this.start + this.duration;
|
985
|
-
}
|
986
|
-
|
987
|
-
// the differences
|
988
|
-
var s = this.start, e = this.end;
|
989
|
-
var sv = this.startValue, ev = this.endValue;
|
990
|
-
var d = e - s;
|
991
|
-
var dv = ev - sv;
|
992
|
-
|
993
|
-
// get current percent of animation completed
|
994
|
-
var c = t - s;
|
995
|
-
var percent = Math.min(c / d, 1);
|
996
|
-
|
997
|
-
// call interpolator (if any)
|
998
|
-
if (this.timingFunction) {
|
999
|
-
// this may be slow, but...
|
1000
|
-
var timing = this.timingFunction;
|
1001
|
-
percent = this.holder._solveBezier(timing[0], timing[1], timing[2], timing[3], percent, d);
|
1002
|
-
}
|
1003
|
-
|
1004
|
-
// calculate new position
|
1005
|
-
var value = sv + (dv * percent);
|
1006
|
-
this.holder._animatableCurrentStyle[this.property] = value;
|
1007
|
-
|
1008
|
-
// calculate style, which needs to subtract half of width/height
|
1009
|
-
var widthOrHeight, style;
|
1010
|
-
if (this.property == "centerX")
|
1011
|
-
{
|
1012
|
-
widthOrHeight = "width"; style = "marginLeft";
|
1013
|
-
}
|
1014
|
-
else
|
1015
|
-
{
|
1016
|
-
widthOrHeight = "height"; style = "marginTop";
|
1017
|
-
}
|
1018
|
-
|
1019
|
-
this.style[style] = Math.round(value - (this.holder._animatableCurrentStyle[widthOrHeight] / 2)) + "px";
|
1020
|
-
|
1021
|
-
if (t < e) SC.Animatable.addTimer(this);
|
1022
|
-
else {
|
1023
|
-
this.going = false;
|
1024
|
-
if(this.callback) SC.Animatable.runCallback(this.callback);
|
1025
|
-
this.styles = null;
|
1026
|
-
this.layer = null;
|
1027
|
-
}
|
1028
|
-
}
|
1029
|
-
};
|
1030
|
-
|
1031
|
-
/*
|
1032
|
-
Add Singleton Portion
|
1033
|
-
*/
|
1034
|
-
SC.mixin(SC.Animatable, {
|
1035
|
-
/** @scope SC.Animatable */
|
1036
|
-
NAMESPACE: 'SC.Animatable',
|
1037
|
-
VERSION: '0.1.0',
|
1038
|
-
|
1039
|
-
/** Linear transition **/
|
1040
|
-
TRANSITION_NONE: "linear",
|
1041
|
-
|
1042
|
-
/** 'ease' transition if using CSS transitions; otherwise linear. **/
|
1043
|
-
TRANSITION_CSS_EASE: "ease",
|
1044
|
-
|
1045
|
-
/** 'ease-in' transition if using CSS transitions; otherwise linear. **/
|
1046
|
-
TRANSITION_CSS_EASE_IN: "ease-in",
|
1047
|
-
|
1048
|
-
/** 'ease-out' transition if using CSS transitions; otherwise linear. **/
|
1049
|
-
TRANSITION_CSS_EASE_OUT: "ease-out",
|
1050
|
-
|
1051
|
-
/** 'ease-in-out' transition if using CSS transitions; otherwise linear. **/
|
1052
|
-
TRANSITION_CSS_EASE_IN_OUT: "ease-in-out",
|
1053
|
-
|
1054
|
-
/** 'ease' transition. **/
|
1055
|
-
TRANSITION_EASE: [0.25, 0.1, 0.25, 1.0],
|
1056
|
-
|
1057
|
-
TRANSITION_LINEAR: [0.0, 0.0, 1.0, 1.0],
|
1058
|
-
|
1059
|
-
/** 'ease-in' transition. **/
|
1060
|
-
TRANSITION_EASE_IN: [0.42, 0.0, 1.0, 1.0],
|
1061
|
-
|
1062
|
-
/** 'ease-out' transition. **/
|
1063
|
-
TRANSITION_EASE_OUT: [0, 0, 0.58, 1.0],
|
1064
|
-
|
1065
|
-
/** 'ease-in-out' transition if using CSS transitions; otherwise linear. **/
|
1066
|
-
TRANSITION_EASE_IN_OUT: [0.42, 0, 0.58, 1.0],
|
1067
|
-
|
1068
|
-
/**
|
1069
|
-
The timing function which all SC.Animatables should default to.
|
1070
|
-
*/
|
1071
|
-
defaultTimingFunction: null, // you can change to TRANSITION_EASE, etc., but that may impact performance.
|
1072
|
-
|
1073
|
-
// For performance, use a custom linked-list timer
|
1074
|
-
baseTimer: {
|
1075
|
-
next: null
|
1076
|
-
},
|
1077
|
-
|
1078
|
-
// keep track of whether the timer is running
|
1079
|
-
going: false,
|
1080
|
-
|
1081
|
-
// ticks and tocs
|
1082
|
-
_ticks: 0,
|
1083
|
-
_timer_start_time: null,
|
1084
|
-
|
1085
|
-
// the global timer interval
|
1086
|
-
interval: 10,
|
1087
|
-
|
1088
|
-
// the current time (a placeholder, really)
|
1089
|
-
currentTime: new Date().getTime(),
|
1090
|
-
|
1091
|
-
/**
|
1092
|
-
A hash of stats for any currently running animations. Currently has property
|
1093
|
-
lastFPS, which is the FPS for the last JavaScript-based animation.
|
1094
|
-
*/
|
1095
|
-
stats: SC.Object.create({
|
1096
|
-
lastFPS: 0
|
1097
|
-
}),
|
1098
|
-
|
1099
|
-
/**
|
1100
|
-
Adds a timer.
|
1101
|
-
@private
|
1102
|
-
*/
|
1103
|
-
addTimer: function(animator) {
|
1104
|
-
if (animator.isQueued) return;
|
1105
|
-
animator.prev = SC.Animatable.baseTimer;
|
1106
|
-
animator.next = SC.Animatable.baseTimer.next;
|
1107
|
-
if (SC.Animatable.baseTimer.next) SC.Animatable.baseTimer.next.prev = animator; // adjust next prev.
|
1108
|
-
SC.Animatable.baseTimer.next = animator; // switcheroo.
|
1109
|
-
animator.isQueued = true;
|
1110
|
-
if (!SC.Animatable.going) SC.Animatable.start();
|
1111
|
-
},
|
1112
|
-
|
1113
|
-
/**
|
1114
|
-
Removes a timer.
|
1115
|
-
@private
|
1116
|
-
*/
|
1117
|
-
removeTimer: function(animator) {
|
1118
|
-
if (!animator.isQueued) return;
|
1119
|
-
if (animator.next) animator.next.prev = animator.prev; // splice ;)
|
1120
|
-
animator.prev.next = animator.next; // it should always have a prev.
|
1121
|
-
animator.isQueued = false;
|
1122
|
-
},
|
1123
|
-
|
1124
|
-
start: function()
|
1125
|
-
{
|
1126
|
-
SC.Animatable._ticks = 0;
|
1127
|
-
SC.Animatable._timer_start_time = new Date().getTime();
|
1128
|
-
SC.Animatable.going = true;
|
1129
|
-
|
1130
|
-
// set a timeout so tick only runs AFTER any pending animation timers are set.
|
1131
|
-
setTimeout(function(){ SC.Animatable.timeout(); }, SC.Animatable.interval);
|
1132
|
-
},
|
1133
|
-
|
1134
|
-
timeout: function()
|
1135
|
-
{
|
1136
|
-
SC.Animatable.currentTime = new Date().getTime();
|
1137
|
-
var start = SC.Animatable.currentTime;
|
1138
|
-
|
1139
|
-
var next = SC.Animatable.baseTimer.next;
|
1140
|
-
SC.Animatable.baseTimer.next = null;
|
1141
|
-
var i = 0;
|
1142
|
-
while (next)
|
1143
|
-
{
|
1144
|
-
var t = next.next;
|
1145
|
-
next.isQueued = false;
|
1146
|
-
next.next = null;
|
1147
|
-
next.prev = null;
|
1148
|
-
next.action.call(next, start);
|
1149
|
-
next = t;
|
1150
|
-
i++;
|
1151
|
-
}
|
1152
|
-
|
1153
|
-
// built-in FPS counter, so that FPS is only counted DURING animation.
|
1154
|
-
// is there a way to make the minifier get rid of this? Because that would be lovely.
|
1155
|
-
// still, only called once per frame, so should _very_ minimally impact performance and memory.
|
1156
|
-
if (SC.Animatable._ticks < 1000000) SC.Animatable._ticks++; // okay, put _some_ limit on it
|
1157
|
-
|
1158
|
-
// now see about doing next bit...
|
1159
|
-
var end = new Date().getTime();
|
1160
|
-
var elapsed = end - start;
|
1161
|
-
if (SC.Animatable.baseTimer.next)
|
1162
|
-
{
|
1163
|
-
setTimeout(function(){ SC.Animatable.timeout(); }, Math.max(0, SC.Animatable.interval - elapsed));
|
1164
|
-
}
|
1165
|
-
else
|
1166
|
-
{
|
1167
|
-
// we're done... so calculate FPS
|
1168
|
-
SC.Animatable.going = false;
|
1169
|
-
|
1170
|
-
// get diff
|
1171
|
-
var time_diff = end - SC.Animatable._timer_start_time;
|
1172
|
-
SC.run(function() {
|
1173
|
-
SC.Animatable.stats.set("lastFPS", SC.Animatable._ticks / (time_diff / 1000));
|
1174
|
-
});
|
1175
|
-
}
|
1176
|
-
},
|
1177
|
-
|
1178
|
-
runCallback: function(callback){
|
1179
|
-
var typeOfAction = SC.typeOf(callback.action);
|
1180
|
-
|
1181
|
-
// if the action is a function, just try to call it.
|
1182
|
-
if (typeOfAction == SC.T_FUNCTION) {
|
1183
|
-
callback.action.call(callback.target, callback.source);
|
1184
|
-
|
1185
|
-
// otherwise, action should be a string. If it has a period, treat it
|
1186
|
-
// like a property path.
|
1187
|
-
} else if (typeOfAction === SC.T_STRING) {
|
1188
|
-
if (callback.action.indexOf('.') >= 0) {
|
1189
|
-
var path = callback.action.split('.') ;
|
1190
|
-
var property = path.pop() ;
|
1191
|
-
|
1192
|
-
var target = SC.objectForPropertyPath(path, window) ;
|
1193
|
-
var action = target.get ? target.get(property) : target[property];
|
1194
|
-
if (action && SC.typeOf(action) == SC.T_FUNCTION) {
|
1195
|
-
action.call(target, callback.source);
|
1196
|
-
} else {
|
1197
|
-
throw 'SC.Animator could not find a function at %@'.fmt(callback.action) ;
|
1198
|
-
}
|
1199
|
-
|
1200
|
-
// otherwise, try to execute action direction on target or send down
|
1201
|
-
// responder chain.
|
1202
|
-
} else {
|
1203
|
-
SC.RootResponder.responder.sendAction(callback.action, callback.target, callback.source, callback.source.get("pane"), null, callback.source);
|
1204
|
-
}
|
1205
|
-
}
|
1206
|
-
}
|
1207
|
-
|
1208
|
-
});
|