sproutcore 1.5.0-java → 1.6.0.beta.2-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.mailmap +32 -0
- data/CHANGELOG +15 -0
- data/Rakefile +18 -0
- data/VERSION.yml +2 -2
- data/bin/sc-build +0 -5
- data/bin/sc-build-number +0 -5
- data/bin/sc-docs +0 -5
- data/bin/sc-gen +0 -5
- data/bin/sc-init +0 -5
- data/bin/sc-manifest +0 -5
- data/bin/sc-server +0 -5
- data/bin/sproutcore +0 -5
- data/lib/frameworks/sproutcore/Buildfile +3 -3
- data/lib/frameworks/sproutcore/CHANGELOG.md +21 -0
- data/lib/frameworks/sproutcore/README.md +77 -7
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +1 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controls/button.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +23 -21
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/delegate_support.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +36 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +126 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +13 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +16 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +1 -34
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +29 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +8 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +20 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controls/button.js +78 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/checkbox_support.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +115 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +49 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +19 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +38 -41
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/base.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +7 -82
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +12 -5
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/array_observers.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/debug/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +33 -30
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +12 -11
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +20 -20
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +10 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +24 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +51 -54
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +29 -29
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/master_detail.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +31 -31
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +35 -29
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +61 -50
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +9 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +6 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +2 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/coders/object.js +12 -12
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/designs.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/page_files.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/css/css_style_sheet.js +7 -9
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/object_designer.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/view_designer.js +37 -37
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/object.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/page.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/view.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/mixins/snap_lines.js +7 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/designer_drop_target.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/drawing.js +49 -42
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/high_light.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/page_item_view.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/english.lproj/default_styles.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/english.lproj/strings.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/mixins/edit_mode.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/mixins/emptiness.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/render_delegates/form.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/render_delegates/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_checkbox_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_label.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_radio_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_text_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/views/form.js +13 -14
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/views/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +4 -6
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/system/image_queue.js +8 -12
- data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +28 -34
- data/lib/frameworks/sproutcore/frameworks/{foundation → routing}/system/routes.js +31 -47
- data/lib/frameworks/sproutcore/frameworks/{foundation → routing}/tests/system/routes.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +15 -21
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array_observers.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +66 -133
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +68 -139
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +11 -11
- data/lib/frameworks/sproutcore/frameworks/testing/system/suite.js +23 -29
- data/lib/frameworks/sproutcore/lib/index.rhtml +5 -2
- data/lib/sproutcore.rb +2 -9
- data/lib/sproutcore/builders/minify.rb +5 -5
- data/lib/sproutcore/helpers/minifier.rb +6 -10
- data/lib/sproutcore/models/target.rb +2 -2
- data/lib/sproutcore/rack/proxy.rb +8 -7
- data/lib/sproutcore/tools.rb +16 -5
- data/spec/lib/builders/html_spec.rb +5 -5
- data/sproutcore.gemspec +11 -5
- data/vendor/chance/lib/chance.rb +4 -2
- data/{lib/sproutcore/vendor → vendor}/jsdoc/README.txt +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Chain.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Dumper.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Hash.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Link.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Namespace.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Opt.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Reflection.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/String.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Testrun.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/FOODOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/DocComment.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/DocTag.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/JsDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/JsPlate.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Lang.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Parser.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/PluginManager.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Symbol.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TextStream.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Token.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TokenReader.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TokenStream.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Util.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Walker.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/main.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/commentSrcJson.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/frameworkPrototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/functionCall.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/publishSrcHilite.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/sproutcoreTags.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/symbolLink.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/tagParamConfig.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/tagSynonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/run.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/t/TestDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/t/runner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/addon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/anon_inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/augments.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/augments2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/borrows.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/borrows2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/config.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/constructs.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/encoding.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/encoding_other.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/functions_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/functions_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/global.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/globals.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/ignore.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/jsdoc_test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/lend.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/memberof.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/memberof_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/name.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/namespace_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/nocode.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/oblit_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/overview.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/param_inline.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/params_optional.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_oblit.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_oblit_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/public.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shared.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shared2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shortcuts.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/static_this.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/synonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/tosource.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/variable_redefine.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/changes.txt +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/conf/sample.conf +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/build.xml +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/build_1.4.xml +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/classes/js.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/src/JsDebugRun.java +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/src/JsRun.java +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/jsdebug.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/jsrun.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/t/TestDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/t/runner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/addon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/anon_inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/augments.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/augments2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/borrows.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/borrows2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/config.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/constructs.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/encoding.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/encoding_other.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/functions_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/functions_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/global.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/globals.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/ignore.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/jsdoc_test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/lend.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/memberof.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/memberof_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/name.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/namespace_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/nocode.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/oblit_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/overview.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/param_inline.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/params_optional.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_oblit.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_oblit_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/public.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shared.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shared2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shortcuts.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/static_this.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/synonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/tosource.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/variable_redefine.js +0 -0
- data/vendor/sproutcore/{src/SCCompiler/lib/yuicompressor-2.4.4.jar → lib/yuicompressor-2.4.6.jar} +0 -0
- metadata +169 -178
- data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +0 -148
- data/lib/sproutcore/vendor/github_gem_lint.rb +0 -22
- data/vendor/sproutcore/SCCompiler.jar +0 -0
- data/vendor/sproutcore/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/lib/yuicompressor-2.4.2.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/build.xml +0 -74
- data/vendor/sproutcore/src/SCCompiler/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/lib/htmlcompressor-0.9.3.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/lib/yuicompressor-2.4.2.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/manifest.mf +0 -3
- data/vendor/sproutcore/src/SCCompiler/nbproject/build-impl.xml +0 -894
- data/vendor/sproutcore/src/SCCompiler/nbproject/genfiles.properties +0 -8
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/config.properties +0 -0
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/private.properties +0 -10
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/private.xml +0 -4
- data/vendor/sproutcore/src/SCCompiler/nbproject/project.properties +0 -90
- data/vendor/sproutcore/src/SCCompiler/nbproject/project.xml +0 -15
- data/vendor/sproutcore/src/SCCompiler/src/com/sproutcore/Main.java +0 -348
@@ -508,15 +508,11 @@ SC.State = SC.Object.extend({
|
|
508
508
|
|
509
509
|
Method can be called in the following ways:
|
510
510
|
|
511
|
-
|
512
|
-
|
513
|
-
// With one argument
|
514
|
-
gotoState(<state>)
|
511
|
+
// With one argument
|
512
|
+
gotoState(<state>)
|
515
513
|
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
}}}
|
514
|
+
// With two arguments
|
515
|
+
gotoState(<state>, <hash>)
|
520
516
|
|
521
517
|
Where <state> is either a string or a SC.State object and <hash> is a regular JS hash object.
|
522
518
|
|
@@ -545,18 +541,14 @@ SC.State = SC.Object.extend({
|
|
545
541
|
|
546
542
|
Method can be called in the following ways:
|
547
543
|
|
548
|
-
|
544
|
+
// With one argument
|
545
|
+
gotoHistoryState(<state>)
|
549
546
|
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
// With two arguments
|
554
|
-
gotoHistoryState(<state>, <boolean | hash>)
|
555
|
-
|
556
|
-
// With three arguments
|
557
|
-
gotoHistoryState(<state>, <boolean>, <hash>)
|
547
|
+
// With two arguments
|
548
|
+
gotoHistoryState(<state>, <boolean | hash>)
|
558
549
|
|
559
|
-
|
550
|
+
// With three arguments
|
551
|
+
gotoHistoryState(<state>, <boolean>, <hash>)
|
560
552
|
|
561
553
|
Where <state> is either a string or a SC.State object and <hash> is a regular JS hash object.
|
562
554
|
|
@@ -692,10 +684,10 @@ SC.State = SC.Object.extend({
|
|
692
684
|
|
693
685
|
There is a particular order in how an event is handled by a state:
|
694
686
|
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
687
|
+
1. Basic function whose name matches the event
|
688
|
+
2. Registered event handler that is associated with an event represented as a string
|
689
|
+
3. Registered event handler that is associated with events matching a regular expression
|
690
|
+
4. The unknownEvent function
|
699
691
|
|
700
692
|
Use of event handlers that are associated with events matching a regular expression may
|
701
693
|
incur a performance hit, so they should be used sparingly.
|
@@ -706,33 +698,29 @@ SC.State = SC.Object.extend({
|
|
706
698
|
|
707
699
|
Example of a state using all four event handling techniques:
|
708
700
|
|
709
|
-
|
710
|
-
|
711
|
-
SC.State.extend({
|
701
|
+
SC.State.extend({
|
712
702
|
|
713
|
-
|
714
|
-
|
703
|
+
// Basic function handling event 'foo'
|
704
|
+
foo: function(arg1, arg2) { ... },
|
715
705
|
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
706
|
+
// event handler that handles 'frozen' and 'canuck'
|
707
|
+
eventHandlerA: function(event, arg1, arg2) {
|
708
|
+
...
|
709
|
+
}.handleEvent('frozen', 'canuck'),
|
720
710
|
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
711
|
+
// event handler that handles events matching the regular expression /num\d/
|
712
|
+
// ex. num1, num2
|
713
|
+
eventHandlerB: function(event, arg1, arg2) {
|
714
|
+
...
|
715
|
+
}.handleEvent(/num\d/),
|
726
716
|
|
727
|
-
|
728
|
-
|
729
|
-
|
717
|
+
// Handle any event that was not handled by some other
|
718
|
+
// method on the state
|
719
|
+
unknownEvent: function(event, arg1, arg2) {
|
730
720
|
|
731
|
-
|
721
|
+
}
|
732
722
|
|
733
|
-
|
734
|
-
|
735
|
-
}}}
|
723
|
+
});
|
736
724
|
*/
|
737
725
|
tryToHandleEvent: function(event, arg1, arg2) {
|
738
726
|
|
@@ -795,13 +783,9 @@ SC.State = SC.Object.extend({
|
|
795
783
|
as an animation or fetching remote data, then you need to return an asynchronous
|
796
784
|
action, which is done like so:
|
797
785
|
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
return this.performAsync('foo');
|
802
|
-
}
|
803
|
-
|
804
|
-
}}}
|
786
|
+
enterState: function() {
|
787
|
+
return this.performAsync('foo');
|
788
|
+
}
|
805
789
|
|
806
790
|
After returning an action to be performed asynchronously, the statechart will suspend
|
807
791
|
the active state transition process. In order to resume the process, you must call
|
@@ -845,13 +829,9 @@ SC.State = SC.Object.extend({
|
|
845
829
|
as an animation or fetching remote data, then you need to return an asynchronous
|
846
830
|
action, which is done like so:
|
847
831
|
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
return this.performAsync('foo');
|
852
|
-
}
|
853
|
-
|
854
|
-
}}}
|
832
|
+
exitState: function() {
|
833
|
+
return this.performAsync('foo');
|
834
|
+
}
|
855
835
|
|
856
836
|
After returning an action to be performed asynchronously, the statechart will suspend
|
857
837
|
the active state transition process. In order to resume the process, you must call
|
@@ -1055,35 +1035,21 @@ SC.State = SC.Object.extend({
|
|
1055
1035
|
|
1056
1036
|
Example:
|
1057
1037
|
|
1058
|
-
{{{
|
1059
|
-
|
1060
1038
|
MyApp.statechart = SC.Statechart.create({
|
1061
|
-
|
1062
1039
|
rootState: SC.State.design({
|
1063
|
-
|
1064
1040
|
initialSubstate: 'a',
|
1065
|
-
|
1066
1041
|
a: SC.State.plugin('path.to.a.state.class'),
|
1067
|
-
|
1068
1042
|
b: SC.State.plugin('path.to.another.state.class')
|
1069
|
-
|
1070
1043
|
})
|
1071
|
-
|
1072
|
-
})
|
1073
|
-
|
1074
|
-
}}}
|
1044
|
+
});
|
1075
1045
|
|
1076
1046
|
You can also supply hashes the plugin feature in order to enhance a state or
|
1077
1047
|
implement required functionality:
|
1078
|
-
|
1079
|
-
{{{
|
1080
|
-
|
1048
|
+
|
1081
1049
|
SomeMixin = { ... };
|
1082
|
-
|
1050
|
+
|
1083
1051
|
stateA: SC.State.plugin('path.to.state', SomeMixin, { ... })
|
1084
|
-
|
1085
|
-
}}}
|
1086
|
-
|
1052
|
+
|
1087
1053
|
@param value {String} property path to a state class
|
1088
1054
|
@param args {Hash,...} Optional. Hash objects to be added to the created state
|
1089
1055
|
*/
|
@@ -1107,39 +1073,25 @@ SC.State.design = SC.State.extend;
|
|
1107
1073
|
By default, when you add a method to a state, the state will react to
|
1108
1074
|
events that matches a method's name, like so:
|
1109
1075
|
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
// Will be invoked when a event named "foo" is sent to this state
|
1115
|
-
foo: function(event, sender, context) { ... }
|
1116
|
-
|
1117
|
-
})
|
1118
|
-
|
1119
|
-
}}}
|
1076
|
+
state = SC.State.extend({
|
1077
|
+
// Will be invoked when a event named "foo" is sent to this state
|
1078
|
+
foo: function(event, sender, context) { ... }
|
1079
|
+
});
|
1120
1080
|
|
1121
1081
|
In some situations, it may be advantageous to use one method that can react to
|
1122
1082
|
multiple events instead of having multiple methods that essentially all do the
|
1123
1083
|
same thing. In order to set a method to handle more than one event you use
|
1124
1084
|
the handleEvents method which can be supplied a list of string and/or regular
|
1125
1085
|
expressions. The following example demonstrates the use of handleEvents:
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
}
|
1134
|
-
|
1135
|
-
eventHandlerB: function(event, sender, context) {
|
1136
|
-
|
1137
|
-
}.handleEvents(/num\d/, 'decimal')
|
1138
|
-
|
1139
|
-
})
|
1140
|
-
|
1141
|
-
}}}
|
1142
|
-
|
1086
|
+
|
1087
|
+
state = SC.State.extend({
|
1088
|
+
eventHandlerA: function(event, sender, context) {
|
1089
|
+
}.handleEvents('foo', 'bar'),
|
1090
|
+
|
1091
|
+
eventHandlerB: function(event, sender, context) {
|
1092
|
+
}.handleEvents(/num\d/, 'decimal')
|
1093
|
+
});
|
1094
|
+
|
1143
1095
|
Whenever events 'foo' and 'bar' are sent to the state, the method eventHandlerA
|
1144
1096
|
will be invoked. When there is an event that matches the regular expression
|
1145
1097
|
/num\d/ or the event is 'decimal' then eventHandlerB is invoked. In both
|
@@ -1172,29 +1124,18 @@ Function.prototype.handleEvents = function() {
|
|
1172
1124
|
will be inactive. This removes the need for you having to explicitly call
|
1173
1125
|
addObserver and removeObserver. As an example:
|
1174
1126
|
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
observeHandlerB: function(target, key) {
|
1188
|
-
|
1189
|
-
}.stateObserves('foo'),
|
1190
|
-
|
1191
|
-
observeHandlerC: function(target, key) {
|
1192
|
-
|
1193
|
-
}.stateObserves('.user.name', '.user.salary')
|
1194
|
-
|
1195
|
-
})
|
1196
|
-
|
1197
|
-
}}}
|
1127
|
+
state = SC.State.extend({
|
1128
|
+
foo: null,
|
1129
|
+
user: null,
|
1130
|
+
observeHandlerA: function(target, key) {
|
1131
|
+
}.stateObserves('MyApp.someController.status'),
|
1132
|
+
|
1133
|
+
observeHandlerB: function(target, key) {
|
1134
|
+
}.stateObserves('foo'),
|
1135
|
+
|
1136
|
+
observeHandlerC: function(target, key) {
|
1137
|
+
}.stateObserves('.user.name', '.user.salary')
|
1138
|
+
});
|
1198
1139
|
|
1199
1140
|
Above, state has three state observe handlers: observeHandlerA, observeHandlerB, and
|
1200
1141
|
observeHandlerC. When state is entered, the state will automatically add itself as
|
@@ -1225,10 +1166,7 @@ Function.prototype.stateObserves = function() {
|
|
1225
1166
|
|
1226
1167
|
An example of how to use:
|
1227
1168
|
|
1228
|
-
{{{
|
1229
|
-
|
1230
1169
|
stateA: SC.State.design({
|
1231
|
-
|
1232
1170
|
initialSubstate: SC.HistoryState({
|
1233
1171
|
defaultState: 'stateB'
|
1234
1172
|
}),
|
@@ -1236,12 +1174,7 @@ Function.prototype.stateObserves = function() {
|
|
1236
1174
|
stateB: SC.State.design({ ... }),
|
1237
1175
|
|
1238
1176
|
stateC: SC.State.design({ ... })
|
1239
|
-
|
1240
1177
|
})
|
1241
|
-
|
1242
|
-
}}}
|
1243
|
-
|
1244
|
-
|
1245
1178
|
*/
|
1246
1179
|
SC.HistoryState = SC.Object.extend({
|
1247
1180
|
|
@@ -25,14 +25,10 @@ sc_require('system/state');
|
|
25
25
|
|
26
26
|
The following example shows how states are nested within a statechart:
|
27
27
|
|
28
|
-
{{{
|
29
|
-
|
30
28
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
31
|
-
|
32
29
|
rootState: SC.State.design({
|
33
|
-
|
34
30
|
initialSubstate: 'stateA',
|
35
|
-
|
31
|
+
|
36
32
|
stateA: SC.State.design({
|
37
33
|
// ... can continue to nest further states
|
38
34
|
}),
|
@@ -41,10 +37,7 @@ sc_require('system/state');
|
|
41
37
|
// ... can continue to nest further states
|
42
38
|
})
|
43
39
|
})
|
44
|
-
|
45
|
-
})
|
46
|
-
|
47
|
-
}}}
|
40
|
+
});
|
48
41
|
|
49
42
|
Note how in the example above, the root state as an explicit initial substate to enter into. If no
|
50
43
|
initial substate is provided, then the statechart will default to the the state's first substate.
|
@@ -53,12 +46,9 @@ sc_require('system/state');
|
|
53
46
|
on your object that represents states. Upon initialization, a root state will be constructed automatically
|
54
47
|
by the mixin and make the states on the object substates of the root state. As an example:
|
55
48
|
|
56
|
-
{{{
|
57
|
-
|
58
49
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
59
|
-
|
60
50
|
initialState: 'stateA',
|
61
|
-
|
51
|
+
|
62
52
|
stateA: SC.State.design({
|
63
53
|
// ... can continue to nest further states
|
64
54
|
}),
|
@@ -66,10 +56,7 @@ sc_require('system/state');
|
|
66
56
|
stateB: SC.State.design({
|
67
57
|
// ... can continue to nest further states
|
68
58
|
})
|
69
|
-
|
70
|
-
})
|
71
|
-
|
72
|
-
}}}
|
59
|
+
});
|
73
60
|
|
74
61
|
If you liked to specify a class that should be used as the root state but using the above method to defined
|
75
62
|
states, you can set the rootStateExample property with a class that extends from SC.State. If the
|
@@ -80,14 +67,10 @@ sc_require('system/state');
|
|
80
67
|
independent state structure from other concurrent states. The following example shows how to provide your
|
81
68
|
statechart with concurrent states:
|
82
69
|
|
83
|
-
{{{
|
84
|
-
|
85
70
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
86
|
-
|
87
71
|
rootState: SC.State.design({
|
88
|
-
|
89
72
|
substatesAreConcurrent: YES,
|
90
|
-
|
73
|
+
|
91
74
|
stateA: SC.State.design({
|
92
75
|
// ... can continue to nest further states
|
93
76
|
}),
|
@@ -96,10 +79,7 @@ sc_require('system/state');
|
|
96
79
|
// ... can continue to nest further states
|
97
80
|
})
|
98
81
|
})
|
99
|
-
|
100
|
-
})
|
101
|
-
|
102
|
-
}}}
|
82
|
+
});
|
103
83
|
|
104
84
|
Above, to indicate that a state's substates are concurrent, you just have to set the substatesAreConcurrent to
|
105
85
|
YES. Once done, then stateA and stateB will be independent of each other and each will manage their
|
@@ -108,12 +88,9 @@ sc_require('system/state');
|
|
108
88
|
To define concurrent states directly on the object without explicitly defining a root, you can do the
|
109
89
|
following:
|
110
90
|
|
111
|
-
{{{
|
112
|
-
|
113
91
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
114
|
-
|
115
92
|
statesAreConcurrent: YES,
|
116
|
-
|
93
|
+
|
117
94
|
stateA: SC.State.design({
|
118
95
|
// ... can continue to nest further states
|
119
96
|
}),
|
@@ -121,94 +98,67 @@ sc_require('system/state');
|
|
121
98
|
stateB: SC.State.design({
|
122
99
|
// ... can continue to nest further states
|
123
100
|
})
|
124
|
-
|
125
|
-
})
|
126
|
-
|
127
|
-
}}}
|
101
|
+
});
|
128
102
|
|
129
103
|
Remember that a startchart can have a mixture of nested and concurrent states in order for you to
|
130
104
|
create as complex of statecharts that suite your needs. Here is an example of a mixed state structure:
|
131
105
|
|
132
|
-
{{{
|
133
|
-
|
134
106
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
135
|
-
|
136
107
|
rootState: SC.State.design({
|
137
|
-
|
138
108
|
initialSubstate: 'stateA',
|
139
|
-
|
109
|
+
|
140
110
|
stateA: SC.State.design({
|
141
|
-
|
142
111
|
substatesAreConcurrent: YES,
|
143
|
-
|
112
|
+
|
144
113
|
stateM: SC.State.design({ ... })
|
145
114
|
stateN: SC.State.design({ ... })
|
146
115
|
stateO: SC.State.design({ ... })
|
147
|
-
|
148
116
|
}),
|
149
117
|
|
150
118
|
stateB: SC.State.design({
|
151
|
-
|
152
119
|
initialSubstate: 'stateX',
|
153
|
-
|
120
|
+
|
154
121
|
stateX: SC.State.design({ ... })
|
155
122
|
stateY: SC.State.desgin({ ... })
|
156
|
-
|
157
123
|
})
|
158
124
|
})
|
159
|
-
|
160
|
-
})
|
161
|
-
|
162
|
-
}}}
|
125
|
+
});
|
163
126
|
|
164
127
|
Depending on your needs, a statechart can have lots of states, which can become hard to manage all within
|
165
128
|
one file. To modularize your states and make them easier to manage and maintain, you can plug-in states
|
166
129
|
into other states. Let's say we are using the statechart in the last example above, and all the code is
|
167
130
|
within one file. We could update the code and split the logic across two or more files like so:
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
131
|
+
|
132
|
+
// state_a.js
|
133
|
+
|
172
134
|
MyApp.StateA = SC.State.extend({
|
173
|
-
|
174
135
|
substatesAreConcurrent: YES,
|
175
|
-
|
136
|
+
|
176
137
|
stateM: SC.State.design({ ... })
|
177
138
|
stateN: SC.State.design({ ... })
|
178
139
|
stateO: SC.State.design({ ... })
|
179
|
-
|
180
140
|
});
|
181
|
-
|
182
|
-
|
183
|
-
|
141
|
+
|
142
|
+
// state_b.js
|
143
|
+
|
184
144
|
MyApp.StateB = SC.State.extend({
|
185
|
-
|
186
145
|
substatesAreConcurrent: YES,
|
187
|
-
|
146
|
+
|
188
147
|
stateM: SC.State.design({ ... })
|
189
148
|
stateN: SC.State.design({ ... })
|
190
149
|
stateO: SC.State.design({ ... })
|
191
|
-
|
192
150
|
});
|
193
|
-
|
194
|
-
|
195
|
-
|
151
|
+
|
152
|
+
// statechart.js
|
153
|
+
|
196
154
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
197
|
-
|
198
155
|
rootState: SC.State.design({
|
199
|
-
|
200
156
|
initialSubstate: 'stateA',
|
201
|
-
|
202
157
|
stateA: SC.State.plugin('MyApp.StateA'),
|
203
|
-
|
204
158
|
stateB: SC.State.plugin('MyApp.StateB')
|
205
|
-
|
206
159
|
})
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
}}}
|
211
|
-
|
160
|
+
});
|
161
|
+
|
212
162
|
Using state plug-in functionality is optional. If you use the plug-in feature you can break up your statechart
|
213
163
|
into as many files as you see fit.
|
214
164
|
|
@@ -552,22 +502,18 @@ SC.StatechartManager = {
|
|
552
502
|
|
553
503
|
Method can be called in the following ways:
|
554
504
|
|
555
|
-
|
556
|
-
|
557
|
-
// With one argument.
|
558
|
-
gotoState(<state>)
|
505
|
+
// With one argument.
|
506
|
+
gotoState(<state>)
|
559
507
|
|
560
|
-
|
561
|
-
|
508
|
+
// With two argument.
|
509
|
+
gotoState(<state>, <state | boolean | hash>)
|
562
510
|
|
563
|
-
|
564
|
-
|
565
|
-
|
511
|
+
// With three argument.
|
512
|
+
gotoState(<state>, <state>, <boolean | hash>)
|
513
|
+
gotoState(<state>, <boolean>, <hash>)
|
566
514
|
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
}}}
|
515
|
+
// With four argument.
|
516
|
+
gotoState(<state>, <state>, <boolean>, <hash>)
|
571
517
|
|
572
518
|
where <state> is either a SC.State object or a string and <hash> is a regular JS hash object.
|
573
519
|
|
@@ -885,22 +831,18 @@ SC.StatechartManager = {
|
|
885
831
|
|
886
832
|
Method can be called in the following ways:
|
887
833
|
|
888
|
-
|
889
|
-
|
890
|
-
// With one arguments.
|
891
|
-
gotoHistorytate(<state>)
|
834
|
+
// With one arguments.
|
835
|
+
gotoHistorytate(<state>)
|
892
836
|
|
893
|
-
|
894
|
-
|
837
|
+
// With two arguments.
|
838
|
+
gotoHistorytate(<state>, <state | boolean | hash>)
|
895
839
|
|
896
|
-
|
897
|
-
|
898
|
-
|
840
|
+
// With three arguments.
|
841
|
+
gotoHistorytate(<state>, <state>, <boolean | hash>)
|
842
|
+
gotoHistorytate(<state>, <boolean>, <hash>)
|
899
843
|
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
}}}
|
844
|
+
// With four argumetns
|
845
|
+
gotoHistorytate(<state>, <state>, <boolean>, <hash>)
|
904
846
|
|
905
847
|
where <state> is either a SC.State object or a string and <hash> is a regular JS hash object.
|
906
848
|
|
@@ -1208,23 +1150,18 @@ SC.StatechartManager = {
|
|
1208
1150
|
|
1209
1151
|
A few notes:
|
1210
1152
|
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
to invoke the given method.
|
1153
|
+
1. Calling this is not the same as calling sendEvent or sendAction.
|
1154
|
+
Rather, this should be seen as calling normal methods on a state that
|
1155
|
+
will *not* call gotoState or gotoHistoryState.
|
1156
|
+
2. A state will only ever be invoked once per call. So if there are two
|
1157
|
+
or more current states that have the same parent state, then that parent
|
1158
|
+
state will only be invoked once if none of the current states are able
|
1159
|
+
to invoke the given method.
|
1219
1160
|
|
1220
1161
|
When calling this method, you are able to supply zero ore more arguments
|
1221
1162
|
that can be pass onto the method called on the states. As an example
|
1222
1163
|
|
1223
|
-
|
1224
|
-
|
1225
|
-
invokeStateMethod('render', context, firstTime);
|
1226
|
-
|
1227
|
-
}}}
|
1164
|
+
invokeStateMethod('render', context, firstTime);
|
1228
1165
|
|
1229
1166
|
The above call will invoke the render method on the current states
|
1230
1167
|
and supply the context and firstTime arguments to the method.
|
@@ -1235,14 +1172,10 @@ SC.StatechartManager = {
|
|
1235
1172
|
we want to call a calculate method on the current states where the method
|
1236
1173
|
will return a value when invoked. We can handle the returned values like so:
|
1237
1174
|
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
// on the given state
|
1243
|
-
})
|
1244
|
-
|
1245
|
-
}}}
|
1175
|
+
invokeStateMethod('calculate', value, function(state, result) {
|
1176
|
+
// .. handle the result returned from calculate that was invoked
|
1177
|
+
// on the given state
|
1178
|
+
})
|
1246
1179
|
|
1247
1180
|
If the method invoked does not return a value and a callback function is
|
1248
1181
|
supplied, then result value will simply be undefined. In all cases, if
|
@@ -1414,9 +1347,9 @@ SC.StatechartManager = {
|
|
1414
1347
|
it based on properties found on this state that derive from a SC.State class. For the
|
1415
1348
|
root state to be successfully built, the following much be met:
|
1416
1349
|
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1350
|
+
- The rootStateExample property must be defined with a class that derives from SC.State
|
1351
|
+
- Either the initialState or statesAreConcurrent property must be set, but not both
|
1352
|
+
- There must be one or more states that can be added to the root state
|
1420
1353
|
|
1421
1354
|
*/
|
1422
1355
|
_constructRootStateClass: function() {
|
@@ -1585,25 +1518,21 @@ SC.Async.mixin({
|
|
1585
1518
|
|
1586
1519
|
Examples:
|
1587
1520
|
|
1588
|
-
|
1521
|
+
SC.State.extend({
|
1589
1522
|
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
return SC.Async.perform('foo');
|
1594
|
-
},
|
1523
|
+
enterState: function() {
|
1524
|
+
return SC.Async.perform('foo');
|
1525
|
+
},
|
1595
1526
|
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1527
|
+
exitState: function() {
|
1528
|
+
return SC.Async.perform('bar', 100);
|
1529
|
+
}
|
1599
1530
|
|
1600
|
-
|
1531
|
+
foo: function() { ... },
|
1601
1532
|
|
1602
|
-
|
1603
|
-
|
1604
|
-
});
|
1533
|
+
bar: function(arg) { ... }
|
1605
1534
|
|
1606
|
-
|
1535
|
+
});
|
1607
1536
|
|
1608
1537
|
@param func {String|Function} the functio to be invoked on a state
|
1609
1538
|
@param arg1 Optional. An argument to pass to the given function
|