sproutcore 1.5.0.pre.3 → 1.5.0.pre.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rspec +1 -0
- data/CHANGELOG +42 -0
- data/README.txt +25 -0
- data/VERSION.yml +1 -1
- data/bin/sc-build +1 -1
- data/bin/sc-build-number +1 -1
- data/bin/sc-docs +1 -1
- data/bin/sc-gen +1 -1
- data/bin/sc-init +1 -1
- data/bin/sc-manifest +1 -1
- data/bin/sc-server +1 -1
- data/bin/sproutcore +1 -1
- data/lib/buildtasks/build.rake +5 -0
- data/lib/buildtasks/manifest.rake +20 -1
- data/lib/frameworks/sproutcore/Buildfile +12 -9
- data/lib/frameworks/sproutcore/CHANGELOG.md +48 -0
- data/lib/frameworks/sproutcore/apps/greenhouse/README +2 -9
- data/lib/frameworks/sproutcore/apps/greenhouse/TODO +11 -27
- data/lib/frameworks/sproutcore/apps/greenhouse/controllers/library.js +3 -10
- data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/css/main-page.css +4 -31
- data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/dialogs.js +5 -4
- data/lib/frameworks/sproutcore/apps/greenhouse/models/dir.js +3 -3
- data/lib/frameworks/sproutcore/apps/greenhouse/models/file.js +2 -2
- data/lib/frameworks/sproutcore/apps/greenhouse/states/main.js +31 -14
- data/lib/frameworks/sproutcore/apps/greenhouse/states/modals.js +2 -1
- data/lib/frameworks/sproutcore/apps/greenhouse/states/ready.js +27 -1
- data/lib/frameworks/sproutcore/apps/greenhouse/tests/views/list_item.js +1 -0
- data/lib/frameworks/sproutcore/apps/greenhouse/tests/views/plist_item.js +20 -0
- data/lib/frameworks/sproutcore/apps/greenhouse/theme.js +25 -0
- data/lib/frameworks/sproutcore/apps/greenhouse/views/plist_item.js +161 -24
- data/lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +37 -25
- data/lib/frameworks/sproutcore/frameworks/bootstrap/tests/system/browser.js +135 -26
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/controllers/array.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/controllers/controller.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/controllers/object.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/core.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/ext/object.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/ext/run_loop.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/delegate_support.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/responder_context.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/selection_support.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/string.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/keyboard.js +68 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +108 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/panes/main.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/manipulation.js +27 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/panes/pane.js +215 -505
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +24 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/protocols/observable_protocol.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/protocols/sparse_array_delegate.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/resources/core.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/resources/view.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/application.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/browser.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/builder.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/core_query.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/cursor.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +210 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/event.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/json.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/locale.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/page.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/platform.js +31 -5
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/ready.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/render_context.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/responder.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/root_responder.js +83 -110
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/selection_set.js +7 -4
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/sparse_array.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/theme.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/timer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/utils/rect.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +151 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/array_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/enum_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/null_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/selection_support.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/single_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/empty_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/multiple_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/single_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/single_enumerable_case.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/mixins/responder_context.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/mixins/string.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/panes/template.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/builder.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/core_query/within.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/json.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/locale.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/begin.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/element.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/end.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/get.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_attr.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_basic.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_className.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_style.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/init.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/join.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/push_text.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/tag.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/update.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/makeKeyPane.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/makeMainPane.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/makeMenuPane.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/root_responder.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/targetForAction.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/add.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/copy.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/indexSetForSource.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/isEqual.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/remove.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/sparse_array.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/theme.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/invalidate.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/invokeLater.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/isPaused.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/performAction.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/schedule.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/utils/normalizeURL.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/utils/offset.js +268 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/utils/rect.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/append_remove.js +107 -18
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/firstResponder.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/keyPane.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/layout.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/sendEvent.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/checkbox_support.js +32 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/text_field_support.js +73 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template_view/collection.js +65 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template_view/core.js +67 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template_view/handlebars.js +295 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/animation.js +19 -18
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/build.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/build_children.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/clippingFrame.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/convertFrames.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/convertLayouts.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/createChildViews.js +18 -15
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/createLayer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/destroyLayer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/didAppendToDocument.js +11 -8
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/findLayerInParentLayer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/init.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/insertBefore.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/isVisible.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/isVisibleInWindow.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +22 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/layer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/layoutChildViews.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +180 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +640 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/parentViewDidChange.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/prepareContext.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/removeChild.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render.js +125 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/render_delegate_support.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/replaceChild.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/static_layout.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/theme.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/updateLayer.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/updateLayerLocation.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/view.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/viewDidResize.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/checkbox_support.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/collection.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/text_field_support.js +35 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +77 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +187 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/base.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +41 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +57 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +223 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +1150 -0
- data/lib/frameworks/sproutcore/frameworks/{amber/views → core_foundation/views/view}/layout_style.js +93 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +489 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +362 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/touch.js +67 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/visibility.js +113 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +1280 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +27 -53
- data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +13 -19
- data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +183 -71
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +26 -46
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +25 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +139 -21
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +6 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/{parentless.js → data_store.js} +62 -16
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +51 -17
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +36 -10
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +11 -11
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +8 -8
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/{foundation/english.lproj → datetime/resources}/strings.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/{foundation → datetime}/system/datetime.js +5 -37
- data/lib/frameworks/sproutcore/frameworks/{foundation → datetime}/tests/system/datetime.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/debug/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/designer/controllers/designs.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/designer/designers/object_designer.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/designer/designers/view_designer.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/designer/views/designer_drop_target.js +9 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +71 -70
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +10 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +4 -19
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segmented.js +33 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +25 -103
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +102 -92
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +22 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +38 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +42 -22
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +513 -230
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/README.md +23 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/README.md +11 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +215 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js +67 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +34 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/polymorphic_single_attribute.js +183 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphic/single.js +124 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +151 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +27 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/system/image_queue.js +6 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/system/logger.js +163 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +6 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/logger.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +200 -167
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +52 -137
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +7 -11
- data/lib/frameworks/sproutcore/frameworks/handlebars/extensions.js +138 -0
- data/lib/frameworks/sproutcore/frameworks/handlebars/handlebars.js +1338 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +32 -26
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +162 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +10 -5
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +123 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +12 -5
- data/lib/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +50 -13
- data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +163 -333
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +58 -8
- data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +9 -6
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +15 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/chained.js +31 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/logger.js +31 -143
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/concatenated_properties.js +71 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +177 -0
- data/lib/frameworks/sproutcore/frameworks/table/views/table.js +5 -4
- data/lib/frameworks/sproutcore/frameworks/table/views/table_header.js +5 -3
- data/lib/frameworks/sproutcore/themes/ace/resources/button/button.js +8 -2
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu.css +2 -3
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented.css +1 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented.css +1 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented.css +1 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented.css +1 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/segmented.css +2 -2
- data/lib/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +62 -62
- data/lib/gen/html_app/Buildfile +36 -0
- data/lib/gen/html_app/README +1 -0
- data/lib/gen/html_app/USAGE +15 -0
- data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +14 -0
- data/lib/gen/html_app/templates/apps/@target_name@/resources/images/.gitkeep +0 -0
- data/lib/gen/html_app/templates/apps/@target_name@/resources/stylesheets/@target_name@.css +0 -0
- data/lib/gen/html_app/templates/apps/@target_name@/resources/templates/@target_name@.handlebars +1 -0
- data/lib/gen/html_project/Buildfile +45 -0
- data/lib/gen/html_project/INIT +3 -0
- data/lib/gen/html_project/README +1 -0
- data/lib/gen/html_project/USAGE +2 -0
- data/lib/gen/html_project/templates/@filename@/Buildfile +8 -0
- data/lib/gen/html_project/templates/@filename@/README +7 -0
- data/lib/sproutcore/builders/handlebars.rb +30 -0
- data/lib/sproutcore/builders.rb +1 -1
- data/lib/sproutcore/helpers/static_helper.rb +3 -3
- data/lib/sproutcore/tools/init.rb +25 -9
- data/spec/buildtasks/manifest/prepare_build_tasks/handlebars_spec.rb +39 -0
- data/spec/fixtures/builder_tests/apps/handlebars_test/template.handlebars +5 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/templates/demo.handlebars +4 -0
- data/spec/lib/builders/handlebars_spec.rb +29 -0
- data/vendor/chance/lib/chance/imagers/data_url.rb +20 -7
- data/vendor/chance/lib/chance/instance.rb +4 -1
- data/vendor/chance/lib/chance/parser.rb +31 -31
- data/vendor/chance/lib/chance/slicing.rb +38 -8
- metadata +195 -225
- data/lib/frameworks/sproutcore/frameworks/amber/system/device.js +0 -143
- data/lib/frameworks/sproutcore/frameworks/amber/system/utils.js +0 -174
- data/lib/frameworks/sproutcore/frameworks/amber/tests/views/main_pane.js +0 -31
- data/lib/frameworks/sproutcore/frameworks/amber/tests/views/pane/sendTouchEvent.js +0 -267
- data/lib/frameworks/sproutcore/frameworks/amber/tests/views/view/layoutDidChange.js +0 -149
- data/lib/frameworks/sproutcore/frameworks/amber/tests/views/view/layoutStyle.js +0 -602
- data/lib/frameworks/sproutcore/frameworks/amber/tests/views/view/render.js +0 -115
- data/lib/frameworks/sproutcore/frameworks/amber/views/base.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/amber/views/view.js +0 -4003
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +0 -105
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
/*global NodeList */
|
|
9
9
|
// These commands are used by the build tools to control load order. On the
|
|
10
10
|
// client side these are a no-op.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
if (!window.require) { window.require = function require(){}; }
|
|
12
|
+
if (!window.sc_require) { window.sc_require = require };
|
|
13
|
+
if (!window.sc_resource) {window.sc_resource = function sc_resource(){}; }
|
|
14
14
|
sc_require('license') ;
|
|
15
15
|
|
|
16
16
|
// ........................................
|
|
@@ -19,8 +19,8 @@ sc_require('license') ;
|
|
|
19
19
|
// Most global constants should be defined inside of the SC namespace.
|
|
20
20
|
// However the following two are useful enough and generally benign enough
|
|
21
21
|
// to put into the global object.
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
window.YES = true ;
|
|
23
|
+
window.NO = false ;
|
|
24
24
|
|
|
25
25
|
// prevent a console.log from blowing things up if we are on a browser that
|
|
26
26
|
// does not support it
|
|
@@ -36,7 +36,7 @@ if (typeof console === 'undefined') {
|
|
|
36
36
|
// rest of the methods go into the mixin defined below.
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
@version 1.5.0.pre.
|
|
39
|
+
@version 1.5.0.pre.4
|
|
40
40
|
@namespace
|
|
41
41
|
|
|
42
42
|
The SproutCore namespace. All SproutCore methods and functions are defined
|
|
@@ -54,10 +54,10 @@ if (typeof console === 'undefined') {
|
|
|
54
54
|
The core Base framework is based on the jQuery API with a number of
|
|
55
55
|
performance optimizations.
|
|
56
56
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
window.SC = window.SC || {} ;
|
|
58
|
+
window.SproutCore = window.SproutCore || SC ;
|
|
59
59
|
|
|
60
|
-
SC.VERSION = '1.5.0.pre.
|
|
60
|
+
SC.VERSION = '1.5.0.pre.4';
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
@private
|
|
@@ -198,7 +198,7 @@ SC.mixin(/** @scope SC */ {
|
|
|
198
198
|
var nativeType = jQuery.type(item);
|
|
199
199
|
|
|
200
200
|
if (nativeType === "function") {
|
|
201
|
-
return item.isClass ? SC.T_CLASS : SC.T_FUNCTION
|
|
201
|
+
return item.isClass ? SC.T_CLASS : SC.T_FUNCTION;
|
|
202
202
|
} else if (nativeType === "object") {
|
|
203
203
|
if (item.isError) {
|
|
204
204
|
return SC.T_ERROR ;
|
|
@@ -255,8 +255,8 @@ SC.mixin(/** @scope SC */ {
|
|
|
255
255
|
return false;
|
|
256
256
|
} else if ( obj.objectAt ) {
|
|
257
257
|
return true ;
|
|
258
|
-
} else if ( obj.length && jQuery.type(obj) === "object" ) {
|
|
259
|
-
return true
|
|
258
|
+
} else if ( obj.length !== undefined && jQuery.type(obj) === "object" ) {
|
|
259
|
+
return true;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
return false;
|
|
@@ -309,7 +309,7 @@ SC.mixin(/** @scope SC */ {
|
|
|
309
309
|
// GUIDS & HASHES
|
|
310
310
|
//
|
|
311
311
|
|
|
312
|
-
guidKey: jQuery.expando,
|
|
312
|
+
guidKey: jQuery.expando || ("SproutCore" + ( SC.VERSION + Math.random() ).replace( /\D/g, "" )),
|
|
313
313
|
|
|
314
314
|
// Used for guid generation...
|
|
315
315
|
_guidPrefixes: {"number": "nu", "string": "st"},
|
|
@@ -327,13 +327,13 @@ SC.mixin(/** @scope SC */ {
|
|
|
327
327
|
@returns {String} the unique guid for this instance.
|
|
328
328
|
*/
|
|
329
329
|
guidFor: function(obj) {
|
|
330
|
+
var cache, ret,
|
|
331
|
+
type = typeof obj;
|
|
330
332
|
|
|
331
333
|
// special cases where we don't want to add a key to object
|
|
332
334
|
if (obj === undefined) return "(undefined)";
|
|
333
335
|
if (obj === null) return "(null)";
|
|
334
336
|
|
|
335
|
-
var type = typeof obj;
|
|
336
|
-
|
|
337
337
|
// Don't allow prototype changes to String etc. to change the guidFor
|
|
338
338
|
if (type === SC.T_NUMBER || type === SC.T_STRING) {
|
|
339
339
|
cache = this._guidCaches[type];
|
|
@@ -344,7 +344,7 @@ SC.mixin(/** @scope SC */ {
|
|
|
344
344
|
}
|
|
345
345
|
return ret;
|
|
346
346
|
} else if (type === SC.T_BOOL) {
|
|
347
|
-
return (obj) ? "(true)" : "(false)"
|
|
347
|
+
return (obj) ? "(true)" : "(false)";
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
var guidKey = this.guidKey;
|
|
@@ -355,9 +355,6 @@ SC.mixin(/** @scope SC */ {
|
|
|
355
355
|
if (obj === Object) return '(Object)';
|
|
356
356
|
if (obj === Array) return '(Array)';
|
|
357
357
|
|
|
358
|
-
var cache, ret;
|
|
359
|
-
var type = typeof obj;
|
|
360
|
-
|
|
361
358
|
return SC.generateGuid(obj, "sc");
|
|
362
359
|
},
|
|
363
360
|
|
|
@@ -615,8 +612,8 @@ SC.mixin(/** @scope SC */ {
|
|
|
615
612
|
if ( deep ) {
|
|
616
613
|
idx = ret.length;
|
|
617
614
|
while ( idx-- ) { ret[idx] = SC.copy( ret[idx], true ); }
|
|
618
|
-
break ;
|
|
619
615
|
}
|
|
616
|
+
break ;
|
|
620
617
|
|
|
621
618
|
case "object":
|
|
622
619
|
ret = {} ;
|
|
@@ -815,6 +812,11 @@ SC.Function = {
|
|
|
815
812
|
return fn ;
|
|
816
813
|
},
|
|
817
814
|
|
|
815
|
+
enhance: function(fn) {
|
|
816
|
+
fn.isEnhancement = true;
|
|
817
|
+
return fn ;
|
|
818
|
+
},
|
|
819
|
+
|
|
818
820
|
observes: function(fn, propertyPaths) {
|
|
819
821
|
// sort property paths into local paths (i.e just a property name) and
|
|
820
822
|
// full paths (i.e. those with a . or * in them)
|
|
@@ -835,7 +837,7 @@ SC.Function = {
|
|
|
835
837
|
return fn ;
|
|
836
838
|
}
|
|
837
839
|
|
|
838
|
-
}
|
|
840
|
+
};
|
|
839
841
|
|
|
840
842
|
SC.mixin(Function.prototype,
|
|
841
843
|
/** @lends Function.prototype */ {
|
|
@@ -949,7 +951,7 @@ SC.mixin(Function.prototype,
|
|
|
949
951
|
@returns {Function} the declared function instance
|
|
950
952
|
*/
|
|
951
953
|
property: function() {
|
|
952
|
-
return SC.Function.property(this, arguments)
|
|
954
|
+
return SC.Function.property(this, arguments);
|
|
953
955
|
},
|
|
954
956
|
|
|
955
957
|
/**
|
|
@@ -988,7 +990,11 @@ SC.mixin(Function.prototype,
|
|
|
988
990
|
@returns {Function} receiver
|
|
989
991
|
*/
|
|
990
992
|
idempotent: function(aFlag) {
|
|
991
|
-
return SC.Function.idempotent(this, aFlag)
|
|
993
|
+
return SC.Function.idempotent(this, aFlag);
|
|
994
|
+
},
|
|
995
|
+
|
|
996
|
+
enhance: function() {
|
|
997
|
+
return SC.Function.enhance(this);
|
|
992
998
|
},
|
|
993
999
|
|
|
994
1000
|
/**
|
|
@@ -1014,8 +1020,8 @@ SC.CoreString = {
|
|
|
1014
1020
|
}) ;
|
|
1015
1021
|
},
|
|
1016
1022
|
loc: function(str, formats) {
|
|
1017
|
-
|
|
1018
|
-
return SC.
|
|
1023
|
+
str = SC.STRINGS[str] || str;
|
|
1024
|
+
return SC.CoreString.fmt(str, arguments) ;
|
|
1019
1025
|
},
|
|
1020
1026
|
w: function(str) {
|
|
1021
1027
|
var ary = [], ary2 = str.split(' '), len = ary2.length, string, idx=0;
|
|
@@ -1025,7 +1031,7 @@ SC.CoreString = {
|
|
|
1025
1031
|
}
|
|
1026
1032
|
return ary ;
|
|
1027
1033
|
}
|
|
1028
|
-
}
|
|
1034
|
+
};
|
|
1029
1035
|
|
|
1030
1036
|
SC.mixin(String.prototype,
|
|
1031
1037
|
/** @lends Function.prototype */ {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
|
6
6
|
// ==========================================================================
|
|
7
7
|
|
|
8
|
-
/*globals module test ok equals same
|
|
8
|
+
/*globals module test ok equals same SC */
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
Adds a new module of unit tests to verify that the passed object implements
|
|
@@ -41,10 +41,169 @@
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}}}
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
SC.TestSuite = /** @scope SC.TestSuite.prototype */ {
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
Call this method to define a new test suite. Pass one or more hashes of
|
|
50
|
+
properties you want added to the new suite.
|
|
51
|
+
|
|
52
|
+
@param {Hash} attrs one or more attribute hashes
|
|
53
|
+
@returns {SC.TestSuite} subclass of suite.
|
|
54
|
+
*/
|
|
55
|
+
create: function(desc, attrs) {
|
|
56
|
+
var len = arguments.length,
|
|
57
|
+
ret = SC.beget(this),
|
|
58
|
+
idx;
|
|
59
|
+
|
|
60
|
+
// copy any attributes
|
|
61
|
+
for(idx=1;idx<len;idx++) SC.mixin(ret, arguments[idx]);
|
|
62
|
+
|
|
63
|
+
if (desc) ret.basedesc = desc;
|
|
64
|
+
|
|
65
|
+
// clone so that new definitions will be kept separate
|
|
66
|
+
ret.definitions = ret.definitions.slice();
|
|
67
|
+
|
|
68
|
+
return ret ;
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
Generate a new test suite instance, adding the suite definitions to the
|
|
73
|
+
current test plan. Pass a description of the test suite as well as one or
|
|
74
|
+
more attribute hashes to apply to the test plan.
|
|
75
|
+
|
|
76
|
+
The description you add will be prefixed in front of the 'desc' property
|
|
77
|
+
on the test plan itself.
|
|
78
|
+
|
|
79
|
+
@param {String} desc suite description
|
|
80
|
+
@param {Hash} attrs one or more attribute hashes
|
|
81
|
+
@returns {SC.TestSuite} suite instance
|
|
82
|
+
*/
|
|
83
|
+
generate: function(desc, attrs) {
|
|
84
|
+
var len = arguments.length,
|
|
85
|
+
ret = SC.beget(this),
|
|
86
|
+
idx, defs;
|
|
87
|
+
|
|
88
|
+
// apply attributes - skip first argument b/c it is a string
|
|
89
|
+
for(idx=1;idx<len;idx++) SC.mixin(ret, arguments[idx]);
|
|
90
|
+
ret.subdesc = desc ;
|
|
91
|
+
|
|
92
|
+
// invoke definitions
|
|
93
|
+
defs = ret.definitions ;
|
|
94
|
+
len = defs.length;
|
|
95
|
+
for(idx=0;idx<len;idx++) defs[idx].call(ret, ret);
|
|
96
|
+
|
|
97
|
+
return ret ;
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
Adds the passed function to the array of definitions that will be invoked
|
|
102
|
+
when the suite is generated.
|
|
103
|
+
|
|
104
|
+
The passed function should expect to have the TestSuite instance passed
|
|
105
|
+
as the first and only parameter. The function should actually define
|
|
106
|
+
a module and tests, which will be added to the test suite.
|
|
107
|
+
|
|
108
|
+
@param {Function} func definition function
|
|
109
|
+
@returns {SC.TestSuite} receiver
|
|
110
|
+
*/
|
|
111
|
+
define: function(func) {
|
|
112
|
+
this.definitions.push(func);
|
|
113
|
+
return this ;
|
|
114
|
+
},
|
|
44
115
|
|
|
116
|
+
/**
|
|
117
|
+
Definition functions. These are invoked in order when you generate a
|
|
118
|
+
suite to add unit tests and modules to the test plan.
|
|
119
|
+
*/
|
|
120
|
+
definitions: [],
|
|
45
121
|
|
|
46
|
-
|
|
47
|
-
|
|
122
|
+
/**
|
|
123
|
+
Generates a module description by merging the based description, sub
|
|
124
|
+
description and the passed description. This is usually used inside of
|
|
125
|
+
a suite definition function.
|
|
126
|
+
|
|
127
|
+
@param {String} str detailed description for this module
|
|
128
|
+
@returns {String} generated description
|
|
129
|
+
*/
|
|
130
|
+
desc: function(str) {
|
|
131
|
+
return this.basedesc.fmt(this.subdesc, str);
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
The base description string. This should accept two formatting options,
|
|
136
|
+
a sub description and a detailed description. This is the description
|
|
137
|
+
set when you call extend()
|
|
138
|
+
*/
|
|
139
|
+
basedesc: "%@ > %@",
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
Default setup method for use with modules. This method will call the
|
|
143
|
+
newObject() method and set its return value on the object property of
|
|
144
|
+
the receiver.
|
|
145
|
+
*/
|
|
146
|
+
setup: function() {
|
|
147
|
+
this.object = this.newObject();
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
Default teardown method for use with modules. This method will call the
|
|
152
|
+
destroyObejct() method, passing the current object property on the
|
|
153
|
+
receiver. It will also clear the object property.
|
|
154
|
+
*/
|
|
155
|
+
teardown: function() {
|
|
156
|
+
if (this.object) this.destroyObject(this.object);
|
|
157
|
+
this.object = null;
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
Default method to create a new object instance. You will probably want
|
|
162
|
+
to override this method when you generate() a suite with a function that
|
|
163
|
+
can generate the type of object you want to test.
|
|
164
|
+
|
|
165
|
+
@returns {Object} generated object
|
|
166
|
+
*/
|
|
167
|
+
newObject: function() { return null; },
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
Default method to destroy a generated object instance after a test has
|
|
171
|
+
completed. If you override newObject() you can also overried this method
|
|
172
|
+
to cleanup the object you just created.
|
|
173
|
+
|
|
174
|
+
Default method does nothing.
|
|
175
|
+
*/
|
|
176
|
+
destroyObject: function(obj) {
|
|
177
|
+
// do nothing.
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
Generates a default module with the description you provide. This is
|
|
182
|
+
a convenience function for use inside of a definition function. You could
|
|
183
|
+
do the same thing by calling:
|
|
184
|
+
|
|
185
|
+
{{{
|
|
186
|
+
var T = this ;
|
|
187
|
+
module(T.desc(description), {
|
|
188
|
+
setup: function() { T.setup(); },
|
|
189
|
+
teardown: function() { T.teardown(); }
|
|
190
|
+
}
|
|
191
|
+
}}}
|
|
192
|
+
|
|
193
|
+
@param {String} desc detailed descrition
|
|
194
|
+
@returns {SC.TestSuite} receiver
|
|
195
|
+
*/
|
|
196
|
+
module: function(desc) {
|
|
197
|
+
var T = this ;
|
|
198
|
+
module(T.desc(desc), {
|
|
199
|
+
setup: function() { T.setup(); },
|
|
200
|
+
teardown: function() { T.teardown(); }
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
SC.ArraySuite = SC.TestSuite.create("Verify SC.Array compliance: %@#%@", {
|
|
48
207
|
|
|
49
208
|
/**
|
|
50
209
|
Override to return a set of simple values such as numbers or strings.
|
|
@@ -367,7 +367,7 @@ SC.Array = {
|
|
|
367
367
|
The callback for a range observer should have the signature:
|
|
368
368
|
|
|
369
369
|
{{{
|
|
370
|
-
function rangePropertyDidChange(array, objects, key, indexes,
|
|
370
|
+
function rangePropertyDidChange(array, objects, key, indexes, context)
|
|
371
371
|
}}}
|
|
372
372
|
|
|
373
373
|
If the passed key is '[]' it means that the object itself changed.
|
|
@@ -448,9 +448,11 @@ SC.Array = {
|
|
|
448
448
|
@param {Number} start the starting index of the change
|
|
449
449
|
@param {Number} amt the final range of objects changed
|
|
450
450
|
@param {Number} delta if you added or removed objects, the delta change
|
|
451
|
+
@param {Array} addedObjects the objects that were added
|
|
452
|
+
@param {Array} removedObjects the objects that were removed
|
|
451
453
|
@returns {SC.Array} receiver
|
|
452
454
|
*/
|
|
453
|
-
enumerableContentDidChange: function(start, amt, delta) {
|
|
455
|
+
enumerableContentDidChange: function(start, amt, delta, addedObjects, removedObjects) {
|
|
454
456
|
var rangeob = this._array_rangeObservers,
|
|
455
457
|
oldlen = this._array_oldLength,
|
|
456
458
|
newlen, length, changes ;
|
|
@@ -482,6 +484,7 @@ SC.Array = {
|
|
|
482
484
|
changes.add(start, length);
|
|
483
485
|
}
|
|
484
486
|
|
|
487
|
+
this._setupEnumerableObservers(addedObjects, removedObjects);
|
|
485
488
|
this.notifyPropertyChange('[]') ;
|
|
486
489
|
this.endPropertyChanges();
|
|
487
490
|
|
|
@@ -588,19 +591,21 @@ if (!Array.prototype.lastIndexOf) {
|
|
|
588
591
|
|
|
589
592
|
// primitive for array support.
|
|
590
593
|
replace: function(idx, amt, objects) {
|
|
594
|
+
var removedObjects;
|
|
595
|
+
|
|
591
596
|
if (this.isFrozen) throw SC.FROZEN_ERROR ;
|
|
592
597
|
if (!objects || objects.length === 0) {
|
|
593
|
-
this.splice(idx, amt) ;
|
|
598
|
+
removedObjects = this.splice(idx, amt) ;
|
|
594
599
|
} else {
|
|
595
600
|
var args = [idx, amt].concat(objects) ;
|
|
596
|
-
this.splice.apply(this,args) ;
|
|
601
|
+
removedObjects = this.splice.apply(this,args) ;
|
|
597
602
|
}
|
|
598
603
|
|
|
599
604
|
// if we replaced exactly the same number of items, then pass only the
|
|
600
605
|
// replaced range. Otherwise, pass the full remaining array length
|
|
601
606
|
// since everything has shifted
|
|
602
607
|
var len = objects ? (objects.get ? objects.get('length') : objects.length) : 0;
|
|
603
|
-
this.enumerableContentDidChange(idx, amt, len - amt) ;
|
|
608
|
+
this.enumerableContentDidChange(idx, amt, len - amt, objects, removedObjects) ;
|
|
604
609
|
return this ;
|
|
605
610
|
},
|
|
606
611
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
|
6
6
|
// ==========================================================================
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
sc_require('core') ;
|
|
9
|
+
sc_require('system/enumerator');
|
|
10
10
|
|
|
11
11
|
/*globals Prototype */
|
|
12
12
|
|
|
@@ -815,13 +815,133 @@ SC.Reducers = /** @lends SC.Enumerable */ {
|
|
|
815
815
|
|
|
816
816
|
@param {Number} start optional start offset for the content change
|
|
817
817
|
@param {Number} length optional length of change
|
|
818
|
+
@param {Number} delta if you added or removed objects, the delta change
|
|
819
|
+
@param {Array} addedObjects the objects that were added
|
|
820
|
+
@param {Array} removedObjects the objects that were removed
|
|
818
821
|
@returns {Object} receiver
|
|
819
822
|
*/
|
|
820
|
-
enumerableContentDidChange: function(start, length) {
|
|
823
|
+
enumerableContentDidChange: function(start, length, delta, addedObjects, removedObjects) {
|
|
824
|
+
this._setupEnumerableObservers(addedObjects, removedObjects);
|
|
821
825
|
this.notifyPropertyChange('[]') ;
|
|
826
|
+
|
|
822
827
|
return this ;
|
|
823
828
|
},
|
|
824
829
|
|
|
830
|
+
/**
|
|
831
|
+
@private
|
|
832
|
+
|
|
833
|
+
Clones a segment of an observer chain and applies it
|
|
834
|
+
to an element of this Enumerable.
|
|
835
|
+
|
|
836
|
+
@param {SC._ChainObserver} chainObserver the chain segment to begin from
|
|
837
|
+
*/
|
|
838
|
+
_resumeChainObservingForItemWithChainObserver: function(item, chainObserver) {
|
|
839
|
+
var observer = SC.clone(chainObserver.next);
|
|
840
|
+
var key = observer.property;
|
|
841
|
+
|
|
842
|
+
// The chain observer should create new observers on the child object
|
|
843
|
+
observer.object = item;
|
|
844
|
+
item.addObserver(key, observer, observer.propertyDidChange);
|
|
845
|
+
|
|
846
|
+
// if we're in the initial chained observer setup phase, add the tail
|
|
847
|
+
// of the current observer segment to the list of tracked tails.
|
|
848
|
+
if(chainObserver.root.tails) {
|
|
849
|
+
chainObserver.root.tails.pushObject(observer.tail());
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
observer.propertyDidChange();
|
|
853
|
+
|
|
854
|
+
// Maintain a list of observers on the item so we can remove them
|
|
855
|
+
// if it is removed from the enumerable.
|
|
856
|
+
item._kvo_for(SC.keyFor('_kvo_enumerable_observers', key)).push(observer);
|
|
857
|
+
},
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
@private
|
|
861
|
+
|
|
862
|
+
When enumerable content has changed, remove enumerable observers from
|
|
863
|
+
items that are no longer in the enumerable, and add observers to newly
|
|
864
|
+
added items.
|
|
865
|
+
|
|
866
|
+
@param {Array} addedObjects the array of objects that have been added
|
|
867
|
+
@param {Array} removedObjects the array of objects that have been removed
|
|
868
|
+
*/
|
|
869
|
+
_setupEnumerableObservers: function(addedObjects, removedObjects) {
|
|
870
|
+
if (!addedObjects) { addedObjects = this; }
|
|
871
|
+
if (!removedObjects) { removedObjects = []; }
|
|
872
|
+
|
|
873
|
+
var observedKeys = this._kvo_for('_kvo_enumerable_observed_keys', SC.CoreSet);
|
|
874
|
+
var kvoKey;
|
|
875
|
+
|
|
876
|
+
// Only setup and teardown enumerable observers if we have keys to observe
|
|
877
|
+
if (observedKeys.get('length') > 0) {
|
|
878
|
+
// Loop through removed objects and remove any enumerable observers that
|
|
879
|
+
// belong to them.
|
|
880
|
+
removedObjects.forEach(function(item) {
|
|
881
|
+
item._kvo_for('_kvo_enumerable_observers').forEach(function(observer) {
|
|
882
|
+
// Remove the observer if it is pointing at this enumerable.
|
|
883
|
+
// If the observer belongs to another enumerable, just ignore it.
|
|
884
|
+
if (observer.object === this) {
|
|
885
|
+
item.removeObserver(observer.key, observer, observer.propertyDidChange);
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
});
|
|
889
|
+
|
|
890
|
+
// added and resume the chain observer.
|
|
891
|
+
observedKeys.forEach(function(key) {
|
|
892
|
+
kvoKey = SC.keyFor('_kvo_enumerable_observers', key);
|
|
893
|
+
|
|
894
|
+
var lastObserver;
|
|
895
|
+
|
|
896
|
+
// Get all original ChainObservers associated with the key
|
|
897
|
+
this._kvo_for(kvoKey).forEach(function(observer) {
|
|
898
|
+
// if there are no added objects or removed objects, this
|
|
899
|
+
// object is a proxy (like ArrayController), which does
|
|
900
|
+
// not currently receive the added or removed objects.
|
|
901
|
+
// As a result, walk down to the last element of the
|
|
902
|
+
// chain and trigger its propertyDidChange, which will
|
|
903
|
+
// invalidate anything listening.
|
|
904
|
+
if(!addedObjects.get('length') && !removedObjects.get('length')) {
|
|
905
|
+
lastObserver = observer;
|
|
906
|
+
while(lastObserver.next) { lastObserver = lastObserver.next; }
|
|
907
|
+
lastObserver.propertyDidChange();
|
|
908
|
+
} else {
|
|
909
|
+
addedObjects.forEach(function(item) {
|
|
910
|
+
this._resumeChainObservingForItemWithChainObserver(item, observer);
|
|
911
|
+
}, this);
|
|
912
|
+
}
|
|
913
|
+
}, this);
|
|
914
|
+
}, this);
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
@private
|
|
920
|
+
|
|
921
|
+
Adds an enumerable observer. Enumerable observers are able to
|
|
922
|
+
propagate chain observers to each member item in the enumerable,
|
|
923
|
+
so that the observer is fired whenever a single item changes.
|
|
924
|
+
|
|
925
|
+
You should never call this method directly. Instead, you should
|
|
926
|
+
call addObserver() with the special '[]' property in the path.
|
|
927
|
+
|
|
928
|
+
For example, if you wanted to observe changes to each item's isDone
|
|
929
|
+
property, you could call:
|
|
930
|
+
|
|
931
|
+
arrayController.addObserver('[].isDone');
|
|
932
|
+
*/
|
|
933
|
+
addEnumerableObserver: function(key, target, action) {
|
|
934
|
+
// Add the key to a set so we know what we are observing
|
|
935
|
+
this._kvo_for('_kvo_enumerable_observed_keys', SC.CoreSet).push(key);
|
|
936
|
+
|
|
937
|
+
// Add the passed ChainObserver to an ObserverSet for that key
|
|
938
|
+
var kvoKey = SC.keyFor('_kvo_enumerable_observers', key);
|
|
939
|
+
this._kvo_for(kvoKey).push(target);
|
|
940
|
+
|
|
941
|
+
// set up chained observers on the initial content
|
|
942
|
+
this._setupEnumerableObservers(this);
|
|
943
|
+
},
|
|
944
|
+
|
|
825
945
|
/**
|
|
826
946
|
Call this method from your unknownProperty() handler to implement
|
|
827
947
|
automatic reduced properties. A reduced property is a property that
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
|
6
6
|
// ==========================================================================
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
sc_require('private/observer_set');
|
|
9
|
+
sc_require('private/chain_observer');
|
|
9
10
|
|
|
10
11
|
/*globals logChange */
|
|
11
12
|
|
|
@@ -523,10 +524,16 @@ SC.Observable = {
|
|
|
523
524
|
while(--idx >= lim) {
|
|
524
525
|
dep = keys[idx] ;
|
|
525
526
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
if (dep.indexOf('.') >= 0) {
|
|
528
|
+
this.addObserver(dep, this, function() {
|
|
529
|
+
this.propertyDidChange(key);
|
|
530
|
+
});
|
|
531
|
+
} else {
|
|
532
|
+
// add dependent key to dependents array of key it depends on
|
|
533
|
+
queue = dependents[dep] ;
|
|
534
|
+
if (!queue) { queue = dependents[dep] = [] ; }
|
|
535
|
+
queue.push(key) ;
|
|
536
|
+
}
|
|
530
537
|
}
|
|
531
538
|
},
|
|
532
539
|
|