sproutcore 1.5.0 → 1.6.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.mailmap +32 -0
- data/CHANGELOG +8 -1
- data/Rakefile +16 -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 +13 -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/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/panes/pane.js +3 -3
- 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/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_collection.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +38 -41
- 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/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/lib/sproutcore.rb +2 -9
- 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/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/frame.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/FOODOC.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/handlers/XMLDOC.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/lib/JSDOC.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/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/app/test.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/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/{lib/sproutcore/vendor → vendor}/jsdoc/test.js +0 -0
- data/vendor/sproutcore/{src/SCCompiler/lib/yuicompressor-2.4.4.jar → lib/yuicompressor-2.4.6.jar} +0 -0
- metadata +176 -202
- 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
@@ -37,8 +37,8 @@ SC.platform = SC.Object.create({
|
|
37
37
|
|
38
38
|
/*
|
39
39
|
NOTES
|
40
|
-
|
41
|
-
|
40
|
+
- A development version of Chrome 9 incorrectly reported supporting touch
|
41
|
+
- Android is assumed to support touch, but incorrectly reports that it does not
|
42
42
|
*/
|
43
43
|
/**
|
44
44
|
YES if the current device supports touch events, NO otherwise.
|
@@ -259,40 +259,7 @@ SC.RenderContext = SC.Builder.create(/** SC.RenderContext.fn */ {
|
|
259
259
|
@returns {DOMElement} the element
|
260
260
|
*/
|
261
261
|
element: function() {
|
262
|
-
|
263
|
-
|
264
|
-
// create factory div if needed
|
265
|
-
var K = SC.RenderContext,
|
266
|
-
factory = K.factory,
|
267
|
-
ret, child;
|
268
|
-
|
269
|
-
if (!factory) {
|
270
|
-
factory = K.factory = document.createElement('div');
|
271
|
-
}
|
272
|
-
factory.innerHTML = this.join();
|
273
|
-
|
274
|
-
// In IE something weird happens when reusing the same element.
|
275
|
-
// After setting innerHTML, the innerHTML of the element in the previous
|
276
|
-
// view turns blank. It seems that there is something weird with their
|
277
|
-
// garbage collection algorithm. I tried just removing the nodes after
|
278
|
-
// keeping a reference to the first child, but it didn't work. I ended
|
279
|
-
// up cloning the first child.
|
280
|
-
if (SC.browser.msie) {
|
281
|
-
if (factory.innerHTML.length > 0) {
|
282
|
-
child = factory.firstChild.cloneNode(true);
|
283
|
-
factory.innerHTML = '';
|
284
|
-
}
|
285
|
-
else {
|
286
|
-
child = null;
|
287
|
-
}
|
288
|
-
}
|
289
|
-
else {
|
290
|
-
// Faster path (avoiding the unnecessary node clone) for non-IE
|
291
|
-
// browsers.
|
292
|
-
child = factory.firstChild;
|
293
|
-
}
|
294
|
-
|
295
|
-
return child ;
|
262
|
+
return this._elem ? this._elem : SC.$(this.join())[0]
|
296
263
|
},
|
297
264
|
|
298
265
|
/**
|
@@ -18,7 +18,7 @@ SC.CAPTURE_BACKSPACE_KEY = NO ;
|
|
18
18
|
RootResponder directly. Instead you will work with Pane objects, which
|
19
19
|
register themselves with the RootResponder as needed to receive events.
|
20
20
|
|
21
|
-
|
21
|
+
## RootResponder and Platforms
|
22
22
|
|
23
23
|
RootResponder contains core functionality common among the different web
|
24
24
|
platforms. You will likely be working with a subclass of RootResponder that
|
@@ -27,24 +27,24 @@ SC.CAPTURE_BACKSPACE_KEY = NO ;
|
|
27
27
|
The correct instance of RootResponder is detected at runtime and loaded
|
28
28
|
transparently.
|
29
29
|
|
30
|
-
|
30
|
+
## Event Types
|
31
31
|
|
32
32
|
RootResponders can route four types of events:
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
34
|
+
- Direct events, such as mouse and touch events. These are routed to the
|
35
|
+
nearest view managing the target DOM elment. RootResponder also handles
|
36
|
+
multitouch events so that they are delegated to the correct views.
|
37
|
+
- Keyboard events. These are sent to the keyPane, which will then send the
|
38
|
+
event to the current firstResponder and up the responder chain.
|
39
|
+
- Resize events. When the viewport resizes, these events will be sent to all
|
40
|
+
panes.
|
41
|
+
- Keyboard shortcuts. Shortcuts are sent to the keyPane first, which
|
42
|
+
will go down its view hierarchy. Then they go to the mainPane, which will
|
43
|
+
go down its view hierarchy.
|
44
|
+
- Actions. Actions are generic messages that your application can send in
|
45
|
+
response to user action or other events. You can either specify an
|
46
|
+
explicit target, or allow the action to traverse the hierarchy until a
|
47
|
+
view is found that handles it.
|
48
48
|
*/
|
49
49
|
SC.RootResponder = SC.Object.extend({
|
50
50
|
|
@@ -406,7 +406,7 @@ SC.RootResponder = SC.Object.extend({
|
|
406
406
|
the action name you pass to this method. Set 'target' to null to search
|
407
407
|
the responder chain.
|
408
408
|
|
409
|
-
IMPORTANT
|
409
|
+
**IMPORTANT**: This method's API and implementation will likely change
|
410
410
|
significantly after SproutCore 1.0 to match the version found in
|
411
411
|
SC.ResponderContext.
|
412
412
|
|
@@ -959,7 +959,8 @@ SC.RootResponder = SC.Object.extend({
|
|
959
959
|
for instance, prevent scrolling in a ScrollView, you need to make sure to transfer control
|
960
960
|
back to the previous responder:
|
961
961
|
|
962
|
-
|
962
|
+
if (Math.abs(touch.pageY - touch.startY) > this.MAX_SWIPE)
|
963
|
+
touch.restoreLastTouchResponder();
|
963
964
|
|
964
965
|
You don't call makeTouchResponder on RootResponder directly. Instead, it gets called for you
|
965
966
|
when you return YES to captureTouch or touchStart.
|
@@ -968,14 +969,19 @@ SC.RootResponder = SC.Object.extend({
|
|
968
969
|
a button view inside a ScrollView: if the touch moves too much, the button should give control back
|
969
970
|
to the scroll view.
|
970
971
|
|
971
|
-
|
972
|
-
|
973
|
-
|
972
|
+
if (Math.abs(touch.pageX - touch.startX) > 4) {
|
973
|
+
if (touch.nextTouchResponder)
|
974
|
+
touch.makeTouchResponder(touch.nextTouchResponder);
|
975
|
+
}
|
974
976
|
|
975
977
|
This will give control back to the containing view. Maybe you only want to do it if it is a ScrollView?
|
976
978
|
|
977
|
-
|
978
|
-
|
979
|
+
if (
|
980
|
+
Math.abs(touch.pageX - touch.startX) > 4 &&
|
981
|
+
touch.nextTouchResponder &&
|
982
|
+
touch.nextTouchResponder.isScrollable
|
983
|
+
)
|
984
|
+
touch.makeTouchResponder(touch.nextTouchResponder);
|
979
985
|
|
980
986
|
Possible gotcha: while you can do touch.nextTouchResponder, the responders are not chained in a linked list like
|
981
987
|
normal responders, because each touch has its own responder stack. To navigate through the stack (or, though
|
@@ -73,10 +73,12 @@ SC.SparseArray = SC.Object.extend(SC.Observable, SC.Enumerable, SC.Array,
|
|
73
73
|
@returns {SC.SparseArray} receiver
|
74
74
|
*/
|
75
75
|
provideLength: function(length) {
|
76
|
+
var oldLength;
|
76
77
|
if (SC.none(length)) this._sa_content = null ;
|
77
78
|
if (length !== this._length) {
|
79
|
+
oldLength = this._length;
|
78
80
|
this._length = length ;
|
79
|
-
if (this._requestingLength <= 0) this.
|
81
|
+
if (this._requestingLength <= 0) { this.arrayContentDidChange(0, oldLength||0, length||0) ; }
|
80
82
|
}
|
81
83
|
return this ;
|
82
84
|
},
|
@@ -256,7 +258,7 @@ SC.SparseArray = SC.Object.extend(SC.Observable, SC.Enumerable, SC.Array,
|
|
256
258
|
if (!content) content = this._sa_content = [] ;
|
257
259
|
var start = range.start, len = range.length;
|
258
260
|
while(--len >= 0) content[start+len] = array.objectAt(len);
|
259
|
-
if (this._requestingIndex <= 0) this.
|
261
|
+
if (this._requestingIndex <= 0) this.arrayContentDidChange(range.start, range.length, range.length);
|
260
262
|
return this ;
|
261
263
|
},
|
262
264
|
|
@@ -299,7 +301,7 @@ SC.SparseArray = SC.Object.extend(SC.Observable, SC.Enumerable, SC.Array,
|
|
299
301
|
while (--loc>=start) content[loc] = undefined;
|
300
302
|
}
|
301
303
|
}
|
302
|
-
this.
|
304
|
+
this.arrayContentDidChange(range.start, range.length, range.length) ; // notify
|
303
305
|
return this ;
|
304
306
|
},
|
305
307
|
|
@@ -376,9 +378,11 @@ SC.SparseArray = SC.Object.extend(SC.Observable, SC.Enumerable, SC.Array,
|
|
376
378
|
@returns {SC.SparseArray} receiver
|
377
379
|
*/
|
378
380
|
reset: function() {
|
381
|
+
var oldLength;
|
379
382
|
this._sa_content = null ;
|
383
|
+
oldLength = this._length;
|
380
384
|
this._length = null ;
|
381
|
-
this.
|
385
|
+
this.arrayContentDidChange(0, oldLength, 0);
|
382
386
|
this.invokeDelegateMethod(this.delegate, 'sparseArrayDidReset', this);
|
383
387
|
return this ;
|
384
388
|
}
|
@@ -32,13 +32,12 @@ SC.mixin(SC.String, {
|
|
32
32
|
/**
|
33
33
|
Capitalizes a string.
|
34
34
|
|
35
|
-
|
35
|
+
## Examples
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
| innerHTML | InnerHTML |
|
37
|
+
capitalize('my favorite items') // 'My favorite items'
|
38
|
+
capitalize('css-class-name') // 'Css-class-name'
|
39
|
+
capitalize('action_name') // 'Action_name'
|
40
|
+
capitalize('innerHTML') // 'InnerHTML'
|
42
41
|
|
43
42
|
@return {String} capitalized string
|
44
43
|
*/
|
@@ -50,13 +49,12 @@ SC.mixin(SC.String, {
|
|
50
49
|
Camelizes a string. This will take any words separated by spaces, dashes
|
51
50
|
or underscores and convert them into camelCase.
|
52
51
|
|
53
|
-
|
52
|
+
## Examples
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
| innerHTML | innerHTML |
|
54
|
+
camelize('my favorite items') // 'myFavoriteItems'
|
55
|
+
camelize('css-class-name') // 'cssClassName'
|
56
|
+
camelize('action_name') // 'actionName'
|
57
|
+
camelize('innerHTML') // 'innerHTML'
|
60
58
|
|
61
59
|
@returns {String} camelized string
|
62
60
|
*/
|
@@ -74,13 +72,12 @@ SC.mixin(SC.String, {
|
|
74
72
|
/**
|
75
73
|
Converts a camelized string into all lower case separated by underscores.
|
76
74
|
|
77
|
-
|
75
|
+
## Examples
|
78
76
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
| innerHTML | inner_html |
|
77
|
+
decamelize('my favorite items') // 'my favorite items'
|
78
|
+
decamelize('css-class-name') // 'css-class-name'
|
79
|
+
decamelize('action_name') // 'action_name'
|
80
|
+
decamelize('innerHTML') // 'inner_html'
|
84
81
|
|
85
82
|
@returns {String} the decamelized string.
|
86
83
|
*/
|
@@ -92,13 +89,13 @@ SC.mixin(SC.String, {
|
|
92
89
|
Converts a camelized string or a string with spaces or underscores into
|
93
90
|
a string with components separated by dashes.
|
94
91
|
|
95
|
-
|
92
|
+
## Examples
|
96
93
|
|
97
94
|
| *Input String* | *Output String* |
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
95
|
+
dasherize('my favorite items') // 'my-favorite-items'
|
96
|
+
dasherize('css-class-name') // 'css-class-name'
|
97
|
+
dasherize('action_name') // 'action-name'
|
98
|
+
dasherize('innerHTML') // 'inner-html'
|
102
99
|
|
103
100
|
@returns {String} the dasherized string.
|
104
101
|
*/
|
@@ -199,3 +199,58 @@ SC.ArraySuite.generate("SC.SparseArray", {
|
|
199
199
|
return SC.SparseArray.create({ delegate: del });
|
200
200
|
}
|
201
201
|
});
|
202
|
+
|
203
|
+
test("should notify enumerable property", function() {
|
204
|
+
var arr = SC.SparseArray.create();
|
205
|
+
var count = 0;
|
206
|
+
function counter() {
|
207
|
+
count++;
|
208
|
+
}
|
209
|
+
|
210
|
+
arr.provideLength(1);
|
211
|
+
arr.addObserver('[]', this, counter);
|
212
|
+
arr.provideObjectAtIndex(0, 'one');
|
213
|
+
equals(count, 1, "observer should have fired once");
|
214
|
+
});
|
215
|
+
|
216
|
+
test("should notify range observers", function() {
|
217
|
+
var arr = SC.SparseArray.create();
|
218
|
+
var count = 0;
|
219
|
+
function counter(arr, objects, key, indexes) {
|
220
|
+
count++;
|
221
|
+
}
|
222
|
+
|
223
|
+
arr.provideLength(4);
|
224
|
+
var is = SC.IndexSet.create(0,1).add(2,1);
|
225
|
+
arr.addRangeObserver(is, this, counter);
|
226
|
+
arr.provideObjectAtIndex(0, 'one');
|
227
|
+
arr.provideObjectAtIndex(1, 'two');
|
228
|
+
arr.provideObjectAtIndex(2, 'three');
|
229
|
+
arr.provideObjectAtIndex(3, 'four');
|
230
|
+
equals(2, count, "observer should have fired twice");
|
231
|
+
});
|
232
|
+
|
233
|
+
test("test updating SparseArray length via delegate", function() {
|
234
|
+
var delegate = SC.Object.create({
|
235
|
+
arrlen: null,
|
236
|
+
sparseArrayDidRequestLength: function(arr) {
|
237
|
+
arr.provideLength(this.arrlen);
|
238
|
+
}
|
239
|
+
});
|
240
|
+
|
241
|
+
var arr = SC.SparseArray.create({delegate: delegate});
|
242
|
+
delegate.arrlen = 5;
|
243
|
+
equals(arr.get('length'), 5)
|
244
|
+
arr.provideLength(null);
|
245
|
+
delegate.arrlen = 50;
|
246
|
+
equals(arr.get('length'), 50)
|
247
|
+
});
|
248
|
+
|
249
|
+
test("test updating SparseArray length explictly", function() {
|
250
|
+
var arr = SC.SparseArray.create();
|
251
|
+
arr.provideLength(5);
|
252
|
+
equals(arr.get('length'), 5)
|
253
|
+
arr.provideLength(50);
|
254
|
+
equals(arr.get('length'), 50)
|
255
|
+
});
|
256
|
+
|
data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
// ©2008-2011 Apple Inc. All rights reserved.
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
|
+
/*globals TemplateTests */
|
8
|
+
|
7
9
|
module("SC.TemplateCollectionView");
|
8
10
|
|
9
11
|
TemplateTests = {};
|
@@ -24,7 +26,7 @@ test("creating a collection view works", function() {
|
|
24
26
|
var ulCollectionView = CollectionView.create({ tagName: "ul" });
|
25
27
|
var olCollectionView = CollectionView.create({ tagName: "ol" });
|
26
28
|
var dlCollectionView = CollectionView.create({ tagName: "dl", itemView: DefinitionTermChildView });
|
27
|
-
var customTagCollectionView = CollectionView.create({ tagName: "p" })
|
29
|
+
var customTagCollectionView = CollectionView.create({ tagName: "p" });
|
28
30
|
|
29
31
|
defaultCollectionView.createLayer();
|
30
32
|
ulCollectionView.createLayer();
|
@@ -48,6 +50,22 @@ test("creating a collection view works", function() {
|
|
48
50
|
equals(customTagCollectionView.$('div').length, 1, "Child view was rendered");
|
49
51
|
});
|
50
52
|
|
53
|
+
test("not passing a block to the collection helper creates a collection", function() {
|
54
|
+
TemplateTests.CollectionTestView = SC.TemplateCollectionView.create({
|
55
|
+
content: ['foo', 'bar', 'baz'],
|
56
|
+
itemView: SC.TemplateView.design({
|
57
|
+
template: SC.Handlebars.compile('<aside></aside>')
|
58
|
+
})
|
59
|
+
});
|
60
|
+
|
61
|
+
var view = SC.TemplateView.create({
|
62
|
+
template: SC.Handlebars.compile('{{collection "TemplateTests.CollectionTestView"}}')
|
63
|
+
});
|
64
|
+
|
65
|
+
view.createLayer();
|
66
|
+
equals(view.$('aside').length, 3, 'one aside element is created for each content item');
|
67
|
+
});
|
68
|
+
|
51
69
|
test("passing a block to the collection helper sets it as the template for example views", function() {
|
52
70
|
TemplateTests.CollectionTestView = SC.TemplateCollectionView.create({
|
53
71
|
content: ['foo', 'bar', 'baz']
|
@@ -138,6 +156,36 @@ test("should give its item views the classBinding specified by itemClassBinding"
|
|
138
156
|
equals(view.$('ul li.is-baz').length, 2, "removes class when property changes");
|
139
157
|
});
|
140
158
|
|
159
|
+
test("should pass item* property when created with a block", function() {
|
160
|
+
TemplateTests.CollectionTestView = SC.TemplateCollectionView.create({
|
161
|
+
content: ['foo', 'bar', 'baz']
|
162
|
+
});
|
163
|
+
var view = SC.TemplateView.create({
|
164
|
+
template: SC.Handlebars.compile('{{#collection TemplateTests.CollectionTestView itemFoo="bar"}}baz{{/collection}}')
|
165
|
+
});
|
166
|
+
view.createLayer();
|
167
|
+
|
168
|
+
var childViews = view.getPath('childViews.firstObject.childViews');
|
169
|
+
childViews.forEach(function(childView, index) {
|
170
|
+
equals(childView.get('foo'), 'bar', "Child view #%@ has correct value for property set in template".fmt(index));
|
171
|
+
});
|
172
|
+
});
|
173
|
+
|
174
|
+
test("should pass item* property when created without a block", function() {
|
175
|
+
TemplateTests.CollectionTestView = SC.TemplateCollectionView.create({
|
176
|
+
content: ['foo', 'bar', 'baz']
|
177
|
+
});
|
178
|
+
var view = SC.TemplateView.create({
|
179
|
+
template: SC.Handlebars.compile('{{collection TemplateTests.CollectionTestView itemFoo="bar"}}')
|
180
|
+
});
|
181
|
+
view.createLayer();
|
182
|
+
|
183
|
+
var childViews = view.getPath('childViews.firstObject.childViews');
|
184
|
+
childViews.forEach(function(childView, index) {
|
185
|
+
equals(childView.get('foo'), 'bar', "Child view #%@ has correct value for property set in template".fmt(index));
|
186
|
+
});
|
187
|
+
});
|
188
|
+
|
141
189
|
test("should work inside a bound {{#if}}", function() {
|
142
190
|
var testData = [SC.Object.create({ isBaz: false }), SC.Object.create({ isBaz: true }), SC.Object.create({ isBaz: true })];
|
143
191
|
TemplateTests.ifTestCollectionView = SC.TemplateCollectionView.extend({
|
data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js
CHANGED
@@ -494,7 +494,7 @@ test("Should insert a localized string if the {{loc}} helper is used", function(
|
|
494
494
|
'Brazil': 'Brasilia'
|
495
495
|
});
|
496
496
|
|
497
|
-
templates = SC.Object.create({
|
497
|
+
var templates = SC.Object.create({
|
498
498
|
'loc': SC.Handlebars.compile('<h1>Country: {{loc "Brazil"}}')
|
499
499
|
});
|
500
500
|
|
@@ -776,6 +776,24 @@ test("should be able to bind view class names to properties", function() {
|
|
776
776
|
});
|
777
777
|
|
778
778
|
equals(view.$('.is-done').length, 0, "removes class name if bound property is set to false");
|
779
|
+
|
780
|
+
// There is a bug that if the view becomes first responder, its class bindings get wiped out.
|
781
|
+
// This test illustrates the bug, by adding the view to a pane and making it firstResponder
|
782
|
+
|
783
|
+
var pane = SC.MainPane.design();
|
784
|
+
pane = pane.create().append();
|
785
|
+
|
786
|
+
SC.run(function() {
|
787
|
+
pane.appendChild(view);
|
788
|
+
});
|
789
|
+
|
790
|
+
TemplateTests.classBindingView.becomeFirstResponder();
|
791
|
+
|
792
|
+
SC.run(function() {
|
793
|
+
TemplateTests.classBindingView.set('isDone', YES);
|
794
|
+
});
|
795
|
+
|
796
|
+
equals(view.$('.is-done').length, 1, "dasherizes property and sets class name after becoming first responder");
|
779
797
|
});
|
780
798
|
|
781
799
|
test("should be able to bind element attributes using {{bindAttr}}", function() {
|
@@ -80,6 +80,8 @@ SC.TemplateCollectionView = SC.TemplateView.extend({
|
|
80
80
|
|
81
81
|
if (this.get('tagName') === 'ul' || this.get('tagName') === 'ol') {
|
82
82
|
extensions.tagName = 'li';
|
83
|
+
} else if (this.get('tagName') === 'table' || this.get('tagName') === 'thead' || this.get('tagName') === 'tbody') {
|
84
|
+
extensions.tagName = 'tr';
|
83
85
|
}
|
84
86
|
|
85
87
|
return itemView.extend(extensions);
|
@@ -35,9 +35,10 @@ SC.View.reopen(
|
|
35
35
|
|
36
36
|
Takes a key, value and either a duration, or a hash of options.
|
37
37
|
The options hash has the following parameters
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
|
39
|
+
- duration: Duration of animation in seconds
|
40
|
+
- callback: Callback method to run when animation completes
|
41
|
+
- timing: Animation timing function
|
41
42
|
|
42
43
|
@param {String|Hash} key
|
43
44
|
@param {Object} value
|
@@ -196,6 +196,7 @@ SC.View.reopen(
|
|
196
196
|
- borderRight: right border
|
197
197
|
- borderBottom: bottom border
|
198
198
|
- borderLeft: bottom left
|
199
|
+
- zIndex: position above or below other views
|
199
200
|
|
200
201
|
Note that you can only use certain combinations to set layout. For
|
201
202
|
example, you may set left/right or left/width, but not left/width/right,
|
@@ -856,7 +856,7 @@ SC.CoreView.reopen(
|
|
856
856
|
@property {Array}
|
857
857
|
@readOnly
|
858
858
|
*/
|
859
|
-
displayProperties: [
|
859
|
+
displayProperties: [],
|
860
860
|
|
861
861
|
// .......................................................
|
862
862
|
// SC.RESPONDER SUPPORT
|
@@ -882,11 +882,12 @@ SC.CoreView.reopen(
|
|
882
882
|
|
883
883
|
/** @private
|
884
884
|
Setup a view, but do not finish waking it up.
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
885
|
+
|
886
|
+
- configure childViews
|
887
|
+
- Determine the view's theme
|
888
|
+
- Fetch a render delegate from the theme, if necessary
|
889
|
+
- register the view with the global views hash, which is used for event
|
890
|
+
dispatch
|
890
891
|
*/
|
891
892
|
init: function() {
|
892
893
|
var parentView = this.get('parentView'),
|
@@ -1466,48 +1467,42 @@ SC.CoreView.unload = function() {
|
|
1466
1467
|
|
1467
1468
|
Base class for managing a view. Views provide two functions:
|
1468
1469
|
|
1469
|
-
|
1470
|
+
1. They translate state and events into drawing instructions for the
|
1470
1471
|
web browser and
|
1471
|
-
|
1472
|
-
2. They act as first responders for incoming keyboard, mouse, and
|
1472
|
+
2. They act as first responders for incoming keyboard, mouse, and
|
1473
1473
|
touch events.
|
1474
1474
|
|
1475
|
-
|
1475
|
+
## View Initialization
|
1476
1476
|
|
1477
1477
|
When a view is setup, there are several methods you can override that
|
1478
1478
|
will be called at different times depending on how your view is created.
|
1479
1479
|
Here is a guide to which method you want to override and when:
|
1480
1480
|
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
However there is cases where the element has to be first appended to the
|
1507
|
-
Document because there is either a bug on the browser or you are using
|
1508
|
-
plugins which objects are not instantiated until you actually append the
|
1509
|
-
element to the DOM. This will allow you to do things like registering
|
1510
|
-
DOM events on flash or quicktime objects.
|
1481
|
+
- `init` -- override this method for any general object setup (such as
|
1482
|
+
observers, starting timers and animations, etc) that you need to happen
|
1483
|
+
everytime the view is created, regardless of whether or not its layer
|
1484
|
+
exists yet.
|
1485
|
+
- `render` -- override this method to generate or update your HTML to reflect
|
1486
|
+
the current state of your view. This method is called both when your view
|
1487
|
+
is first created and later anytime it needs to be updated.
|
1488
|
+
- `didCreateLayer` -- the render() method is used to generate new HTML.
|
1489
|
+
Override this method to perform any additional setup on the DOM you might
|
1490
|
+
need to do after creating the view. For example, if you need to listen
|
1491
|
+
for events.
|
1492
|
+
- `willDestroyLayer` -- if you implement didCreateLayer() to setup event
|
1493
|
+
listeners, you should implement this method as well to remove the same
|
1494
|
+
just before the DOM for your view is destroyed.
|
1495
|
+
- `updateLayer` -- Normally, when a view needs to update its content, it will
|
1496
|
+
re-render the view using the render() method. If you would like to
|
1497
|
+
override this behavior with your own custom updating code, you can
|
1498
|
+
replace updateLayer() with your own implementation instead.
|
1499
|
+
- `didAppendToDocument` -- in theory all DOM setup could be done
|
1500
|
+
in didCreateLayer() as you already have a DOM element instantiated.
|
1501
|
+
However there is cases where the element has to be first appended to the
|
1502
|
+
Document because there is either a bug on the browser or you are using
|
1503
|
+
plugins which objects are not instantiated until you actually append the
|
1504
|
+
element to the DOM. This will allow you to do things like registering
|
1505
|
+
DOM events on flash or quicktime objects.
|
1511
1506
|
|
1512
1507
|
@extends SC.Responder
|
1513
1508
|
@extends SC.DelegateSupport
|
@@ -1515,7 +1510,9 @@ SC.CoreView.unload = function() {
|
|
1515
1510
|
|
1516
1511
|
*/
|
1517
1512
|
SC.View = SC.CoreView.extend(/** @scope SC.View.prototype */{
|
1518
|
-
classNames: ['sc-view']
|
1513
|
+
classNames: ['sc-view'],
|
1514
|
+
|
1515
|
+
displayProperties: ['isFirstResponder']
|
1519
1516
|
});
|
1520
1517
|
|
1521
1518
|
//unload views for IE, trying to collect memory.
|