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
@@ -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() {
|
@@ -3,6 +3,7 @@ sc_require("ext/handlebars/bind");
|
|
3
3
|
sc_require("ext/handlebars/collection");
|
4
4
|
sc_require("ext/handlebars/localization");
|
5
5
|
sc_require("ext/handlebars/view");
|
6
|
+
sc_require("views/view");
|
6
7
|
|
7
8
|
// Global hash of shared templates. This will automatically be populated
|
8
9
|
// by the build tools so that you can store your Handlebars templates in
|
@@ -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);
|
@@ -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.
|
@@ -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,
|
@@ -1293,29 +1293,14 @@ SC.Query.mixin( /** @scope SC.Query */ {
|
|
1293
1293
|
orderStoreKeys: function(storeKeys, query, store) {
|
1294
1294
|
// apply the sort if there is one
|
1295
1295
|
if (storeKeys) {
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
// We'll use a stack-based approach in case our sort routine ends up
|
1300
|
-
// calling code that triggers a recursive invocation of orderStoreKeys.
|
1301
|
-
var K = SC.Query,
|
1302
|
-
tempStores = K._TMP_STORES,
|
1303
|
-
tempQueries = K._TMP_QUERIES;
|
1304
|
-
if (!tempStores) tempStores = K._TMP_STORES = [];
|
1305
|
-
if (!tempQueries) tempQueries = K._TMP_QUERIES = [];
|
1306
|
-
|
1307
|
-
tempStores.push(store);
|
1308
|
-
tempQueries.push(query);
|
1309
|
-
|
1310
|
-
var res = storeKeys.sort(SC.Query.compareStoreKeys);
|
1311
|
-
|
1312
|
-
K._TMP_STORES.pop();
|
1313
|
-
K._TMP_QUERIES.pop();
|
1296
|
+
var res = storeKeys.sort(function(a, b) {
|
1297
|
+
return SC.Query.compareStoreKeys(query, store, a, b);
|
1298
|
+
});
|
1314
1299
|
}
|
1315
1300
|
|
1316
1301
|
return storeKeys;
|
1317
1302
|
},
|
1318
|
-
|
1303
|
+
|
1319
1304
|
/**
|
1320
1305
|
Default sort method that is used when calling `containsStoreKeys()`
|
1321
1306
|
or `containsRecords()` on this query. Simply materializes two records
|
@@ -1325,71 +1310,11 @@ SC.Query.mixin( /** @scope SC.Query */ {
|
|
1325
1310
|
@param {Number} storeKey2 a store key
|
1326
1311
|
@returns {Number} -1 if record1 < record2, +1 if record1 > record2, 0 if equal
|
1327
1312
|
*/
|
1328
|
-
compareStoreKeys: function(storeKey1, storeKey2) {
|
1329
|
-
var
|
1330
|
-
tempStores = K._TMP_STORES,
|
1331
|
-
tempQueries = K._TMP_QUERIES,
|
1332
|
-
store = tempStores[tempStores.length - 1],
|
1333
|
-
query = tempQueries[tempQueries.length - 1],
|
1334
|
-
compareFunc = query.compare,
|
1335
|
-
record1 = store.materializeRecord(storeKey1),
|
1313
|
+
compareStoreKeys: function(query, store, storeKey1, storeKey2) {
|
1314
|
+
var record1 = store.materializeRecord(storeKey1),
|
1336
1315
|
record2 = store.materializeRecord(storeKey2);
|
1337
1316
|
|
1338
|
-
|
1339
|
-
// Otherwise, we have the logic from the standard version inlined here.
|
1340
|
-
if (compareFunc !== K.prototype.compare) {
|
1341
|
-
return compareFunc.call(query, record1, record2);
|
1342
|
-
}
|
1343
|
-
else {
|
1344
|
-
// THIS CODE IS THE SAME AS THE 'compare' METHOD, EXCEPT THAT 'this' HAS
|
1345
|
-
// BEEN CHANGED TO 'query'.
|
1346
|
-
//
|
1347
|
-
// It is inlined here to avoid the extra method invocation in the
|
1348
|
-
// typical case where the client does not supply a custom 'compare'
|
1349
|
-
// function.
|
1350
|
-
|
1351
|
-
var result = 0,
|
1352
|
-
propertyName, order, len, i;
|
1353
|
-
|
1354
|
-
// fast cases go here
|
1355
|
-
if (record1 === record2) return 0;
|
1356
|
-
|
1357
|
-
// if called for the first time we have to build the order array
|
1358
|
-
if (!query._isReady) query.parse();
|
1359
|
-
if (!query._isReady) { // can't parse. guid is wrong but consistent
|
1360
|
-
return SC.compare(record1.get('id'),record2.get('id'));
|
1361
|
-
}
|
1362
|
-
|
1363
|
-
// For every property specified in orderBy until non-eql result is found.
|
1364
|
-
// Or, if orderBy is a comparison function, simply invoke it with the
|
1365
|
-
// records.
|
1366
|
-
order = query._order;
|
1367
|
-
if (SC.typeOf(order) === SC.T_FUNCTION) {
|
1368
|
-
result = order.call(null, record1, record2);
|
1369
|
-
}
|
1370
|
-
else {
|
1371
|
-
len = order ? order.length : 0;
|
1372
|
-
for (i=0; result===0 && (i < len); i++) {
|
1373
|
-
propertyName = order[i].propertyName;
|
1374
|
-
// if query property has a registered comparison use that
|
1375
|
-
if (SC.Query.comparisons[propertyName]) {
|
1376
|
-
result = SC.Query.comparisons[propertyName](
|
1377
|
-
record1.get(propertyName),record2.get(propertyName));
|
1378
|
-
|
1379
|
-
// if not use default SC.compare()
|
1380
|
-
} else {
|
1381
|
-
result = SC.compare(
|
1382
|
-
record1.get(propertyName), record2.get(propertyName) );
|
1383
|
-
}
|
1384
|
-
|
1385
|
-
if ((result!==0) && order[i].descending) result = (-1) * result;
|
1386
|
-
}
|
1387
|
-
}
|
1388
|
-
|
1389
|
-
// return result or compare by guid
|
1390
|
-
if (result !== 0) return result ;
|
1391
|
-
else return SC.compare(record1.get('id'),record2.get('id'));
|
1392
|
-
}
|
1317
|
+
return query.compare(record1, record2);
|
1393
1318
|
},
|
1394
1319
|
|
1395
1320
|
/**
|
@@ -438,13 +438,10 @@ SC.RecordArray = SC.Object.extend(SC.Enumerable, SC.Array,
|
|
438
438
|
|
439
439
|
this.set('needsFlush', YES);
|
440
440
|
|
441
|
-
// if we have storeKeys already, then flush immediately because
|
442
|
-
// it will not be as expensive as if we are starting from scratch
|
443
441
|
if (this.get('storeKeys')) {
|
444
442
|
this.flush();
|
445
|
-
}
|
446
|
-
|
447
|
-
this.enumerableContentDidChange();
|
443
|
+
} else {
|
444
|
+
this.arrayContentDidChange();
|
448
445
|
}
|
449
446
|
|
450
447
|
return this;
|
@@ -712,6 +709,16 @@ SC.RecordArray = SC.Object.extend(SC.Enumerable, SC.Array,
|
|
712
709
|
|
713
710
|
}.observes('storeKeys'),
|
714
711
|
|
712
|
+
/** @private
|
713
|
+
If anyone adds an array observer on to the record array, make sure
|
714
|
+
we flush so that the observers don't fire the first time length is
|
715
|
+
calculated.
|
716
|
+
*/
|
717
|
+
addArrayObservers: function() {
|
718
|
+
this.flush();
|
719
|
+
return SC.Array.addArrayObservers.apply(this, arguments);
|
720
|
+
},
|
721
|
+
|
715
722
|
/** @private
|
716
723
|
Invoked whenever the content of the `storeKeys` array changes. This will
|
717
724
|
dump any cached record lookup and then notify that the enumerable content
|