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
@@ -13,8 +13,8 @@
|
|
13
13
|
Represents contextual information for whenever a state handles a triggered
|
14
14
|
route. In additional to retaining contextual information, you can also
|
15
15
|
use the object to retry trigging the state's route handler. Useful in cases
|
16
|
-
where you need to defer the handling of the route for a later time.
|
17
|
-
|
16
|
+
where you need to defer the handling of the route for a later time.
|
17
|
+
|
18
18
|
@see SC.State
|
19
19
|
|
20
20
|
@extends SC.Object
|
@@ -22,44 +22,44 @@
|
|
22
22
|
*/
|
23
23
|
SC.StateRouteHandlerContext = SC.Object.extend(
|
24
24
|
/** @scope SC.StateRouteContext.prototype */{
|
25
|
-
|
25
|
+
|
26
26
|
/**
|
27
27
|
The state that constructed this context object.
|
28
|
-
|
28
|
+
|
29
29
|
@property {SC.State}
|
30
30
|
*/
|
31
31
|
state: null,
|
32
|
-
|
32
|
+
|
33
33
|
/**
|
34
34
|
The location that caused the state's route to be
|
35
|
-
triggered.
|
36
|
-
|
37
|
-
@
|
35
|
+
triggered.
|
36
|
+
|
37
|
+
@type String
|
38
38
|
*/
|
39
39
|
location: null,
|
40
|
-
|
40
|
+
|
41
41
|
/**
|
42
42
|
The parameters that were supplied to the state's
|
43
43
|
handler when the state's route was triggered.
|
44
|
-
|
45
|
-
@
|
44
|
+
|
45
|
+
@type Hash
|
46
46
|
*/
|
47
47
|
params: null,
|
48
|
-
|
48
|
+
|
49
49
|
/**
|
50
50
|
The handler that got invoked when the state's
|
51
51
|
route was triggered. This can either be a reference
|
52
52
|
to the actual method or a name of the method.
|
53
|
-
|
53
|
+
|
54
54
|
@property {Function|String}
|
55
55
|
*/
|
56
56
|
handler: null,
|
57
|
-
|
57
|
+
|
58
58
|
/**
|
59
59
|
Used to retry invoking the state's handler for when
|
60
60
|
the state's route gets triggered. When called this will
|
61
|
-
essentially perform the same call as when the handler
|
62
|
-
was originally triggered on state.
|
61
|
+
essentially perform the same call as when the handler
|
62
|
+
was originally triggered on state.
|
63
63
|
*/
|
64
64
|
retry: function() {
|
65
65
|
var state = this.get('state'),
|
@@ -69,10 +69,10 @@ SC.StateRouteHandlerContext = SC.Object.extend(
|
|
69
69
|
if (SC.typeOf(handler) === SC.T_STRING) {
|
70
70
|
handler = state[handler];
|
71
71
|
}
|
72
|
-
|
72
|
+
|
73
73
|
if (SC.typeOf(handler) === SC.T_FUNCTION) {
|
74
74
|
handler.apply(state, [params]);
|
75
75
|
}
|
76
76
|
}
|
77
|
-
|
78
|
-
});
|
77
|
+
|
78
|
+
});
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
|
-
/*
|
8
|
+
/*global SC */
|
9
9
|
|
10
10
|
sc_require('system/state');
|
11
11
|
sc_require('mixins/statechart_delegate');
|
@@ -15,19 +15,19 @@ sc_require('mixins/statechart_delegate');
|
|
15
15
|
|
16
16
|
The startchart manager mixin allows an object to be a statechart. By becoming a statechart, the
|
17
17
|
object can then be manage a set of its own states.
|
18
|
-
|
19
|
-
This implementation of the statechart manager closely follows the concepts stated in D. Harel's
|
20
|
-
original paper "Statecharts: A Visual Formalism For Complex Systems"
|
21
|
-
(www.wisdom.weizmann.ac.il/~harel/papers/Statecharts.pdf).
|
22
|
-
|
23
|
-
The statechart allows for complex state heircharies by nesting states within states, and
|
18
|
+
|
19
|
+
This implementation of the statechart manager closely follows the concepts stated in D. Harel's
|
20
|
+
original paper "Statecharts: A Visual Formalism For Complex Systems"
|
21
|
+
(www.wisdom.weizmann.ac.il/~harel/papers/Statecharts.pdf).
|
22
|
+
|
23
|
+
The statechart allows for complex state heircharies by nesting states within states, and
|
24
24
|
allows for state orthogonality based on the use of concurrent states.
|
25
|
-
|
25
|
+
|
26
26
|
At minimum, a statechart must have one state: The root state. All other states in the statechart
|
27
27
|
are a decendents (substates) of the root state.
|
28
|
-
|
28
|
+
|
29
29
|
The following example shows how states are nested within a statechart:
|
30
|
-
|
30
|
+
|
31
31
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
32
32
|
rootState: SC.State.design({
|
33
33
|
initialSubstate: 'stateA',
|
@@ -35,41 +35,41 @@ sc_require('mixins/statechart_delegate');
|
|
35
35
|
stateA: SC.State.design({
|
36
36
|
// ... can continue to nest further states
|
37
37
|
}),
|
38
|
-
|
38
|
+
|
39
39
|
stateB: SC.State.design({
|
40
40
|
// ... can continue to nest further states
|
41
41
|
})
|
42
42
|
})
|
43
43
|
});
|
44
|
-
|
44
|
+
|
45
45
|
Note how in the example above, the root state as an explicit initial substate to enter into. If no
|
46
46
|
initial substate is provided, then the statechart will default to the the state's first substate.
|
47
|
-
|
47
|
+
|
48
48
|
You can also defined states without explicitly defining the root state. To do so, simply create properties
|
49
49
|
on your object that represents states. Upon initialization, a root state will be constructed automatically
|
50
50
|
by the mixin and make the states on the object substates of the root state. As an example:
|
51
|
-
|
51
|
+
|
52
52
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
53
53
|
initialState: 'stateA',
|
54
54
|
|
55
55
|
stateA: SC.State.design({
|
56
56
|
// ... can continue to nest further states
|
57
57
|
}),
|
58
|
-
|
58
|
+
|
59
59
|
stateB: SC.State.design({
|
60
60
|
// ... can continue to nest further states
|
61
61
|
})
|
62
62
|
});
|
63
|
-
|
63
|
+
|
64
64
|
If you liked to specify a class that should be used as the root state but using the above method to defined
|
65
|
-
states, you can set the rootStateExample property with a class that extends from SC.State. If the
|
65
|
+
states, you can set the rootStateExample property with a class that extends from SC.State. If the
|
66
66
|
rootStateExample property is not explicitly assigned the then default class used will be SC.State.
|
67
|
-
|
67
|
+
|
68
68
|
To provide your statechart with orthogonality, you use concurrent states. If you use concurrent states,
|
69
69
|
then your statechart will have multiple current states. That is because each concurrent state represents an
|
70
70
|
independent state structure from other concurrent states. The following example shows how to provide your
|
71
71
|
statechart with concurrent states:
|
72
|
-
|
72
|
+
|
73
73
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
74
74
|
rootState: SC.State.design({
|
75
75
|
substatesAreConcurrent: YES,
|
@@ -77,35 +77,35 @@ sc_require('mixins/statechart_delegate');
|
|
77
77
|
stateA: SC.State.design({
|
78
78
|
// ... can continue to nest further states
|
79
79
|
}),
|
80
|
-
|
80
|
+
|
81
81
|
stateB: SC.State.design({
|
82
82
|
// ... can continue to nest further states
|
83
83
|
})
|
84
84
|
})
|
85
85
|
});
|
86
|
-
|
87
|
-
Above, to indicate that a state's substates are concurrent, you just have to set the substatesAreConcurrent to
|
86
|
+
|
87
|
+
Above, to indicate that a state's substates are concurrent, you just have to set the substatesAreConcurrent to
|
88
88
|
YES. Once done, then stateA and stateB will be independent of each other and each will manage their
|
89
89
|
own current substates. The root state will then have more then one current substate.
|
90
|
-
|
91
|
-
To define concurrent states directly on the object without explicitly defining a root, you can do the
|
90
|
+
|
91
|
+
To define concurrent states directly on the object without explicitly defining a root, you can do the
|
92
92
|
following:
|
93
|
-
|
93
|
+
|
94
94
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
95
95
|
statesAreConcurrent: YES,
|
96
96
|
|
97
97
|
stateA: SC.State.design({
|
98
98
|
// ... can continue to nest further states
|
99
99
|
}),
|
100
|
-
|
100
|
+
|
101
101
|
stateB: SC.State.design({
|
102
102
|
// ... can continue to nest further states
|
103
103
|
})
|
104
104
|
});
|
105
|
-
|
106
|
-
Remember that a startchart can have a mixture of nested and concurrent states in order for you to
|
105
|
+
|
106
|
+
Remember that a startchart can have a mixture of nested and concurrent states in order for you to
|
107
107
|
create as complex of statecharts that suite your needs. Here is an example of a mixed state structure:
|
108
|
-
|
108
|
+
|
109
109
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
110
110
|
rootState: SC.State.design({
|
111
111
|
initialSubstate: 'stateA',
|
@@ -117,7 +117,7 @@ sc_require('mixins/statechart_delegate');
|
|
117
117
|
stateN: SC.State.design({ ... })
|
118
118
|
stateO: SC.State.design({ ... })
|
119
119
|
}),
|
120
|
-
|
120
|
+
|
121
121
|
stateB: SC.State.design({
|
122
122
|
initialSubstate: 'stateX',
|
123
123
|
|
@@ -126,10 +126,10 @@ sc_require('mixins/statechart_delegate');
|
|
126
126
|
})
|
127
127
|
})
|
128
128
|
});
|
129
|
-
|
129
|
+
|
130
130
|
Depending on your needs, a statechart can have lots of states, which can become hard to manage all within
|
131
131
|
one file. To modularize your states and make them easier to manage and maintain, you can plug-in states
|
132
|
-
into other states. Let's say we are using the statechart in the last example above, and all the code is
|
132
|
+
into other states. Let's say we are using the statechart in the last example above, and all the code is
|
133
133
|
within one file. We could update the code and split the logic across two or more files like so:
|
134
134
|
|
135
135
|
// state_a.js
|
@@ -169,168 +169,332 @@ sc_require('mixins/statechart_delegate');
|
|
169
169
|
*/
|
170
170
|
|
171
171
|
SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
172
|
-
|
172
|
+
|
173
|
+
//@if(debug)
|
174
|
+
/* BEGIN DEBUG ONLY PROPERTIES AND METHODS */
|
175
|
+
|
176
|
+
/** @private @property */
|
177
|
+
allowStatechartTracing: function() {
|
178
|
+
var key = this.get('statechartTraceKey');
|
179
|
+
return this.get(key);
|
180
|
+
}.property().cacheable(),
|
181
|
+
|
182
|
+
/** @private */
|
183
|
+
_statechartTraceDidChange: function() {
|
184
|
+
this.notifyPropertyChange('allowStatechartTracing');
|
185
|
+
},
|
186
|
+
|
187
|
+
/**
|
188
|
+
@property
|
189
|
+
|
190
|
+
Returns an object containing current detailed information about
|
191
|
+
the statechart. This is primarily used for diagnostic/debugging
|
192
|
+
purposes.
|
193
|
+
|
194
|
+
Detailed information includes:
|
195
|
+
|
196
|
+
- current states
|
197
|
+
- state transition information
|
198
|
+
- event handling information
|
199
|
+
|
200
|
+
NOTE: This is only available in debug mode!
|
201
|
+
|
202
|
+
@returns {Hash}
|
203
|
+
*/
|
204
|
+
details: function() {
|
205
|
+
var details = {
|
206
|
+
'initialized': this.get('statechartIsInitialized')
|
207
|
+
};
|
208
|
+
|
209
|
+
if (this.get('name')) {
|
210
|
+
details['name'] = this.get('name');
|
211
|
+
}
|
212
|
+
|
213
|
+
if (!this.get('statechartIsInitialized')) {
|
214
|
+
return details;
|
215
|
+
}
|
216
|
+
|
217
|
+
details['current-states'] = [];
|
218
|
+
this.get('currentStates').forEach(function(state) {
|
219
|
+
details['current-states'].push(state.get('fullPath'));
|
220
|
+
});
|
221
|
+
|
222
|
+
var stateTransition = {
|
223
|
+
active: this.get('gotoStateActive'),
|
224
|
+
suspended: this.get('gotoStateSuspended')
|
225
|
+
};
|
226
|
+
|
227
|
+
if (this._gotoStateActions) {
|
228
|
+
stateTransition['transition-sequence'] = [];
|
229
|
+
var actions = this._gotoStateActions,
|
230
|
+
actionToStr = function(action) {
|
231
|
+
var actionName = action.action === SC.ENTER_STATE ? "enter" : "exit";
|
232
|
+
return "%@ %@".fmt(actionName, action.state.get('fullPath'));
|
233
|
+
};
|
234
|
+
|
235
|
+
actions.forEach(function(action) {
|
236
|
+
stateTransition['transition-sequence'].push(actionToStr(action));
|
237
|
+
});
|
238
|
+
|
239
|
+
stateTransition['current-transition'] = actionToStr(this._currentGotoStateAction);
|
240
|
+
}
|
241
|
+
|
242
|
+
details['state-transition'] = stateTransition;
|
243
|
+
|
244
|
+
if (this._stateHandleEventInfo) {
|
245
|
+
var info = this._stateHandleEventInfo;
|
246
|
+
details['handling-event'] = {
|
247
|
+
state: info.state.get('fullPath'),
|
248
|
+
event: info.event,
|
249
|
+
handler: info.handler
|
250
|
+
};
|
251
|
+
} else {
|
252
|
+
details['handling-event'] = false;
|
253
|
+
}
|
254
|
+
|
255
|
+
return details;
|
256
|
+
}.property(),
|
257
|
+
|
258
|
+
/**
|
259
|
+
Returns a formatted string of detailed information about this statechart. Useful
|
260
|
+
for diagnostic/debugging purposes.
|
261
|
+
|
262
|
+
@returns {String}
|
263
|
+
|
264
|
+
NOTE: This is only available in debug mode!
|
265
|
+
|
266
|
+
@see #details
|
267
|
+
*/
|
268
|
+
toStringWithDetails: function() {
|
269
|
+
var str = "",
|
270
|
+
header = this.toString(),
|
271
|
+
details = this.get('details');
|
272
|
+
|
273
|
+
str += header + "\n";
|
274
|
+
str += this._hashToString(details, 2);
|
275
|
+
|
276
|
+
return str;
|
277
|
+
},
|
278
|
+
|
279
|
+
/** @private */
|
280
|
+
_hashToString: function(hash, indent) {
|
281
|
+
var str = "";
|
282
|
+
|
283
|
+
for (var key in hash) {
|
284
|
+
var value = hash[key];
|
285
|
+
if (value instanceof Array) {
|
286
|
+
str += this._arrayToString(key, value, indent) + "\n";
|
287
|
+
}
|
288
|
+
else if (value instanceof Object) {
|
289
|
+
str += "%@%@:\n".fmt(' '.mult(indent), key);
|
290
|
+
str += this._hashToString(value, indent + 2);
|
291
|
+
}
|
292
|
+
else {
|
293
|
+
str += "%@%@: %@\n".fmt(' '.mult(indent), key, value);
|
294
|
+
}
|
295
|
+
}
|
296
|
+
|
297
|
+
return str;
|
298
|
+
},
|
299
|
+
|
300
|
+
/** @private */
|
301
|
+
_arrayToString: function(key, array, indent) {
|
302
|
+
if (array.length === 0) {
|
303
|
+
return "%@%@: []".fmt(' '.mult(indent), key);
|
304
|
+
}
|
305
|
+
|
306
|
+
var str = "%@%@: [\n".fmt(' '.mult(indent), key);
|
307
|
+
|
308
|
+
array.forEach(function(item, idx) {
|
309
|
+
str += "%@%@\n".fmt(' '.mult(indent + 2), item);
|
310
|
+
}, this);
|
311
|
+
|
312
|
+
str += ' '.mult(indent) + "]";
|
313
|
+
|
314
|
+
return str;
|
315
|
+
},
|
316
|
+
|
317
|
+
/**
|
318
|
+
Indicates whether to use a monitor to monitor that statechart's activities. If true then
|
319
|
+
the monitor will be active, otherwise the monitor will not be used. Useful for debugging
|
320
|
+
purposes.
|
321
|
+
|
322
|
+
NOTE: This is only available in debug mode!
|
323
|
+
|
324
|
+
@type Boolean
|
325
|
+
*/
|
326
|
+
monitorIsActive: NO,
|
327
|
+
|
328
|
+
/**
|
329
|
+
A statechart monitor that can be used to monitor this statechart. Useful for debugging purposes.
|
330
|
+
A monitor will only be used if monitorIsActive is true.
|
331
|
+
|
332
|
+
NOTE: This is only available in debug mode!
|
333
|
+
|
334
|
+
@property {SC.StatechartMonitor}
|
335
|
+
*/
|
336
|
+
monitor: null,
|
337
|
+
|
338
|
+
/**
|
339
|
+
Used to specify what property (key) on the statechart should be used as the trace property. By
|
340
|
+
default the property is 'trace'.
|
341
|
+
|
342
|
+
NOTE: This is only available in debug mode!
|
343
|
+
|
344
|
+
@type String
|
345
|
+
*/
|
346
|
+
statechartTraceKey: 'trace',
|
347
|
+
|
348
|
+
/**
|
349
|
+
Indicates whether to trace the statecharts activities. If true then the statechart will output
|
350
|
+
its activites to the browser's JS console. Useful for debugging purposes.
|
351
|
+
|
352
|
+
NOTE: This is only available in debug mode!
|
353
|
+
|
354
|
+
@see #statechartTraceKey
|
355
|
+
|
356
|
+
@type Boolean
|
357
|
+
*/
|
358
|
+
trace: NO,
|
359
|
+
|
360
|
+
/**
|
361
|
+
Used to log a statechart trace message
|
362
|
+
|
363
|
+
NOTE: This is only available in debug mode!
|
364
|
+
*/
|
365
|
+
statechartLogTrace: function(msg) {
|
366
|
+
SC.Logger.info("%@: %@".fmt(this.get('statechartLogPrefix'), msg));
|
367
|
+
},
|
368
|
+
|
369
|
+
/* END DEBUG ONLY PROPERTIES AND METHODS */
|
370
|
+
//@endif
|
371
|
+
|
173
372
|
// Walk like a duck
|
174
373
|
isResponderContext: YES,
|
175
|
-
|
374
|
+
|
176
375
|
// Walk like a duck
|
177
376
|
isStatechart: YES,
|
178
|
-
|
377
|
+
|
179
378
|
/**
|
180
379
|
Indicates if this statechart has been initialized
|
181
380
|
|
182
|
-
@
|
381
|
+
@type Boolean
|
183
382
|
*/
|
184
383
|
statechartIsInitialized: NO,
|
185
|
-
|
384
|
+
|
186
385
|
/**
|
187
386
|
Optional name you can provide the statechart with. If set this will be included
|
188
|
-
in tracing and error output as well as detail output. Useful for
|
387
|
+
in tracing and error output as well as detail output. Useful for
|
189
388
|
debugging/diagnostic purposes
|
190
389
|
*/
|
191
390
|
name: null,
|
192
|
-
|
391
|
+
|
193
392
|
/**
|
194
393
|
The root state of this statechart. All statecharts must have a root state.
|
195
|
-
|
394
|
+
|
196
395
|
If this property is left unassigned then when the statechart is initialized
|
197
396
|
it will used the rootStateExample, initialState, and statesAreConcurrent
|
198
397
|
properties to construct a root state.
|
199
|
-
|
398
|
+
|
200
399
|
@see #rootStateExample
|
201
400
|
@see #initialState
|
202
401
|
@see #statesAreConcurrent
|
203
|
-
|
402
|
+
|
204
403
|
@property {SC.State}
|
205
404
|
*/
|
206
405
|
rootState: null,
|
207
|
-
|
208
|
-
/**
|
406
|
+
|
407
|
+
/**
|
209
408
|
Represents the class used to construct a class that will be the root state for
|
210
|
-
this statechart. The class assigned must derive from SC.State.
|
211
|
-
|
409
|
+
this statechart. The class assigned must derive from SC.State.
|
410
|
+
|
212
411
|
This property will only be used if the rootState property is not assigned.
|
213
|
-
|
412
|
+
|
214
413
|
@see #rootState
|
215
|
-
|
414
|
+
|
216
415
|
@property {SC.State}
|
217
416
|
*/
|
218
417
|
rootStateExample: SC.State,
|
219
|
-
|
220
|
-
/**
|
418
|
+
|
419
|
+
/**
|
221
420
|
Indicates what state should be the initial state of this statechart. The value
|
222
421
|
assigned must be the name of a property on this object that represents a state.
|
223
422
|
As well, the statesAreConcurrent must be set to NO.
|
224
|
-
|
423
|
+
|
225
424
|
This property will only be used if the rootState property is not assigned.
|
226
|
-
|
425
|
+
|
227
426
|
@see #rootState
|
228
|
-
|
229
|
-
@
|
427
|
+
|
428
|
+
@type String
|
230
429
|
*/
|
231
430
|
initialState: null,
|
232
|
-
|
233
|
-
/**
|
431
|
+
|
432
|
+
/**
|
234
433
|
Indicates if properties on this object representing states are concurrent to each other.
|
235
434
|
If YES then they are concurrent, otherwise they are not. If the YES, then the
|
236
435
|
initialState property must not be assigned.
|
237
|
-
|
436
|
+
|
238
437
|
This property will only be used if the rootState property is not assigned.
|
239
|
-
|
438
|
+
|
240
439
|
@see #rootState
|
241
|
-
|
242
|
-
@property {Boolean}
|
243
|
-
*/
|
244
|
-
statesAreConcurrent: NO,
|
245
|
-
|
246
|
-
/**
|
247
|
-
Indicates whether to use a monitor to monitor that statechart's activities. If true then
|
248
|
-
the monitor will be active, otherwise the monitor will not be used. Useful for debugging
|
249
|
-
purposes.
|
250
|
-
|
251
|
-
@property {Boolean}
|
252
|
-
*/
|
253
|
-
monitorIsActive: NO,
|
254
|
-
|
255
|
-
/**
|
256
|
-
A statechart monitor that can be used to monitor this statechart. Useful for debugging purposes.
|
257
|
-
A monitor will only be used if monitorIsActive is true.
|
258
|
-
|
259
|
-
@property {SC.StatechartMonitor}
|
260
|
-
*/
|
261
|
-
monitor: null,
|
262
|
-
|
263
|
-
/**
|
264
|
-
Used to specify what property (key) on the statechart should be used as the trace property. By
|
265
|
-
default the property is 'trace'.
|
266
440
|
|
267
|
-
@
|
441
|
+
@type Boolean
|
268
442
|
*/
|
269
|
-
|
270
|
-
|
271
|
-
/**
|
272
|
-
Indicates whether to trace the statecharts activities. If true then the statechart will output
|
273
|
-
its activites to the browser's JS console. Useful for debugging purposes.
|
274
|
-
|
275
|
-
@see #statechartTraceKey
|
443
|
+
statesAreConcurrent: NO,
|
276
444
|
|
277
|
-
@property {Boolean}
|
278
|
-
*/
|
279
|
-
trace: NO,
|
280
|
-
|
281
445
|
/**
|
282
446
|
Used to specify what property (key) on the statechart should be used as the owner property. By
|
283
447
|
default the property is 'owner'.
|
284
448
|
|
285
|
-
@
|
449
|
+
@type String
|
286
450
|
*/
|
287
451
|
statechartOwnerKey: 'owner',
|
288
452
|
|
289
453
|
/**
|
290
454
|
Sets who the owner is of this statechart. If null then the owner is this object otherwise
|
291
|
-
the owner is the assigned object.
|
455
|
+
the owner is the assigned object.
|
292
456
|
|
293
457
|
@see #statechartOwnerKey
|
294
458
|
|
295
|
-
@
|
459
|
+
@type SC.Object
|
296
460
|
*/
|
297
461
|
owner: null,
|
298
462
|
|
299
|
-
/**
|
463
|
+
/**
|
300
464
|
Indicates if the statechart should be automatically initialized by this
|
301
465
|
object after it has been created. If YES then initStatechart will be
|
302
466
|
called automatically, otherwise it will not.
|
303
|
-
|
304
|
-
@
|
467
|
+
|
468
|
+
@type Boolean
|
305
469
|
*/
|
306
470
|
autoInitStatechart: YES,
|
307
|
-
|
471
|
+
|
308
472
|
/**
|
309
473
|
If yes, any warning messages produced by the statechart or any of its states will
|
310
|
-
not be logged, otherwise all warning messages will be logged.
|
311
|
-
|
474
|
+
not be logged, otherwise all warning messages will be logged.
|
475
|
+
|
312
476
|
While designing and debugging your statechart, it's best to keep this value false.
|
313
477
|
In production you can then suppress the warning messages.
|
314
|
-
|
315
|
-
@
|
478
|
+
|
479
|
+
@type Boolean
|
316
480
|
*/
|
317
481
|
suppressStatechartWarnings: NO,
|
318
|
-
|
482
|
+
|
319
483
|
/**
|
320
|
-
A statechart delegate used by the statechart and the states that the statechart
|
484
|
+
A statechart delegate used by the statechart and the states that the statechart
|
321
485
|
manages. The value assigned must adhere to the {@link SC.StatechartDelegate} mixin.
|
322
|
-
|
323
|
-
@
|
324
|
-
|
486
|
+
|
487
|
+
@type SC.Object
|
488
|
+
|
325
489
|
@see SC.StatechartDelegate
|
326
490
|
*/
|
327
491
|
delegate: null,
|
328
|
-
|
492
|
+
|
329
493
|
/**
|
330
494
|
Computed property that returns an objects that adheres to the
|
331
495
|
{@link SC.StatechartDelegate} mixin. If the {@link #delegate} is not
|
332
496
|
assigned then this object is the default value returned.
|
333
|
-
|
497
|
+
|
334
498
|
@see SC.StatechartDelegate
|
335
499
|
@see #delegate
|
336
500
|
*/
|
@@ -338,21 +502,25 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
338
502
|
var del = this.get('delegate');
|
339
503
|
return this.delegateFor('isStatechartDelegate', del);
|
340
504
|
}.property('delegate'),
|
341
|
-
|
505
|
+
|
342
506
|
initMixin: function() {
|
343
507
|
if (this.get('autoInitStatechart')) {
|
344
508
|
this.initStatechart();
|
345
509
|
}
|
346
510
|
},
|
347
|
-
|
511
|
+
|
348
512
|
destroyMixin: function() {
|
349
|
-
var root = this.get('rootState')
|
350
|
-
|
513
|
+
var root = this.get('rootState');
|
514
|
+
|
515
|
+
//@if(debug)
|
516
|
+
var traceKey = this.get('statechartTraceKey');
|
351
517
|
|
352
518
|
this.removeObserver(traceKey, this, '_statechartTraceDidChange');
|
519
|
+
//@endif
|
353
520
|
|
354
521
|
root.destroy();
|
355
522
|
this.set('rootState', null);
|
523
|
+
this.notifyPropertyChange('currentStates');
|
356
524
|
},
|
357
525
|
|
358
526
|
/**
|
@@ -361,29 +529,31 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
361
529
|
*/
|
362
530
|
initStatechart: function() {
|
363
531
|
if (this.get('statechartIsInitialized')) return;
|
364
|
-
|
532
|
+
|
365
533
|
this._gotoStateLocked = NO;
|
366
534
|
this._sendEventLocked = NO;
|
367
535
|
this._pendingStateTransitions = [];
|
368
536
|
this._pendingSentEvents = [];
|
369
|
-
|
537
|
+
|
370
538
|
this.sendAction = this.sendEvent;
|
371
|
-
|
539
|
+
|
540
|
+
//@if(debug)
|
372
541
|
if (this.get('monitorIsActive')) {
|
373
542
|
this.set('monitor', SC.StatechartMonitor.create({ statechart: this }));
|
374
543
|
}
|
375
544
|
|
376
|
-
var traceKey = this.get('statechartTraceKey')
|
545
|
+
var traceKey = this.get('statechartTraceKey'),
|
546
|
+
trace = this.get('allowStatechartTracing');
|
377
547
|
|
378
548
|
this.addObserver(traceKey, this, '_statechartTraceDidChange');
|
379
549
|
this._statechartTraceDidChange();
|
380
550
|
|
381
|
-
var trace = this.get('allowStatechartTracing'),
|
382
|
-
rootState = this.get('rootState'),
|
383
|
-
msg;
|
384
|
-
|
385
551
|
if (trace) this.statechartLogTrace("BEGIN initialize statechart");
|
386
|
-
|
552
|
+
//@endif
|
553
|
+
|
554
|
+
var rootState = this.get('rootState'),
|
555
|
+
msg;
|
556
|
+
|
387
557
|
// If no root state was explicitly defined then try to construct
|
388
558
|
// a root state class
|
389
559
|
if (!rootState) {
|
@@ -392,38 +562,40 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
392
562
|
else if (SC.typeOf(rootState) === SC.T_FUNCTION && rootState.statePlugin) {
|
393
563
|
rootState = rootState.apply(this);
|
394
564
|
}
|
395
|
-
|
565
|
+
|
396
566
|
if (!(SC.kindOf(rootState, SC.State) && rootState.isClass)) {
|
397
567
|
msg = "Unable to initialize statechart. Root state must be a state class";
|
398
568
|
this.statechartLogError(msg);
|
399
569
|
throw msg;
|
400
570
|
}
|
401
|
-
|
402
|
-
rootState = this.createRootState(rootState, {
|
403
|
-
statechart: this,
|
404
|
-
name: SC.ROOT_STATE_NAME
|
571
|
+
|
572
|
+
rootState = this.createRootState(rootState, {
|
573
|
+
statechart: this,
|
574
|
+
name: SC.ROOT_STATE_NAME
|
405
575
|
});
|
406
|
-
|
576
|
+
|
407
577
|
this.set('rootState', rootState);
|
408
578
|
rootState.initState();
|
409
|
-
|
579
|
+
|
410
580
|
if (SC.kindOf(rootState.get('initialSubstate'), SC.EmptyState)) {
|
411
|
-
msg = "Unable to initialize statechart. Root state must have an initial substate
|
581
|
+
msg = "Unable to initialize statechart. Root state must have an initial substate explicitly defined";
|
412
582
|
this.statechartLogError(msg);
|
413
583
|
throw msg;
|
414
584
|
}
|
415
|
-
|
585
|
+
|
416
586
|
if (!SC.empty(this.get('initialState'))) {
|
417
587
|
var key = 'initialState';
|
418
588
|
this.set(key, rootState.get(this.get(key)));
|
419
|
-
}
|
420
|
-
|
589
|
+
}
|
590
|
+
|
421
591
|
this.set('statechartIsInitialized', YES);
|
422
592
|
this.gotoState(rootState);
|
423
|
-
|
593
|
+
|
594
|
+
//@if(debug)
|
424
595
|
if (trace) this.statechartLogTrace("END initialize statechart");
|
596
|
+
//@endif
|
425
597
|
},
|
426
|
-
|
598
|
+
|
427
599
|
/**
|
428
600
|
Will create a root state for the statechart
|
429
601
|
*/
|
@@ -432,80 +604,80 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
432
604
|
state = state.create(attrs);
|
433
605
|
return state;
|
434
606
|
},
|
435
|
-
|
607
|
+
|
436
608
|
/**
|
437
609
|
Returns an array of all the current states for this statechart
|
438
|
-
|
610
|
+
|
439
611
|
@returns {Array} the current states
|
440
612
|
*/
|
441
613
|
currentStates: function() {
|
442
614
|
return this.getPath('rootState.currentSubstates');
|
443
615
|
}.property().cacheable(),
|
444
|
-
|
616
|
+
|
445
617
|
/**
|
446
|
-
Returns the first current state for this statechart.
|
447
|
-
|
618
|
+
Returns the first current state for this statechart.
|
619
|
+
|
448
620
|
@return {SC.State}
|
449
621
|
*/
|
450
622
|
firstCurrentState: function() {
|
451
623
|
var cs = this.get('currentStates');
|
452
624
|
return cs ? cs.objectAt(0) : null;
|
453
625
|
}.property('currentStates').cacheable(),
|
454
|
-
|
626
|
+
|
455
627
|
/**
|
456
628
|
Returns the count of the current states for this statechart
|
457
|
-
|
458
|
-
@returns {Number} the count
|
629
|
+
|
630
|
+
@returns {Number} the count
|
459
631
|
*/
|
460
632
|
currentStateCount: function() {
|
461
633
|
return this.getPath('currentStates.length');
|
462
634
|
}.property('currentStates').cacheable(),
|
463
|
-
|
635
|
+
|
464
636
|
/**
|
465
|
-
Checks if a given state is a current state of this statechart.
|
466
|
-
|
637
|
+
Checks if a given state is a current state of this statechart.
|
638
|
+
|
467
639
|
@param state {State|String} the state to check
|
468
640
|
@returns {Boolean} true if the state is a current state, otherwise fals is returned
|
469
641
|
*/
|
470
642
|
stateIsCurrentState: function(state) {
|
471
643
|
return this.get('rootState').stateIsCurrentSubstate(state);
|
472
644
|
},
|
473
|
-
|
645
|
+
|
474
646
|
/**
|
475
647
|
Returns an array of all the states that are currently entered for
|
476
648
|
this statechart.
|
477
|
-
|
649
|
+
|
478
650
|
@returns {Array} the currently entered states
|
479
651
|
*/
|
480
652
|
enteredStates: function() {
|
481
653
|
return this.getPath('rootState.enteredSubstates');
|
482
654
|
}.property().cacheable(),
|
483
|
-
|
655
|
+
|
484
656
|
/**
|
485
657
|
Checks if a given state is a currently entered state of this statechart.
|
486
|
-
|
658
|
+
|
487
659
|
@param state {State|String} the state to check
|
488
660
|
@returns {Boolean} true if the state is a currently entered state, otherwise false is returned
|
489
661
|
*/
|
490
662
|
stateIsEntered: function(state) {
|
491
663
|
return this.get('rootState').stateIsEnteredSubstate(state);
|
492
664
|
},
|
493
|
-
|
665
|
+
|
494
666
|
/**
|
495
667
|
Checks if the given value represents a state is this statechart
|
496
|
-
|
668
|
+
|
497
669
|
@param value {State|String} either a state object or the name of a state
|
498
670
|
@returns {Boolean} true if the state does belong ot the statechart, otherwise false is returned
|
499
671
|
*/
|
500
672
|
doesContainState: function(value) {
|
501
673
|
return !SC.none(this.getState(value));
|
502
674
|
},
|
503
|
-
|
675
|
+
|
504
676
|
/**
|
505
677
|
Gets a state from the statechart that matches the given value
|
506
|
-
|
678
|
+
|
507
679
|
@param value {State|String} either a state object of the name of a state
|
508
|
-
@returns {State} if a match then the matching state is returned, otherwise null is returned
|
680
|
+
@returns {State} if a match then the matching state is returned, otherwise null is returned
|
509
681
|
*/
|
510
682
|
getState: function(state) {
|
511
683
|
var root = this.get('rootState');
|
@@ -513,43 +685,43 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
513
685
|
},
|
514
686
|
|
515
687
|
/**
|
516
|
-
When called, the statechart will proceed with making state transitions in the statechart starting from
|
517
|
-
a current state that meet the statechart conditions. When complete, some or all of the statechart's
|
518
|
-
current states will be changed, and all states that were part of the transition process will either
|
688
|
+
When called, the statechart will proceed with making state transitions in the statechart starting from
|
689
|
+
a current state that meet the statechart conditions. When complete, some or all of the statechart's
|
690
|
+
current states will be changed, and all states that were part of the transition process will either
|
519
691
|
be exited or entered in a specific order.
|
520
|
-
|
692
|
+
|
521
693
|
The state that is given to go to will not necessarily be a current state when the state transition process
|
522
|
-
is complete. The final state or states are dependent on factors such an initial substates, concurrent
|
694
|
+
is complete. The final state or states are dependent on factors such an initial substates, concurrent
|
523
695
|
states, and history states.
|
524
|
-
|
696
|
+
|
525
697
|
Because the statechart can have one or more current states, it may be necessary to indicate what current state
|
526
698
|
to start from. If no current state to start from is provided, then the statechart will default to using
|
527
699
|
the first current state that it has; depending of the make up of the statechart (no concurrent state vs.
|
528
700
|
with concurrent states), the outcome may be unexpected. For a statechart with concurrent states, it is best
|
529
701
|
to provide a current state in which to start from.
|
530
|
-
|
702
|
+
|
531
703
|
When using history states, the statechart will first make transitions to the given state and then use that
|
532
|
-
state's history state and recursively follow each history state's history state until there are no
|
704
|
+
state's history state and recursively follow each history state's history state until there are no
|
533
705
|
more history states to follow. If the given state does not have a history state, then the statechart
|
534
706
|
will continue following state transition procedures.
|
535
|
-
|
707
|
+
|
536
708
|
Method can be called in the following ways:
|
537
|
-
|
538
|
-
// With one argument.
|
709
|
+
|
710
|
+
// With one argument.
|
539
711
|
gotoState(<state>)
|
540
|
-
|
712
|
+
|
541
713
|
// With two argument.
|
542
714
|
gotoState(<state>, <state | boolean | hash>)
|
543
|
-
|
715
|
+
|
544
716
|
// With three argument.
|
545
717
|
gotoState(<state>, <state>, <boolean | hash>)
|
546
718
|
gotoState(<state>, <boolean>, <hash>)
|
547
|
-
|
719
|
+
|
548
720
|
// With four argument.
|
549
721
|
gotoState(<state>, <state>, <boolean>, <hash>)
|
550
|
-
|
722
|
+
|
551
723
|
where <state> is either a SC.State object or a string and <hash> is a regular JS hash object.
|
552
|
-
|
724
|
+
|
553
725
|
@param state {SC.State|String} the state to go to (may not be the final state in the transition process)
|
554
726
|
@param fromCurrentState {SC.State|String} Optional. The current state to start the transition process from.
|
555
727
|
@param useHistory {Boolean} Optional. Indicates whether to include using history states in the transition process
|
@@ -560,35 +732,33 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
560
732
|
this.statechartLogError("can not go to state %@. statechart has not yet been initialized".fmt(state));
|
561
733
|
return;
|
562
734
|
}
|
563
|
-
|
735
|
+
|
564
736
|
if (this.get('isDestroyed')) {
|
565
737
|
this.statechartLogError("can not go to state %@. statechart is destroyed".fmt(this));
|
566
738
|
return;
|
567
739
|
}
|
568
|
-
|
740
|
+
|
569
741
|
var args = this._processGotoStateArgs(arguments);
|
570
742
|
|
571
743
|
state = args.state;
|
572
744
|
fromCurrentState = args.fromCurrentState;
|
573
745
|
useHistory = args.useHistory;
|
574
746
|
context = args.context;
|
575
|
-
|
747
|
+
|
576
748
|
var pivotState = null,
|
577
749
|
exitStates = [],
|
578
750
|
enterStates = [],
|
579
|
-
trace = this.get('allowStatechartTracing'),
|
580
|
-
rootState = this.get('rootState'),
|
581
751
|
paramState = state,
|
582
752
|
paramFromCurrentState = fromCurrentState,
|
583
753
|
msg;
|
584
|
-
|
754
|
+
|
585
755
|
state = this.getState(state);
|
586
|
-
|
756
|
+
|
587
757
|
if (SC.none(state)) {
|
588
758
|
this.statechartLogError("Can not to goto state %@. Not a recognized state in statechart".fmt(paramState));
|
589
759
|
return;
|
590
760
|
}
|
591
|
-
|
761
|
+
|
592
762
|
if (this._gotoStateLocked) {
|
593
763
|
// There is a state transition currently happening. Add this requested state
|
594
764
|
// transition to the queue of pending state transitions. The request will
|
@@ -599,14 +769,14 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
599
769
|
useHistory: useHistory,
|
600
770
|
context: context
|
601
771
|
});
|
602
|
-
|
772
|
+
|
603
773
|
return;
|
604
774
|
}
|
605
|
-
|
606
|
-
// Lock the current state transition so that no other requested state transition
|
607
|
-
// interferes.
|
775
|
+
|
776
|
+
// Lock the current state transition so that no other requested state transition
|
777
|
+
// interferes.
|
608
778
|
this._gotoStateLocked = YES;
|
609
|
-
|
779
|
+
|
610
780
|
if (fromCurrentState) {
|
611
781
|
// Check to make sure the current state given is actually a current state of this statechart
|
612
782
|
fromCurrentState = this.getState(fromCurrentState);
|
@@ -616,14 +786,16 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
616
786
|
this._gotoStateLocked = NO;
|
617
787
|
return;
|
618
788
|
}
|
619
|
-
}
|
789
|
+
}
|
620
790
|
else {
|
621
791
|
// No explicit current state to start from; therefore, need to find a current state
|
622
792
|
// to transition from.
|
623
793
|
fromCurrentState = state.findFirstRelativeCurrentState();
|
624
794
|
if (!fromCurrentState) fromCurrentState = this.get('firstCurrentState');
|
625
795
|
}
|
626
|
-
|
796
|
+
|
797
|
+
//@if(debug)
|
798
|
+
var trace = this.get('allowStatechartTracing');
|
627
799
|
if (trace) {
|
628
800
|
this.statechartLogTrace("BEGIN gotoState: %@".fmt(state));
|
629
801
|
msg = "starting from current state: %@";
|
@@ -633,55 +805,58 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
633
805
|
msg = msg.fmt(this.getPath('currentStates.length') > 0 ? this.get('currentStates') : '---');
|
634
806
|
this.statechartLogTrace(msg);
|
635
807
|
}
|
808
|
+
//@endif
|
636
809
|
|
637
810
|
// If there is a current state to start the transition process from, then determine what
|
638
811
|
// states are to be exited
|
639
812
|
if (!SC.none(fromCurrentState)) {
|
640
813
|
exitStates = this._createStateChain(fromCurrentState);
|
641
814
|
}
|
642
|
-
|
815
|
+
|
643
816
|
// Now determine the initial states to be entered
|
644
817
|
enterStates = this._createStateChain(state);
|
645
|
-
|
818
|
+
|
646
819
|
// Get the pivot state to indicate when to go from exiting states to entering states
|
647
820
|
pivotState = this._findPivotState(exitStates, enterStates);
|
648
821
|
|
649
822
|
if (pivotState) {
|
823
|
+
//@if(debug)
|
650
824
|
if (trace) this.statechartLogTrace("pivot state = %@".fmt(pivotState));
|
825
|
+
//@endif
|
651
826
|
if (pivotState.get('substatesAreConcurrent') && pivotState !== state) {
|
652
827
|
this.statechartLogError("Can not go to state %@ from %@. Pivot state %@ has concurrent substates.".fmt(state, fromCurrentState, pivotState));
|
653
828
|
this._gotoStateLocked = NO;
|
654
829
|
return;
|
655
830
|
}
|
656
831
|
}
|
657
|
-
|
832
|
+
|
658
833
|
// Collect what actions to perform for the state transition process
|
659
834
|
var gotoStateActions = [];
|
660
|
-
|
661
|
-
|
835
|
+
|
836
|
+
|
662
837
|
// Go ahead and find states that are to be exited
|
663
838
|
this._traverseStatesToExit(exitStates.shift(), exitStates, pivotState, gotoStateActions);
|
664
|
-
|
665
|
-
// Now go find states that are to entered
|
839
|
+
|
840
|
+
// Now go find states that are to be entered
|
666
841
|
if (pivotState !== state) {
|
667
842
|
this._traverseStatesToEnter(enterStates.pop(), enterStates, pivotState, useHistory, gotoStateActions);
|
668
843
|
} else {
|
669
844
|
this._traverseStatesToExit(pivotState, [], null, gotoStateActions);
|
670
845
|
this._traverseStatesToEnter(pivotState, null, null, useHistory, gotoStateActions);
|
671
846
|
}
|
672
|
-
|
847
|
+
|
673
848
|
// Collected all the state transition actions to be performed. Now execute them.
|
674
849
|
this._gotoStateActions = gotoStateActions;
|
675
850
|
this._executeGotoStateActions(state, gotoStateActions, null, context);
|
676
851
|
},
|
677
|
-
|
852
|
+
|
678
853
|
/**
|
679
854
|
Indicates if the statechart is in an active goto state process
|
680
855
|
*/
|
681
856
|
gotoStateActive: function() {
|
682
857
|
return this._gotoStateLocked;
|
683
858
|
}.property(),
|
684
|
-
|
859
|
+
|
685
860
|
/**
|
686
861
|
Indicates if the statechart is in an active goto state process
|
687
862
|
that has been suspended
|
@@ -689,7 +864,7 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
689
864
|
gotoStateSuspended: function() {
|
690
865
|
return this._gotoStateLocked && !!this._gotoStateSuspendedPoint;
|
691
866
|
}.property(),
|
692
|
-
|
867
|
+
|
693
868
|
/**
|
694
869
|
Resumes an active goto state transition process that has been suspended.
|
695
870
|
*/
|
@@ -698,36 +873,36 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
698
873
|
this.statechartLogError("Can not resume goto state since it has not been suspended");
|
699
874
|
return;
|
700
875
|
}
|
701
|
-
|
876
|
+
|
702
877
|
var point = this._gotoStateSuspendedPoint;
|
703
878
|
this._executeGotoStateActions(point.gotoState, point.actions, point.marker, point.context);
|
704
879
|
},
|
705
|
-
|
880
|
+
|
706
881
|
/** @private */
|
707
882
|
_executeGotoStateActions: function(gotoState, actions, marker, context) {
|
708
883
|
var action = null,
|
709
884
|
len = actions.length,
|
710
885
|
actionResult = null;
|
711
|
-
|
886
|
+
|
712
887
|
marker = SC.none(marker) ? 0 : marker;
|
713
|
-
|
888
|
+
|
714
889
|
for (; marker < len; marker += 1) {
|
715
890
|
this._currentGotoStateAction = action = actions[marker];
|
716
891
|
switch (action.action) {
|
717
892
|
case SC.EXIT_STATE:
|
718
893
|
actionResult = this._exitState(action.state, context);
|
719
894
|
break;
|
720
|
-
|
895
|
+
|
721
896
|
case SC.ENTER_STATE:
|
722
897
|
actionResult = this._enterState(action.state, action.currentState, context);
|
723
898
|
break;
|
724
899
|
}
|
725
|
-
|
900
|
+
|
726
901
|
//
|
727
902
|
// Check if the state wants to perform an asynchronous action during
|
728
903
|
// the state transition process. If so, then we need to first
|
729
|
-
// suspend the state transition process and then invoke the
|
730
|
-
// asynchronous action. Once called, it is then up to the state or something
|
904
|
+
// suspend the state transition process and then invoke the
|
905
|
+
// asynchronous action. Once called, it is then up to the state or something
|
731
906
|
// else to resume this statechart's state transition process by calling the
|
732
907
|
// statechart's resumeGotoState method.
|
733
908
|
//
|
@@ -737,26 +912,28 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
737
912
|
actions: actions,
|
738
913
|
marker: marker + 1,
|
739
914
|
context: context
|
740
|
-
};
|
741
|
-
|
915
|
+
};
|
916
|
+
|
742
917
|
actionResult.tryToPerform(action.state);
|
743
918
|
return;
|
744
919
|
}
|
745
920
|
}
|
746
|
-
|
921
|
+
|
747
922
|
this.beginPropertyChanges();
|
748
923
|
this.notifyPropertyChange('currentStates');
|
749
924
|
this.notifyPropertyChange('enteredStates');
|
750
925
|
this.endPropertyChanges();
|
751
|
-
|
926
|
+
|
927
|
+
//@if(debug)
|
752
928
|
if (this.get('allowStatechartTracing')) {
|
753
929
|
this.statechartLogTrace("current states after: %@".fmt(this.get('currentStates')));
|
754
930
|
this.statechartLogTrace("END gotoState: %@".fmt(gotoState));
|
755
931
|
}
|
756
|
-
|
932
|
+
//@endif
|
933
|
+
|
757
934
|
this._cleanupStateTransition();
|
758
935
|
},
|
759
|
-
|
936
|
+
|
760
937
|
/** @private */
|
761
938
|
_cleanupStateTransition: function() {
|
762
939
|
this._currentGotoStateAction = null;
|
@@ -765,60 +942,64 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
765
942
|
this._gotoStateLocked = NO;
|
766
943
|
this._flushPendingStateTransition();
|
767
944
|
},
|
768
|
-
|
945
|
+
|
769
946
|
/** @private */
|
770
947
|
_exitState: function(state, context) {
|
771
948
|
var parentState;
|
772
|
-
|
773
|
-
if (state.get('currentSubstates').indexOf(state) >= 0) {
|
949
|
+
|
950
|
+
if (state.get('currentSubstates').indexOf(state) >= 0) {
|
774
951
|
parentState = state.get('parentState');
|
775
952
|
while (parentState) {
|
776
953
|
parentState.get('currentSubstates').removeObject(state);
|
777
954
|
parentState = parentState.get('parentState');
|
778
955
|
}
|
779
956
|
}
|
780
|
-
|
957
|
+
|
781
958
|
parentState = state;
|
782
959
|
while (parentState) {
|
783
960
|
parentState.get('enteredSubstates').removeObject(state);
|
784
961
|
parentState = parentState.get('parentState');
|
785
962
|
}
|
786
|
-
|
963
|
+
|
964
|
+
//@if(debug)
|
787
965
|
if (this.get('allowStatechartTracing')) {
|
788
966
|
this.statechartLogTrace("<-- exiting state: %@".fmt(state));
|
789
967
|
}
|
790
|
-
|
968
|
+
//@endif
|
969
|
+
|
791
970
|
state.set('currentSubstates', []);
|
792
|
-
|
971
|
+
|
793
972
|
state.stateWillBecomeExited(context);
|
794
973
|
var result = this.exitState(state, context);
|
795
974
|
state.stateDidBecomeExited(context);
|
796
|
-
|
975
|
+
|
976
|
+
//@if(debug)
|
797
977
|
if (this.get('monitorIsActive')) this.get('monitor').pushExitedState(state);
|
798
|
-
|
978
|
+
//@endif
|
979
|
+
|
799
980
|
state._traverseStatesToExit_skipState = NO;
|
800
|
-
|
981
|
+
|
801
982
|
return result;
|
802
983
|
},
|
803
|
-
|
984
|
+
|
804
985
|
/**
|
805
986
|
What will actually invoke a state's exitState method.
|
806
|
-
|
987
|
+
|
807
988
|
Called during the state transition process whenever the gotoState method is
|
808
989
|
invoked.
|
809
|
-
|
990
|
+
|
810
991
|
@param state {SC.State} the state whose enterState method is to be invoked
|
811
992
|
@param context {Hash} a context hash object to provide the enterState method
|
812
993
|
*/
|
813
994
|
exitState: function(state, context) {
|
814
995
|
return state.exitState(context);
|
815
996
|
},
|
816
|
-
|
997
|
+
|
817
998
|
/** @private */
|
818
999
|
_enterState: function(state, current, context) {
|
819
1000
|
var parentState = state.get('parentState');
|
820
1001
|
if (parentState && !state.get('isConcurrentState')) parentState.set('historyState', state);
|
821
|
-
|
1002
|
+
|
822
1003
|
if (current) {
|
823
1004
|
parentState = state;
|
824
1005
|
while (parentState) {
|
@@ -826,36 +1007,40 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
826
1007
|
parentState = parentState.get('parentState');
|
827
1008
|
}
|
828
1009
|
}
|
829
|
-
|
1010
|
+
|
830
1011
|
parentState = state;
|
831
1012
|
while (parentState) {
|
832
1013
|
parentState.get('enteredSubstates').pushObject(state);
|
833
1014
|
parentState = parentState.get('parentState');
|
834
1015
|
}
|
835
|
-
|
1016
|
+
|
1017
|
+
//@if(debug)
|
836
1018
|
if (this.get('allowStatechartTracing')) this.statechartLogTrace("--> entering state: %@".fmt(state));
|
837
|
-
|
1019
|
+
//@endif
|
1020
|
+
|
838
1021
|
state.stateWillBecomeEntered(context);
|
839
1022
|
var result = this.enterState(state, context);
|
840
1023
|
state.stateDidBecomeEntered(context);
|
841
|
-
|
1024
|
+
|
1025
|
+
//@if(debug)
|
842
1026
|
if (this.get('monitorIsActive')) this.get('monitor').pushEnteredState(state);
|
843
|
-
|
1027
|
+
//@endif
|
1028
|
+
|
844
1029
|
return result;
|
845
1030
|
},
|
846
|
-
|
1031
|
+
|
847
1032
|
/**
|
848
1033
|
What will actually invoke a state's enterState method.
|
849
|
-
|
1034
|
+
|
850
1035
|
Called during the state transition process whenever the gotoState method is
|
851
1036
|
invoked.
|
852
|
-
|
853
|
-
If the context provided is a state route context object
|
854
|
-
({@link SC.StateRouteContext}), then if the given state has a enterStateByRoute
|
855
|
-
method, that method will be invoked, otherwise the state's enterState method
|
856
|
-
will be invoked by default. The state route context object will be supplied to
|
1037
|
+
|
1038
|
+
If the context provided is a state route context object
|
1039
|
+
({@link SC.StateRouteContext}), then if the given state has a enterStateByRoute
|
1040
|
+
method, that method will be invoked, otherwise the state's enterState method
|
1041
|
+
will be invoked by default. The state route context object will be supplied to
|
857
1042
|
both enter methods in either case.
|
858
|
-
|
1043
|
+
|
859
1044
|
@param state {SC.State} the state whose enterState method is to be invoked
|
860
1045
|
@param context {Hash} a context hash object to provide the enterState method
|
861
1046
|
*/
|
@@ -866,40 +1051,40 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
866
1051
|
return state.enterState(context);
|
867
1052
|
}
|
868
1053
|
},
|
869
|
-
|
1054
|
+
|
870
1055
|
/**
|
871
1056
|
When called, the statechart will proceed to make transitions to the given state then follow that
|
872
|
-
state's history state.
|
873
|
-
|
1057
|
+
state's history state.
|
1058
|
+
|
874
1059
|
You can either go to a given state's history recursively or non-recursively. To go to a state's history
|
875
1060
|
recursively means to following each history state's history state until no more history states can be
|
876
1061
|
followed. Non-recursively means to just to the given state's history state but do not recusively follow
|
877
1062
|
history states. If the given state does not have a history state, then the statechart will just follow
|
878
1063
|
normal procedures when making state transitions.
|
879
|
-
|
1064
|
+
|
880
1065
|
Because a statechart can have one or more current states, depending on if the statechart has any concurrent
|
881
1066
|
states, it is optional to provided current state in which to start the state transition process from. If no
|
882
|
-
current state is provided, then the statechart will default to the first current state that it has; which,
|
1067
|
+
current state is provided, then the statechart will default to the first current state that it has; which,
|
883
1068
|
depending on the make up of that statechart, can lead to unexpected outcomes. For a statechart with concurrent
|
884
1069
|
states, it is best to explicitly supply a current state.
|
885
|
-
|
1070
|
+
|
886
1071
|
Method can be called in the following ways:
|
887
|
-
|
888
|
-
// With one arguments.
|
1072
|
+
|
1073
|
+
// With one arguments.
|
889
1074
|
gotoHistoryState(<state>)
|
890
|
-
|
891
|
-
// With two arguments.
|
1075
|
+
|
1076
|
+
// With two arguments.
|
892
1077
|
gotoHistoryState(<state>, <state | boolean | hash>)
|
893
|
-
|
1078
|
+
|
894
1079
|
// With three arguments.
|
895
1080
|
gotoHistoryState(<state>, <state>, <boolean | hash>)
|
896
1081
|
gotoHistoryState(<state>, <boolean>, <hash>)
|
897
|
-
|
1082
|
+
|
898
1083
|
// With four argumetns
|
899
1084
|
gotoHistoryState(<state>, <state>, <boolean>, <hash>)
|
900
|
-
|
1085
|
+
|
901
1086
|
where <state> is either a SC.State object or a string and <hash> is a regular JS hash object.
|
902
|
-
|
1087
|
+
|
903
1088
|
@param state {SC.State|String} the state to go to and follow it's history state
|
904
1089
|
@param fromCurrentState {SC.State|String} Optional. the current state to start the state transition process from
|
905
1090
|
@param recursive {Boolean} Optional. whether to follow history states recursively.
|
@@ -909,24 +1094,24 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
909
1094
|
this.statechartLogError("can not go to state %@'s history state. Statechart has not yet been initialized".fmt(state));
|
910
1095
|
return;
|
911
1096
|
}
|
912
|
-
|
1097
|
+
|
913
1098
|
var args = this._processGotoStateArgs(arguments);
|
914
|
-
|
1099
|
+
|
915
1100
|
state = args.state;
|
916
1101
|
fromCurrentState = args.fromCurrentState;
|
917
1102
|
recursive = args.useHistory;
|
918
1103
|
context = args.context;
|
919
|
-
|
1104
|
+
|
920
1105
|
state = this.getState(state);
|
921
|
-
|
1106
|
+
|
922
1107
|
if (!state) {
|
923
1108
|
this.statechartLogError("Can not to goto state %@'s history state. Not a recognized state in statechart".fmt(state));
|
924
1109
|
return;
|
925
1110
|
}
|
926
|
-
|
1111
|
+
|
927
1112
|
var historyState = state.get('historyState');
|
928
|
-
|
929
|
-
if (!recursive) {
|
1113
|
+
|
1114
|
+
if (!recursive) {
|
930
1115
|
if (historyState) {
|
931
1116
|
this.gotoState(historyState, fromCurrentState, context);
|
932
1117
|
} else {
|
@@ -936,44 +1121,43 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
936
1121
|
this.gotoState(state, fromCurrentState, YES, context);
|
937
1122
|
}
|
938
1123
|
},
|
939
|
-
|
1124
|
+
|
940
1125
|
/**
|
941
1126
|
Sends a given event to all the statechart's current states.
|
942
|
-
|
1127
|
+
|
943
1128
|
If a current state does can not respond to the sent event, then the current state's parent state
|
944
1129
|
will be tried. This process is recursively done until no more parent state can be tried.
|
945
|
-
|
1130
|
+
|
946
1131
|
Note that a state will only be checked once if it can respond to an event. Therefore, if
|
947
1132
|
there is a state S that handles event foo and S has concurrent substates, then foo will
|
948
|
-
only be invoked once; not as many times as there are substates.
|
949
|
-
|
1133
|
+
only be invoked once; not as many times as there are substates.
|
1134
|
+
|
950
1135
|
@param event {String} name of the event
|
951
1136
|
@param arg1 {Object} optional argument
|
952
1137
|
@param arg2 {Object} optional argument
|
953
1138
|
@returns {SC.Responder} the responder that handled it or null
|
954
|
-
|
1139
|
+
|
955
1140
|
@see #stateWillTryToHandleEvent
|
956
1141
|
@see #stateDidTryToHandleEvent
|
957
1142
|
*/
|
958
1143
|
sendEvent: function(event, arg1, arg2) {
|
959
|
-
|
1144
|
+
|
960
1145
|
if (this.get('isDestroyed')) {
|
961
|
-
this.statechartLogError("can send event %@. statechart is destroyed".fmt(event));
|
1146
|
+
this.statechartLogError("can not send event %@. statechart is destroyed".fmt(event));
|
962
1147
|
return;
|
963
1148
|
}
|
964
|
-
|
1149
|
+
|
965
1150
|
var statechartHandledEvent = NO,
|
966
1151
|
eventHandled = NO,
|
967
1152
|
currentStates = this.get('currentStates').slice(),
|
968
1153
|
checkedStates = {},
|
969
1154
|
len = 0,
|
970
1155
|
i = 0,
|
971
|
-
state = null
|
972
|
-
|
973
|
-
|
1156
|
+
state = null;
|
1157
|
+
|
974
1158
|
if (this._sendEventLocked || this._goStateLocked) {
|
975
|
-
// Want to prevent any actions from being processed by the states until
|
976
|
-
// they have had a chance to handle the most immediate action or completed
|
1159
|
+
// Want to prevent any actions from being processed by the states until
|
1160
|
+
// they have had a chance to handle the most immediate action or completed
|
977
1161
|
// a state transition
|
978
1162
|
this._pendingSentEvents.push({
|
979
1163
|
event: event,
|
@@ -983,13 +1167,16 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
983
1167
|
|
984
1168
|
return;
|
985
1169
|
}
|
986
|
-
|
1170
|
+
|
987
1171
|
this._sendEventLocked = YES;
|
988
|
-
|
1172
|
+
|
1173
|
+
//@if(debug)
|
1174
|
+
var trace = this.get('allowStatechartTracing');
|
989
1175
|
if (trace) {
|
990
1176
|
this.statechartLogTrace("BEGIN sendEvent: '%@'".fmt(event));
|
991
1177
|
}
|
992
|
-
|
1178
|
+
//@endif
|
1179
|
+
|
993
1180
|
len = currentStates.get('length');
|
994
1181
|
for (; i < len; i += 1) {
|
995
1182
|
eventHandled = NO;
|
@@ -1004,28 +1191,30 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1004
1191
|
else statechartHandledEvent = YES;
|
1005
1192
|
}
|
1006
1193
|
}
|
1007
|
-
|
1008
|
-
// Now that all the states have had a chance to process the
|
1194
|
+
|
1195
|
+
// Now that all the states have had a chance to process the
|
1009
1196
|
// first event, we can go ahead and flush any pending sent events.
|
1010
1197
|
this._sendEventLocked = NO;
|
1011
|
-
|
1198
|
+
|
1199
|
+
//@if(debug)
|
1012
1200
|
if (trace) {
|
1013
1201
|
if (!statechartHandledEvent) this.statechartLogTrace("No state was able handle event %@".fmt(event));
|
1014
1202
|
this.statechartLogTrace("END sendEvent: '%@'".fmt(event));
|
1015
1203
|
}
|
1016
|
-
|
1204
|
+
//@endif
|
1205
|
+
|
1017
1206
|
var result = this._flushPendingSentEvents();
|
1018
|
-
|
1207
|
+
|
1019
1208
|
return statechartHandledEvent ? this : (result ? this : null);
|
1020
1209
|
},
|
1021
|
-
|
1210
|
+
|
1022
1211
|
/**
|
1023
1212
|
Used to notify the statechart that a state will try to handle event that has been passed
|
1024
1213
|
to it.
|
1025
|
-
|
1214
|
+
|
1026
1215
|
@param {SC.State} state the state that will try to handle the event
|
1027
1216
|
@param {String} event the event the state will try to handle
|
1028
|
-
@param {String} handler the name of the method on the state that will try to handle the event
|
1217
|
+
@param {String} handler the name of the method on the state that will try to handle the event
|
1029
1218
|
*/
|
1030
1219
|
stateWillTryToHandleEvent: function(state, event, handler) {
|
1031
1220
|
this._stateHandleEventInfo = {
|
@@ -1034,67 +1223,65 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1034
1223
|
handler: handler
|
1035
1224
|
};
|
1036
1225
|
},
|
1037
|
-
|
1226
|
+
|
1038
1227
|
/**
|
1039
1228
|
Used to notify the statechart that a state did try to handle event that has been passed
|
1040
1229
|
to it.
|
1041
|
-
|
1230
|
+
|
1042
1231
|
@param {SC.State} state the state that did try to handle the event
|
1043
1232
|
@param {String} event the event the state did try to handle
|
1044
1233
|
@param {String} handler the name of the method on the state that did try to handle the event
|
1045
|
-
@param {Boolean} handled indicates if the handler was able to handle the event
|
1234
|
+
@param {Boolean} handled indicates if the handler was able to handle the event
|
1046
1235
|
*/
|
1047
1236
|
stateDidTryToHandleEvent: function(state, event, handler, handled) {
|
1048
1237
|
this._stateHandleEventInfo = null;
|
1049
1238
|
},
|
1050
1239
|
|
1051
1240
|
/** @private
|
1052
|
-
|
1241
|
+
|
1053
1242
|
Creates a chain of states from the given state to the greatest ancestor state (the root state). Used
|
1054
1243
|
when perform state transitions.
|
1055
1244
|
*/
|
1056
1245
|
_createStateChain: function(state) {
|
1057
1246
|
var chain = [];
|
1058
|
-
|
1247
|
+
|
1059
1248
|
while (state) {
|
1060
1249
|
chain.push(state);
|
1061
1250
|
state = state.get('parentState');
|
1062
1251
|
}
|
1063
|
-
|
1252
|
+
|
1064
1253
|
return chain;
|
1065
1254
|
},
|
1066
|
-
|
1255
|
+
|
1067
1256
|
/** @private
|
1068
|
-
|
1257
|
+
|
1069
1258
|
Finds a pivot state from two given state chains. The pivot state is the state indicating when states
|
1070
|
-
go from being exited to states being entered during the state transition process. The value
|
1071
|
-
returned is the fist matching state between the two given state chains.
|
1259
|
+
go from being exited to states being entered during the state transition process. The value
|
1260
|
+
returned is the fist matching state between the two given state chains.
|
1072
1261
|
*/
|
1073
1262
|
_findPivotState: function(stateChain1, stateChain2) {
|
1074
1263
|
if (stateChain1.length === 0 || stateChain2.length === 0) return null;
|
1075
|
-
|
1264
|
+
|
1076
1265
|
var pivot = stateChain1.find(function(state, index) {
|
1077
1266
|
if (stateChain2.indexOf(state) >= 0) return YES;
|
1078
1267
|
});
|
1079
|
-
|
1268
|
+
|
1080
1269
|
return pivot;
|
1081
1270
|
},
|
1082
|
-
|
1271
|
+
|
1083
1272
|
/** @private
|
1084
|
-
|
1273
|
+
|
1085
1274
|
Recursively follow states that are to be exited during a state transition process. The exit
|
1086
1275
|
process is to start from the given state and work its way up to when either all exit
|
1087
1276
|
states have been reached based on a given exit path or when a stop state has been reached.
|
1088
|
-
|
1277
|
+
|
1089
1278
|
@param state {State} the state to be exited
|
1090
1279
|
@param exitStatePath {Array} an array representing a path of states that are to be exited
|
1091
1280
|
@param stopState {State} an explicit state in which to stop the exiting process
|
1092
1281
|
*/
|
1093
|
-
_traverseStatesToExit: function(state, exitStatePath, stopState, gotoStateActions) {
|
1282
|
+
_traverseStatesToExit: function(state, exitStatePath, stopState, gotoStateActions) {
|
1094
1283
|
if (!state || state === stopState) return;
|
1095
|
-
|
1096
|
-
var trace = this.get('allowStatechartTracing');
|
1097
|
-
|
1284
|
+
|
1098
1285
|
// This state has concurrent substates. Therefore we have to make sure we
|
1099
1286
|
// exit them up to this state before we can go any further up the exit chain.
|
1100
1287
|
if (state.get('substatesAreConcurrent')) {
|
@@ -1102,7 +1289,7 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1102
1289
|
currentSubstates = state.get('currentSubstates'),
|
1103
1290
|
len = currentSubstates.length,
|
1104
1291
|
currentState = null;
|
1105
|
-
|
1292
|
+
|
1106
1293
|
for (; i < len; i += 1) {
|
1107
1294
|
currentState = currentSubstates[i];
|
1108
1295
|
if (currentState._traverseStatesToExit_skipState === YES) continue;
|
@@ -1110,30 +1297,28 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1110
1297
|
this._traverseStatesToExit(chain.shift(), chain, state, gotoStateActions);
|
1111
1298
|
}
|
1112
1299
|
}
|
1113
|
-
|
1300
|
+
|
1114
1301
|
gotoStateActions.push({ action: SC.EXIT_STATE, state: state });
|
1115
1302
|
if (state.get('isCurrentState')) state._traverseStatesToExit_skipState = YES;
|
1116
1303
|
this._traverseStatesToExit(exitStatePath.shift(), exitStatePath, stopState, gotoStateActions);
|
1117
1304
|
},
|
1118
|
-
|
1305
|
+
|
1119
1306
|
/** @private
|
1120
|
-
|
1307
|
+
|
1121
1308
|
Recursively follow states that are to be entered during the state transition process. The
|
1122
1309
|
enter process is to start from the given state and work its way down a given enter path. When
|
1123
|
-
the end of enter path has been reached, then continue entering states based on whether
|
1310
|
+
the end of enter path has been reached, then continue entering states based on whether
|
1124
1311
|
an initial substate is defined, there are concurrent substates or history states are to be
|
1125
1312
|
followed; when none of those condition are met then the enter process is done.
|
1126
|
-
|
1313
|
+
|
1127
1314
|
@param state {State} the sate to be entered
|
1128
1315
|
@param enterStatePath {Array} an array representing an initial path of states that are to be entered
|
1129
1316
|
@param pivotState {State} The state pivoting when to go from exiting states to entering states
|
1130
|
-
@param useHistory {Boolean} indicates whether to recursively follow history states
|
1317
|
+
@param useHistory {Boolean} indicates whether to recursively follow history states
|
1131
1318
|
*/
|
1132
1319
|
_traverseStatesToEnter: function(state, enterStatePath, pivotState, useHistory, gotoStateActions) {
|
1133
1320
|
if (!state) return;
|
1134
|
-
|
1135
|
-
var trace = this.get('allowStatechartTracing');
|
1136
|
-
|
1321
|
+
|
1137
1322
|
// We do not want to enter states in the enter path until the pivot state has been reached. After
|
1138
1323
|
// the pivot state has been reached, then we can go ahead and actually enter states.
|
1139
1324
|
if (pivotState) {
|
@@ -1143,49 +1328,49 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1143
1328
|
this._traverseStatesToEnter(enterStatePath.pop(), enterStatePath, null, useHistory, gotoStateActions);
|
1144
1329
|
}
|
1145
1330
|
}
|
1146
|
-
|
1147
|
-
// If no more explicit enter path instructions, then default to enter states based on
|
1331
|
+
|
1332
|
+
// If no more explicit enter path instructions, then default to enter states based on
|
1148
1333
|
// other criteria
|
1149
1334
|
else if (!enterStatePath || enterStatePath.length === 0) {
|
1150
1335
|
var gotoStateAction = { action: SC.ENTER_STATE, state: state, currentState: NO };
|
1151
1336
|
gotoStateActions.push(gotoStateAction);
|
1152
|
-
|
1337
|
+
|
1153
1338
|
var initialSubstate = state.get('initialSubstate'),
|
1154
1339
|
historyState = state.get('historyState');
|
1155
|
-
|
1340
|
+
|
1156
1341
|
// State has concurrent substates. Need to enter all of the substates
|
1157
1342
|
if (state.get('substatesAreConcurrent')) {
|
1158
1343
|
this._traverseConcurrentStatesToEnter(state.get('substates'), null, useHistory, gotoStateActions);
|
1159
1344
|
}
|
1160
|
-
|
1345
|
+
|
1161
1346
|
// State has substates and we are instructed to recursively follow the state's
|
1162
1347
|
// history state if it has one.
|
1163
1348
|
else if (state.get('hasSubstates') && historyState && useHistory) {
|
1164
1349
|
this._traverseStatesToEnter(historyState, null, null, useHistory, gotoStateActions);
|
1165
1350
|
}
|
1166
|
-
|
1351
|
+
|
1167
1352
|
// State has an initial substate to enter
|
1168
1353
|
else if (initialSubstate) {
|
1169
1354
|
if (SC.kindOf(initialSubstate, SC.HistoryState)) {
|
1170
1355
|
if (!useHistory) useHistory = initialSubstate.get('isRecursive');
|
1171
1356
|
initialSubstate = initialSubstate.get('state');
|
1172
1357
|
}
|
1173
|
-
this._traverseStatesToEnter(initialSubstate, null, null, useHistory, gotoStateActions);
|
1174
|
-
}
|
1175
|
-
|
1358
|
+
this._traverseStatesToEnter(initialSubstate, null, null, useHistory, gotoStateActions);
|
1359
|
+
}
|
1360
|
+
|
1176
1361
|
// Looks like we hit the end of the road. Therefore the state has now become
|
1177
1362
|
// a current state of the statechart.
|
1178
1363
|
else {
|
1179
1364
|
gotoStateAction.currentState = YES;
|
1180
1365
|
}
|
1181
1366
|
}
|
1182
|
-
|
1367
|
+
|
1183
1368
|
// Still have an explicit enter path to follow, so keep moving through the path.
|
1184
1369
|
else if (enterStatePath.length > 0) {
|
1185
1370
|
gotoStateActions.push({ action: SC.ENTER_STATE, state: state });
|
1186
1371
|
var nextState = enterStatePath.pop();
|
1187
|
-
this._traverseStatesToEnter(nextState, enterStatePath, null, useHistory, gotoStateActions);
|
1188
|
-
|
1372
|
+
this._traverseStatesToEnter(nextState, enterStatePath, null, useHistory, gotoStateActions);
|
1373
|
+
|
1189
1374
|
// We hit a state that has concurrent substates. Must go through each of the substates
|
1190
1375
|
// and enter them
|
1191
1376
|
if (state.get('substatesAreConcurrent')) {
|
@@ -1193,20 +1378,26 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1193
1378
|
}
|
1194
1379
|
}
|
1195
1380
|
},
|
1196
|
-
|
1381
|
+
|
1197
1382
|
/** @override
|
1198
|
-
|
1383
|
+
|
1199
1384
|
Returns YES if the named value translates into an executable function on
|
1200
1385
|
any of the statechart's current states or the statechart itself.
|
1201
|
-
|
1386
|
+
|
1202
1387
|
@param event {String} the property name to check
|
1203
1388
|
@returns {Boolean}
|
1204
1389
|
*/
|
1205
1390
|
respondsTo: function(event) {
|
1391
|
+
// Fast path!
|
1392
|
+
if (this.get('isDestroyed')) {
|
1393
|
+
this.statechartLogError("can not respond to event %@. statechart is destroyed".fmt(event));
|
1394
|
+
return false;
|
1395
|
+
}
|
1396
|
+
|
1206
1397
|
var currentStates = this.get('currentStates'),
|
1207
|
-
len = currentStates.get('length'),
|
1398
|
+
len = currentStates.get('length'),
|
1208
1399
|
i = 0, state = null;
|
1209
|
-
|
1400
|
+
|
1210
1401
|
for (; i < len; i += 1) {
|
1211
1402
|
state = currentStates.objectAt(i);
|
1212
1403
|
while (state) {
|
@@ -1214,17 +1405,17 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1214
1405
|
state = state.get('parentState');
|
1215
1406
|
}
|
1216
1407
|
}
|
1217
|
-
|
1408
|
+
|
1218
1409
|
// None of the current states can respond. Now check the statechart itself
|
1219
|
-
return SC.typeOf(this[event]) === SC.T_FUNCTION;
|
1410
|
+
return SC.typeOf(this[event]) === SC.T_FUNCTION;
|
1220
1411
|
},
|
1221
|
-
|
1412
|
+
|
1222
1413
|
/** @override
|
1223
|
-
|
1414
|
+
|
1224
1415
|
Attempts to handle a given event against any of the statechart's current states and the
|
1225
1416
|
statechart itself. If any current state can handle the event or the statechart itself can
|
1226
1417
|
handle the event then YES is returned, otherwise NO is returned.
|
1227
|
-
|
1418
|
+
|
1228
1419
|
@param event {String} what to perform
|
1229
1420
|
@param arg1 {Object} Optional
|
1230
1421
|
@param arg2 {Object} Optional
|
@@ -1237,57 +1428,57 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1237
1428
|
var result = this[event](arg1, arg2);
|
1238
1429
|
if (result !== NO) return YES;
|
1239
1430
|
}
|
1240
|
-
|
1431
|
+
|
1241
1432
|
return !!this.sendEvent(event, arg1, arg2);
|
1242
1433
|
},
|
1243
|
-
|
1434
|
+
|
1244
1435
|
/**
|
1245
1436
|
Used to invoke a method on current states. If the method can not be executed
|
1246
1437
|
on a current state, then the state's parent states will be tried in order
|
1247
1438
|
of closest ancestry.
|
1248
|
-
|
1249
|
-
A few notes:
|
1250
|
-
|
1439
|
+
|
1440
|
+
A few notes:
|
1441
|
+
|
1251
1442
|
1. Calling this is not the same as calling sendEvent or sendAction.
|
1252
|
-
Rather, this should be seen as calling normal methods on a state that
|
1443
|
+
Rather, this should be seen as calling normal methods on a state that
|
1253
1444
|
will *not* call gotoState or gotoHistoryState.
|
1254
|
-
2. A state will only ever be invoked once per call. So if there are two
|
1255
|
-
or more current states that have the same parent state, then that parent
|
1445
|
+
2. A state will only ever be invoked once per call. So if there are two
|
1446
|
+
or more current states that have the same parent state, then that parent
|
1256
1447
|
state will only be invoked once if none of the current states are able
|
1257
1448
|
to invoke the given method.
|
1258
|
-
|
1449
|
+
|
1259
1450
|
When calling this method, you are able to supply zero ore more arguments
|
1260
1451
|
that can be pass onto the method called on the states. As an example
|
1261
|
-
|
1452
|
+
|
1262
1453
|
invokeStateMethod('render', context, firstTime);
|
1263
|
-
|
1454
|
+
|
1264
1455
|
The above call will invoke the render method on the current states
|
1265
|
-
and supply the context and firstTime arguments to the method.
|
1266
|
-
|
1267
|
-
Because a statechart can have more than one current state and the method
|
1268
|
-
invoked may return a value, the addition of a callback function may be provided
|
1456
|
+
and supply the context and firstTime arguments to the method.
|
1457
|
+
|
1458
|
+
Because a statechart can have more than one current state and the method
|
1459
|
+
invoked may return a value, the addition of a callback function may be provided
|
1269
1460
|
in order to handle the returned value for each state. As an example, let's say
|
1270
1461
|
we want to call a calculate method on the current states where the method
|
1271
1462
|
will return a value when invoked. We can handle the returned values like so:
|
1272
|
-
|
1463
|
+
|
1273
1464
|
invokeStateMethod('calculate', value, function(state, result) {
|
1274
1465
|
// .. handle the result returned from calculate that was invoked
|
1275
1466
|
// on the given state
|
1276
1467
|
})
|
1277
|
-
|
1468
|
+
|
1278
1469
|
If the method invoked does not return a value and a callback function is
|
1279
1470
|
supplied, then result value will simply be undefined. In all cases, if
|
1280
1471
|
a callback function is given, it must be the last value supplied to this
|
1281
1472
|
method.
|
1282
|
-
|
1283
|
-
invokeStateMethod will return a value if only one state was able to have
|
1284
|
-
the given method invoked on it, otherwise no value is returned.
|
1285
|
-
|
1473
|
+
|
1474
|
+
invokeStateMethod will return a value if only one state was able to have
|
1475
|
+
the given method invoked on it, otherwise no value is returned.
|
1476
|
+
|
1286
1477
|
@param methodName {String} methodName a method name
|
1287
1478
|
@param args {Object...} Optional. any additional arguments
|
1288
1479
|
@param func {Function} Optional. a callback function. Must be the last
|
1289
1480
|
value supplied if provided.
|
1290
|
-
|
1481
|
+
|
1291
1482
|
@returns a value if the number of current states is one, otherwise undefined
|
1292
1483
|
is returned. The value is the result of the method that got invoked
|
1293
1484
|
on a state.
|
@@ -1297,18 +1488,19 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1297
1488
|
this.statechartLogError("can not invoke method unkownEvent");
|
1298
1489
|
return;
|
1299
1490
|
}
|
1300
|
-
|
1301
|
-
args = SC.A(arguments);
|
1302
|
-
|
1303
|
-
|
1491
|
+
|
1492
|
+
args = SC.A(arguments);
|
1493
|
+
args.shift();
|
1494
|
+
|
1495
|
+
var len = args.length,
|
1304
1496
|
arg = len > 0 ? args[len - 1] : null,
|
1305
1497
|
callback = SC.typeOf(arg) === SC.T_FUNCTION ? args.pop() : null,
|
1306
|
-
currentStates = this.get('currentStates'),
|
1498
|
+
currentStates = this.get('currentStates'),
|
1307
1499
|
i = 0, state = null, checkedStates = {},
|
1308
1500
|
method, result = undefined, calledStates = 0;
|
1309
|
-
|
1501
|
+
|
1310
1502
|
len = currentStates.get('length');
|
1311
|
-
|
1503
|
+
|
1312
1504
|
for (; i < len; i += 1) {
|
1313
1505
|
state = currentStates.objectAt(i);
|
1314
1506
|
while (state) {
|
@@ -1318,34 +1510,34 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1318
1510
|
if (SC.typeOf(method) === SC.T_FUNCTION && !method.isEventHandler) {
|
1319
1511
|
result = method.apply(state, args);
|
1320
1512
|
if (callback) callback.call(this, state, result);
|
1321
|
-
calledStates += 1;
|
1513
|
+
calledStates += 1;
|
1322
1514
|
break;
|
1323
1515
|
}
|
1324
1516
|
state = state.get('parentState');
|
1325
1517
|
}
|
1326
1518
|
}
|
1327
|
-
|
1519
|
+
|
1328
1520
|
return calledStates === 1 ? result : undefined;
|
1329
1521
|
},
|
1330
|
-
|
1522
|
+
|
1331
1523
|
/** @private
|
1332
|
-
|
1524
|
+
|
1333
1525
|
Iterate over all the given concurrent states and enter them
|
1334
1526
|
*/
|
1335
1527
|
_traverseConcurrentStatesToEnter: function(states, exclude, useHistory, gotoStateActions) {
|
1336
1528
|
var i = 0,
|
1337
1529
|
len = states.length,
|
1338
1530
|
state = null;
|
1339
|
-
|
1531
|
+
|
1340
1532
|
for (; i < len; i += 1) {
|
1341
1533
|
state = states[i];
|
1342
1534
|
if (state !== exclude) this._traverseStatesToEnter(state, null, null, useHistory, gotoStateActions);
|
1343
1535
|
}
|
1344
1536
|
},
|
1345
|
-
|
1537
|
+
|
1346
1538
|
/** @private
|
1347
|
-
|
1348
|
-
Called by gotoState to flush a pending state transition at the front of the
|
1539
|
+
|
1540
|
+
Called by gotoState to flush a pending state transition at the front of the
|
1349
1541
|
pending queue.
|
1350
1542
|
*/
|
1351
1543
|
_flushPendingStateTransition: function() {
|
@@ -1357,7 +1549,7 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1357
1549
|
if (!pending) return;
|
1358
1550
|
this.gotoState(pending.state, pending.fromCurrentState, pending.useHistory, pending.context);
|
1359
1551
|
},
|
1360
|
-
|
1552
|
+
|
1361
1553
|
/** @private
|
1362
1554
|
|
1363
1555
|
Called by sendEvent to flush a pending actions at the front of the pending
|
@@ -1368,44 +1560,46 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1368
1560
|
if (!pending) return null;
|
1369
1561
|
return this.sendEvent(pending.event, pending.arg1, pending.arg2);
|
1370
1562
|
},
|
1371
|
-
|
1563
|
+
|
1372
1564
|
/** @private */
|
1565
|
+
//@if(debug)
|
1373
1566
|
_monitorIsActiveDidChange: function() {
|
1374
1567
|
if (this.get('monitorIsActive') && SC.none(this.get('monitor'))) {
|
1375
1568
|
this.set('monitor', SC.StatechartMonitor.create());
|
1376
1569
|
}
|
1377
1570
|
}.observes('monitorIsActive'),
|
1378
|
-
|
1379
|
-
|
1571
|
+
//@endif
|
1572
|
+
|
1573
|
+
/** @private
|
1380
1574
|
Will process the arguments supplied to the gotoState method.
|
1381
|
-
|
1575
|
+
|
1382
1576
|
TODO: Come back to this and refactor the code. It works, but it
|
1383
1577
|
could certainly be improved
|
1384
1578
|
*/
|
1385
1579
|
_processGotoStateArgs: function(args) {
|
1386
|
-
var processedArgs = {
|
1387
|
-
state: null,
|
1388
|
-
fromCurrentState: null,
|
1389
|
-
useHistory: false,
|
1390
|
-
context: null
|
1580
|
+
var processedArgs = {
|
1581
|
+
state: null,
|
1582
|
+
fromCurrentState: null,
|
1583
|
+
useHistory: false,
|
1584
|
+
context: null
|
1391
1585
|
},
|
1392
1586
|
len = null,
|
1393
1587
|
value = null;
|
1394
|
-
|
1588
|
+
|
1395
1589
|
args = SC.$A(args);
|
1396
1590
|
args = args.filter(function(item) {
|
1397
|
-
return !(item === undefined);
|
1591
|
+
return !(item === undefined);
|
1398
1592
|
});
|
1399
1593
|
len = args.length;
|
1400
|
-
|
1594
|
+
|
1401
1595
|
if (len < 1) return processedArgs;
|
1402
|
-
|
1596
|
+
|
1403
1597
|
processedArgs.state = args[0];
|
1404
|
-
|
1598
|
+
|
1405
1599
|
if (len === 2) {
|
1406
1600
|
value = args[1];
|
1407
1601
|
switch (SC.typeOf(value)) {
|
1408
|
-
case SC.T_BOOL:
|
1602
|
+
case SC.T_BOOL:
|
1409
1603
|
processedArgs.useHistory = value;
|
1410
1604
|
break;
|
1411
1605
|
case SC.T_HASH:
|
@@ -1438,20 +1632,20 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1438
1632
|
processedArgs.useHistory = args[2];
|
1439
1633
|
processedArgs.context = args[3];
|
1440
1634
|
}
|
1441
|
-
|
1635
|
+
|
1442
1636
|
return processedArgs;
|
1443
1637
|
},
|
1444
|
-
|
1445
|
-
/** @private
|
1446
|
-
|
1638
|
+
|
1639
|
+
/** @private
|
1640
|
+
|
1447
1641
|
Will return a newly constructed root state class. The root state will have substates added to
|
1448
1642
|
it based on properties found on this state that derive from a SC.State class. For the
|
1449
1643
|
root state to be successfully built, the following much be met:
|
1450
|
-
|
1644
|
+
|
1451
1645
|
- The rootStateExample property must be defined with a class that derives from SC.State
|
1452
1646
|
- Either the initialState or statesAreConcurrent property must be set, but not both
|
1453
1647
|
- There must be one or more states that can be added to the root state
|
1454
|
-
|
1648
|
+
|
1455
1649
|
*/
|
1456
1650
|
_constructRootStateClass: function() {
|
1457
1651
|
var rsExampleKey = 'rootStateExample',
|
@@ -1460,7 +1654,7 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1460
1654
|
statesAreConcurrent = this.get('statesAreConcurrent'),
|
1461
1655
|
stateCount = 0,
|
1462
1656
|
key, value, valueIsFunc, attrs = {};
|
1463
|
-
|
1657
|
+
|
1464
1658
|
if (SC.typeOf(rsExample) === SC.T_FUNCTION && rsExample.statePlugin) {
|
1465
1659
|
rsExample = rsExample.apply(this);
|
1466
1660
|
}
|
@@ -1469,7 +1663,7 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1469
1663
|
this._logStatechartCreationError("Invalid root state example");
|
1470
1664
|
return null;
|
1471
1665
|
}
|
1472
|
-
|
1666
|
+
|
1473
1667
|
if (statesAreConcurrent && !SC.empty(initialState)) {
|
1474
1668
|
this._logStatechartCreationError("Can not assign an initial state when states are concurrent");
|
1475
1669
|
} else if (statesAreConcurrent) {
|
@@ -1480,211 +1674,67 @@ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
|
|
1480
1674
|
this._logStatechartCreationError("Must either define initial state or assign states as concurrent");
|
1481
1675
|
return null;
|
1482
1676
|
}
|
1483
|
-
|
1677
|
+
|
1484
1678
|
for (key in this) {
|
1485
1679
|
if (key === rsExampleKey) continue;
|
1486
|
-
|
1680
|
+
|
1487
1681
|
value = this[key];
|
1488
1682
|
valueIsFunc = SC.typeOf(value) === SC.T_FUNCTION;
|
1489
|
-
|
1683
|
+
|
1490
1684
|
if (valueIsFunc && value.statePlugin) {
|
1491
1685
|
value = value.apply(this);
|
1492
1686
|
}
|
1493
|
-
|
1687
|
+
|
1494
1688
|
if (SC.kindOf(value, SC.State) && value.isClass && this[key] !== this.constructor) {
|
1495
1689
|
attrs[key] = value;
|
1496
1690
|
stateCount += 1;
|
1497
1691
|
}
|
1498
1692
|
}
|
1499
|
-
|
1693
|
+
|
1500
1694
|
if (stateCount === 0) {
|
1501
1695
|
this._logStatechartCreationError("Must define one or more states");
|
1502
1696
|
return null;
|
1503
1697
|
}
|
1504
|
-
|
1698
|
+
|
1505
1699
|
return rsExample.extend(attrs);
|
1506
1700
|
},
|
1507
|
-
|
1701
|
+
|
1508
1702
|
/** @private */
|
1509
1703
|
_logStatechartCreationError: function(msg) {
|
1510
1704
|
SC.Logger.error("Unable to create statechart for %@: %@.".fmt(this, msg));
|
1511
1705
|
},
|
1512
|
-
|
1513
|
-
/**
|
1514
|
-
Used to log a statechart trace message
|
1515
|
-
*/
|
1516
|
-
statechartLogTrace: function(msg) {
|
1517
|
-
SC.Logger.info("%@: %@".fmt(this.get('statechartLogPrefix'), msg));
|
1518
|
-
},
|
1519
|
-
|
1706
|
+
|
1520
1707
|
/**
|
1521
1708
|
Used to log a statechart error message
|
1522
1709
|
*/
|
1523
1710
|
statechartLogError: function(msg) {
|
1524
1711
|
SC.Logger.error("ERROR %@: %@".fmt(this.get('statechartLogPrefix'), msg));
|
1525
1712
|
},
|
1526
|
-
|
1527
|
-
/**
|
1713
|
+
|
1714
|
+
/**
|
1528
1715
|
Used to log a statechart warning message
|
1529
1716
|
*/
|
1530
1717
|
statechartLogWarning: function(msg) {
|
1531
1718
|
if (this.get('suppressStatechartWarnings')) return;
|
1532
1719
|
SC.Logger.warn("WARN %@: %@".fmt(this.get('statechartLogPrefix'), msg));
|
1533
1720
|
},
|
1534
|
-
|
1721
|
+
|
1535
1722
|
/** @property */
|
1536
1723
|
statechartLogPrefix: function() {
|
1537
1724
|
var className = SC._object_className(this.constructor),
|
1538
1725
|
name = this.get('name'), prefix;
|
1539
|
-
|
1726
|
+
|
1540
1727
|
if (SC.empty(name)) prefix = "%@<%@>".fmt(className, SC.guidFor(this));
|
1541
1728
|
else prefix = "%@<%@, %@>".fmt(className, name, SC.guidFor(this));
|
1542
|
-
|
1543
|
-
return prefix;
|
1544
|
-
}.property().cacheable(),
|
1545
|
-
|
1546
|
-
/** @private @property */
|
1547
|
-
allowStatechartTracing: function() {
|
1548
|
-
var key = this.get('statechartTraceKey');
|
1549
|
-
return this.get(key);
|
1550
|
-
}.property().cacheable(),
|
1551
|
-
|
1552
|
-
/** @private */
|
1553
|
-
_statechartTraceDidChange: function() {
|
1554
|
-
this.notifyPropertyChange('allowStatechartTracing');
|
1555
|
-
},
|
1556
|
-
|
1557
|
-
/**
|
1558
|
-
@property
|
1559
|
-
|
1560
|
-
Returns an object containing current detailed information about
|
1561
|
-
the statechart. This is primarily used for diagnostic/debugging
|
1562
|
-
purposes.
|
1563
|
-
|
1564
|
-
Detailed information includes:
|
1565
|
-
|
1566
|
-
- current states
|
1567
|
-
- state transtion information
|
1568
|
-
- event handling information
|
1569
|
-
|
1570
|
-
@returns {Hash}
|
1571
|
-
*/
|
1572
|
-
details: function() {
|
1573
|
-
var details = {
|
1574
|
-
'initialized': this.get('statechartIsInitialized')
|
1575
|
-
};
|
1576
|
-
|
1577
|
-
if (this.get('name')) {
|
1578
|
-
details['name'] = this.get('name');
|
1579
|
-
}
|
1580
|
-
|
1581
|
-
if (!this.get('statechartIsInitialized')) {
|
1582
|
-
return details;
|
1583
|
-
}
|
1584
|
-
|
1585
|
-
details['current-states'] = [];
|
1586
|
-
this.get('currentStates').forEach(function(state) {
|
1587
|
-
details['current-states'].push(state.get('fullPath'));
|
1588
|
-
});
|
1589
|
-
|
1590
|
-
var stateTransition = {
|
1591
|
-
active: this.get('gotoStateActive'),
|
1592
|
-
suspended: this.get('gotoStateSuspended')
|
1593
|
-
};
|
1594
|
-
|
1595
|
-
if (this._gotoStateActions) {
|
1596
|
-
stateTransition['transition-sequence'] = [];
|
1597
|
-
var actions = this._gotoStateActions,
|
1598
|
-
actionToStr = function(action) {
|
1599
|
-
var actionName = action.action === SC.ENTER_STATE ? "enter" : "exit";
|
1600
|
-
return "%@ %@".fmt(actionName, action.state.get('fullPath'));
|
1601
|
-
};
|
1602
|
-
|
1603
|
-
actions.forEach(function(action) {
|
1604
|
-
stateTransition['transition-sequence'].push(actionToStr(action));
|
1605
|
-
});
|
1606
|
-
|
1607
|
-
stateTransition['current-transition'] = actionToStr(this._currentGotoStateAction);
|
1608
|
-
}
|
1609
|
-
|
1610
|
-
details['state-transition'] = stateTransition;
|
1611
|
-
|
1612
|
-
if (this._stateHandleEventInfo) {
|
1613
|
-
var info = this._stateHandleEventInfo;
|
1614
|
-
details['handling-event'] = {
|
1615
|
-
state: info.state.get('fullPath'),
|
1616
|
-
event: info.event,
|
1617
|
-
handler: info.handler
|
1618
|
-
};
|
1619
|
-
} else {
|
1620
|
-
details['handling-event'] = false;
|
1621
|
-
}
|
1622
|
-
|
1623
|
-
return details;
|
1624
|
-
}.property(),
|
1625
1729
|
|
1626
|
-
|
1627
|
-
|
1628
|
-
for diagnostic/debugging purposes.
|
1629
|
-
|
1630
|
-
@returns {String}
|
1631
|
-
|
1632
|
-
@see #details
|
1633
|
-
*/
|
1634
|
-
toStringWithDetails: function() {
|
1635
|
-
var str = "",
|
1636
|
-
header = this.toString(),
|
1637
|
-
details = this.get('details');
|
1638
|
-
|
1639
|
-
str += header + "\n";
|
1640
|
-
str += this._hashToString(details, 2);
|
1641
|
-
|
1642
|
-
return str;
|
1643
|
-
},
|
1730
|
+
return prefix;
|
1731
|
+
}.property().cacheable()
|
1644
1732
|
|
1645
|
-
/** @private */
|
1646
|
-
_hashToString: function(hash, indent) {
|
1647
|
-
var str = "";
|
1648
|
-
|
1649
|
-
for (var key in hash) {
|
1650
|
-
var value = hash[key];
|
1651
|
-
if (value instanceof Array) {
|
1652
|
-
str += this._arrayToString(key, value, indent) + "\n";
|
1653
|
-
}
|
1654
|
-
else if (value instanceof Object) {
|
1655
|
-
str += "%@%@:\n".fmt(' '.mult(indent), key);
|
1656
|
-
str += this._hashToString(value, indent + 2);
|
1657
|
-
}
|
1658
|
-
else {
|
1659
|
-
str += "%@%@: %@\n".fmt(' '.mult(indent), key, value);
|
1660
|
-
}
|
1661
|
-
}
|
1662
|
-
|
1663
|
-
return str;
|
1664
|
-
},
|
1665
|
-
|
1666
|
-
/** @private */
|
1667
|
-
_arrayToString: function(key, array, indent) {
|
1668
|
-
if (array.length === 0) {
|
1669
|
-
return "%@%@: []".fmt(' '.mult(indent), key);
|
1670
|
-
}
|
1671
|
-
|
1672
|
-
var str = "%@%@: [\n".fmt(' '.mult(indent), key);
|
1673
|
-
|
1674
|
-
array.forEach(function(item, idx) {
|
1675
|
-
str += "%@%@\n".fmt(' '.mult(indent + 2), item);
|
1676
|
-
}, this);
|
1677
|
-
|
1678
|
-
str += ' '.mult(indent) + "]";
|
1679
|
-
|
1680
|
-
return str;
|
1681
|
-
}
|
1682
|
-
|
1683
1733
|
};
|
1684
1734
|
|
1685
|
-
SC.mixin(SC.StatechartManager, SC.StatechartDelegate, SC.DelegateSupport);
|
1735
|
+
SC.mixin(SC.StatechartManager, SC.StatechartDelegate, SC.DelegateSupport);
|
1686
1736
|
|
1687
|
-
/**
|
1737
|
+
/**
|
1688
1738
|
The default name given to a statechart's root state
|
1689
1739
|
*/
|
1690
1740
|
SC.ROOT_STATE_NAME = "__ROOT_STATE__";
|
@@ -1696,7 +1746,7 @@ SC.EXIT_STATE = 0;
|
|
1696
1746
|
SC.ENTER_STATE = 1;
|
1697
1747
|
|
1698
1748
|
/**
|
1699
|
-
A
|
1749
|
+
A Statechart class.
|
1700
1750
|
*/
|
1701
1751
|
SC.Statechart = SC.Object.extend(SC.StatechartManager, {
|
1702
1752
|
autoInitStatechart: NO
|