sproutcore 1.5.0.pre.3 → 1.5.0.pre.4
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Nested Records (SC.
|
2
|
+
* Nested Records (SC.Record) Unit Test
|
3
3
|
*
|
4
4
|
* @author Evin Grano
|
5
5
|
*/
|
@@ -12,13 +12,13 @@ var NestedRecord, store, testParent, testParent2, childData1;
|
|
12
12
|
var initModels = function(){
|
13
13
|
NestedRecord.ParentRecordTest = SC.Record.extend({
|
14
14
|
/** Child Record Namespace */
|
15
|
-
|
15
|
+
nestedRecordNamespace: NestedRecord,
|
16
16
|
|
17
17
|
name: SC.Record.attr(String),
|
18
18
|
info: SC.Record.toOne('NestedRecord.ChildRecordTest', { nested: true })
|
19
19
|
});
|
20
20
|
|
21
|
-
NestedRecord.ChildRecordTest = SC.
|
21
|
+
NestedRecord.ChildRecordTest = SC.Record.extend({
|
22
22
|
id: SC.Record.attr(String),
|
23
23
|
name: SC.Record.attr(String),
|
24
24
|
value: SC.Record.attr(String)
|
@@ -44,7 +44,7 @@ module("Basic SC.Record Functions w/ Parent > Child", {
|
|
44
44
|
type: 'ChildRecordTest',
|
45
45
|
name: 'Child Name',
|
46
46
|
value: 'Blue Goo',
|
47
|
-
|
47
|
+
guid: '5001'
|
48
48
|
}
|
49
49
|
});
|
50
50
|
// Test parent 2
|
@@ -54,7 +54,7 @@ module("Basic SC.Record Functions w/ Parent > Child", {
|
|
54
54
|
type: 'ChildRecordTest',
|
55
55
|
name: 'Child Name 2',
|
56
56
|
value: 'Purple Goo',
|
57
|
-
|
57
|
+
guid: '5002'
|
58
58
|
}
|
59
59
|
});
|
60
60
|
SC.RunLoop.end();
|
@@ -67,7 +67,7 @@ module("Basic SC.Record Functions w/ Parent > Child", {
|
|
67
67
|
type: 'ChildRecordTest',
|
68
68
|
name: 'Child Name',
|
69
69
|
value: 'Green Goo',
|
70
|
-
|
70
|
+
guid: '5002'
|
71
71
|
};
|
72
72
|
},
|
73
73
|
|
@@ -92,7 +92,7 @@ test("Function: readAttribute()", function() {
|
|
92
92
|
type: 'ChildRecordTest',
|
93
93
|
name: 'Child Name',
|
94
94
|
value: 'Blue Goo',
|
95
|
-
|
95
|
+
guid: '5001'
|
96
96
|
},
|
97
97
|
"readAttribute should be correct for info child attribute");
|
98
98
|
|
@@ -105,7 +105,7 @@ test("Support Multiple Parent Records With Different Child Records", function()
|
|
105
105
|
type: 'ChildRecordTest',
|
106
106
|
name: 'Child Name 2',
|
107
107
|
value: 'Purple Goo',
|
108
|
-
|
108
|
+
guid: '5002'
|
109
109
|
},
|
110
110
|
"readAttribute should be correct for info child attribute on new record");
|
111
111
|
equals(testParent2.get('info').get('value'), 'Purple Goo', "get should retrieve the proper value on new record");
|
@@ -115,7 +115,7 @@ test("Support Multiple Parent Records With Different Child Records", function()
|
|
115
115
|
type: 'ChildRecordTest',
|
116
116
|
name: 'Child Name',
|
117
117
|
value: 'Blue Goo',
|
118
|
-
|
118
|
+
guid: '5001'
|
119
119
|
},
|
120
120
|
"readAttribute should be correct for info child attribute on first record");
|
121
121
|
equals(testParent.get('info').get('value'), 'Blue Goo', "get should retrieve the proper value on first record");
|
@@ -152,7 +152,7 @@ test("Basic Read", function() {
|
|
152
152
|
// Test Child Record creation
|
153
153
|
var cr = testParent.get('info');
|
154
154
|
// Check Model Class information
|
155
|
-
ok(SC.kindOf(cr, SC.
|
155
|
+
ok(SC.kindOf(cr, SC.Record), "get() creates an actual instance that is a kind of a SC.Record Object");
|
156
156
|
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "get() creates an actual instance of a ChildRecordTest Object");
|
157
157
|
|
158
158
|
// Check reference information
|
@@ -171,13 +171,9 @@ test("Basic Read", function() {
|
|
171
171
|
var oldKey = cr.get(pm), newKey = sameCR.get(pm);
|
172
172
|
equals(oldKey, newKey, "check to see if the Primary Key are the same");
|
173
173
|
same(sameCR, cr, "check to see that it is the same child record as before");
|
174
|
-
|
175
|
-
// ID check
|
176
|
-
id = sameCR.get('id');
|
177
|
-
ok((id !== oldKey), "if there is an id param, it should be different from the Primary Key: %@ != %@".fmt(id, oldKey));
|
178
174
|
});
|
179
175
|
|
180
|
-
test("Basic Write", function() {
|
176
|
+
test("Basic Write As a Hash", function() {
|
181
177
|
|
182
178
|
// Test general gets
|
183
179
|
testParent.set('name', 'New Parent Name');
|
@@ -190,11 +186,12 @@ test("Basic Write", function() {
|
|
190
186
|
testParent.set('info', {
|
191
187
|
type: 'ChildRecordTest',
|
192
188
|
name: 'New Child Name',
|
193
|
-
value: 'Red Goo'
|
189
|
+
value: 'Red Goo',
|
190
|
+
guid: '6001'
|
194
191
|
});
|
195
192
|
var cr = testParent.get('info');
|
196
193
|
// Check Model Class information
|
197
|
-
ok(SC.kindOf(cr, SC.
|
194
|
+
ok(SC.kindOf(cr, SC.Record), "set() with an object creates an actual instance that is a kind of a SC.Record Object");
|
198
195
|
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "set() with an object creates an actual instance of a ChildRecordTest Object");
|
199
196
|
|
200
197
|
// Check reference information
|
@@ -216,6 +213,43 @@ test("Basic Write", function() {
|
|
216
213
|
same(testParent.readAttribute('info'), cr.get('attributes'), "after a set('name', <new>) on child, readAttribute on the parent should be correct for info child attributes");
|
217
214
|
});
|
218
215
|
|
216
|
+
test("Basic Write As a Child Record", function() {
|
217
|
+
|
218
|
+
// Test general gets
|
219
|
+
testParent.set('name', 'New Parent Name');
|
220
|
+
equals(testParent.get('name'), 'New Parent Name', "set() should change name attribute");
|
221
|
+
testParent.set('nothing', 'nothing');
|
222
|
+
equals(testParent.get('nothing'), 'nothing', "set should change non-existent property to a new property");
|
223
|
+
|
224
|
+
// Test Child Record creation
|
225
|
+
var store = testParent.get('store');
|
226
|
+
var cr = store.createRecord(NestedRecord.ChildRecordTest, {type: 'ChildRecordTest', name: 'New Child Name', value: 'Red Goo', guid: '6001'});
|
227
|
+
// Check Model Class information
|
228
|
+
ok(SC.kindOf(cr, SC.Record), "before the set(), check for actual instance that is a kind of a SC.Record Object");
|
229
|
+
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "before the set(), check for actual instance of a ChildRecordTest Object");
|
230
|
+
testParent.set('info', cr);
|
231
|
+
cr = testParent.get('info');
|
232
|
+
// Check Model Class information
|
233
|
+
ok(SC.kindOf(cr, SC.Record), "set() with an object creates an actual instance that is a kind of a SC.Record Object");
|
234
|
+
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "set() with an object creates an actual instance of a ChildRecordTest Object");
|
235
|
+
|
236
|
+
// Check reference information
|
237
|
+
var pm = cr.get('primaryKey');
|
238
|
+
var key = cr.get(pm);
|
239
|
+
var storeRef = store.find(NestedRecord.ChildRecordTest, key);
|
240
|
+
ok(storeRef, 'after a set() with an object, checking that the store has the instance of the child record with proper primary key');
|
241
|
+
equals(cr, storeRef, "after a set with an object, checking the parent reference is the same as the direct store reference");
|
242
|
+
|
243
|
+
// Check for changes on the child bubble to the parent.
|
244
|
+
cr.set('name', 'Child Name Change');
|
245
|
+
equals(cr.get('name'), 'Child Name Change', "after a set('name', <new>) on child, checking that the value is updated");
|
246
|
+
ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
|
247
|
+
ok(testParent.get('status') & SC.Record.DIRTY, 'check that the parent record is dirty');
|
248
|
+
var newCR = testParent.get('info');
|
249
|
+
same(newCR, cr, "after a set('name', <new>) on child, checking to see that the parent has recieved the changes from the child record");
|
250
|
+
same(testParent.readAttribute('info'), cr.get('attributes'), "after a set('name', <new>) on child, readAttribute on the parent should be correct for info child attributes");
|
251
|
+
});
|
252
|
+
|
219
253
|
test("Child Status Changed", function() {
|
220
254
|
var cr;
|
221
255
|
cr = testParent.get('info');
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Nested Record Array of SC.
|
2
|
+
* Nested Record Array of SC.Records Unit Test
|
3
3
|
*
|
4
4
|
* @author Evin Grano
|
5
5
|
*/
|
@@ -12,18 +12,18 @@ var NestedRecord, store, testParent, testParent2;
|
|
12
12
|
var initModels = function(){
|
13
13
|
NestedRecord.ParentRecordTest = SC.Record.extend({
|
14
14
|
/** Child Record Namespace */
|
15
|
-
|
15
|
+
nestedRecordNamespace: NestedRecord,
|
16
16
|
|
17
17
|
name: SC.Record.attr(String),
|
18
|
-
elements: SC.Record.toMany('SC.
|
18
|
+
elements: SC.Record.toMany('SC.Record', { nested: true })
|
19
19
|
});
|
20
20
|
|
21
|
-
NestedRecord.ChildRecordTest1 = SC.
|
21
|
+
NestedRecord.ChildRecordTest1 = SC.Record.extend({
|
22
22
|
name: SC.Record.attr(String),
|
23
23
|
value: SC.Record.attr(String)
|
24
24
|
});
|
25
25
|
|
26
|
-
NestedRecord.ChildRecordTest2 = SC.
|
26
|
+
NestedRecord.ChildRecordTest2 = SC.Record.extend({
|
27
27
|
name: SC.Record.attr(String),
|
28
28
|
info: SC.Record.attr(String),
|
29
29
|
value: SC.Record.attr(String)
|
@@ -160,7 +160,7 @@ test("Basic Read", function() {
|
|
160
160
|
ok(SC.instanceOf(arrayOfCRs, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
|
161
161
|
equals(arrayOfCRs.get('length'), 4, "check that the length of the array of child records is 4");
|
162
162
|
var cr = arrayOfCRs.objectAt(0);
|
163
|
-
ok(SC.kindOf(cr, SC.
|
163
|
+
ok(SC.kindOf(cr, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
|
164
164
|
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that first ChildRecord from the get() creates an actual instance of a ChildRecordTest1 Object");
|
165
165
|
|
166
166
|
// Check reference information
|
@@ -209,7 +209,7 @@ test("Basic Write", function() {
|
|
209
209
|
equals(newArray.get('length'), 3, "after set() on parent, check that the length of the array of child records is 3");
|
210
210
|
var cr = newArray.objectAt(0);
|
211
211
|
|
212
|
-
ok(SC.kindOf(cr, SC.
|
212
|
+
ok(SC.kindOf(cr, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
|
213
213
|
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that first ChildRecord from the get() creates an actual instance of a ChildRecordTest1 Object");
|
214
214
|
});
|
215
215
|
|
@@ -241,7 +241,7 @@ test("Basic Write: reference tests", function() {
|
|
241
241
|
same(readAttrsArray[0], newCR.get('attributes'), "after a set('name', <new>) on child, readAttribute on the parent should be correct for info child attributes");
|
242
242
|
});
|
243
243
|
|
244
|
-
test("Basic Array Functionality: pushObject", function() {
|
244
|
+
test("Basic Array Functionality: pushObject w/ HASH", function() {
|
245
245
|
var elements, elementsAttrs, cr, crFirst, crLast;
|
246
246
|
// Add something to the array
|
247
247
|
elements = testParent.get('elements');
|
@@ -250,7 +250,7 @@ test("Basic Array Functionality: pushObject", function() {
|
|
250
250
|
elements = testParent.get('elements');
|
251
251
|
equals(elements.get('length'), 5, "after pushObject() on parent, check that the length of the array of child records is 5");
|
252
252
|
cr = elements.objectAt(4);
|
253
|
-
ok(SC.kindOf(cr, SC.
|
253
|
+
ok(SC.kindOf(cr, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
|
254
254
|
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that newly added ChildRecord creates an actual instance of a ChildRecordTest1 Object");
|
255
255
|
equals(cr.get('name'), 'Testikles', "after a pushObject on parent, check to see if it has all the right values for the attributes");
|
256
256
|
ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
|
@@ -265,6 +265,32 @@ test("Basic Array Functionality: pushObject", function() {
|
|
265
265
|
same(elementsAttrs[4], crLast, "verify that parent attributes are the same as the last individual child attributes");
|
266
266
|
});
|
267
267
|
|
268
|
+
test("Basic Array Functionality: pushObject w/ ChildRecord", function() {
|
269
|
+
var elements, elementsAttrs, cr, crFirst, crLast;
|
270
|
+
// Add something to the array
|
271
|
+
elements = testParent.get('elements');
|
272
|
+
// PushObject Tests
|
273
|
+
cr = store.createRecord(NestedRecord.ChildRecordTest1, { type: 'ChildRecordTest1', name: 'Testikles', value: 'God Of Fertility'});
|
274
|
+
elements.pushObject(cr);
|
275
|
+
elements = testParent.get('elements');
|
276
|
+
equals(elements.get('length'), 5, "after pushObject() on parent, check that the length of the array of child records is 5");
|
277
|
+
cr = elements.objectAt(4);
|
278
|
+
ok(SC.kindOf(cr, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
|
279
|
+
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that newly added ChildRecord creates an actual instance of a ChildRecordTest1 Object");
|
280
|
+
equals(cr.get('name'), 'Testikles', "after a pushObject on parent, check to see if it has all the right values for the attributes");
|
281
|
+
ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
|
282
|
+
ok(testParent.get('status') & SC.Record.DIRTY, 'check that the parent record is dirty');
|
283
|
+
|
284
|
+
// Verify the Attrs
|
285
|
+
elementsAttrs = testParent.readAttribute('elements');
|
286
|
+
equals(elementsAttrs.length, 5, "after pushObject() on parent, check that the length of the attribute array of child records is 5");
|
287
|
+
crFirst = elements.objectAt(0).get('attributes');
|
288
|
+
crLast = elements.objectAt(4).get('attributes');
|
289
|
+
same(elementsAttrs[0], crFirst, "verify that parent attributes are the same as the first individual child attributes");
|
290
|
+
same(elementsAttrs[4], crLast, "verify that parent attributes are the same as the last individual child attributes");
|
291
|
+
});
|
292
|
+
|
293
|
+
|
268
294
|
test("Basic Array Functionality: popObject", function() {
|
269
295
|
var elements, elementsAttrs, cr, crFirst, crLast;
|
270
296
|
// Add something to the array
|
@@ -304,7 +330,7 @@ test("Basic Array Functionality: unshiftObject", function() {
|
|
304
330
|
elements = testParent.get('elements');
|
305
331
|
equals(elements.get('length'), 5, "after pushObject() on parent, check that the length of the array of child records is 5");
|
306
332
|
cr = elements.objectAt(0);
|
307
|
-
ok(SC.kindOf(cr, SC.
|
333
|
+
ok(SC.kindOf(cr, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
|
308
334
|
ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that newly added ChildRecord creates an actual instance of a ChildRecordTest1 Object");
|
309
335
|
equals(cr.get('name'), 'Testikles', "after a pushObject on parent, check to see if it has all the right values for the attributes");
|
310
336
|
ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
|
@@ -12,21 +12,21 @@ var NestedRecord, store, testParent, peopleData1, peopleData2, personData1, addr
|
|
12
12
|
var initModels = function(){
|
13
13
|
NestedRecord.Group = SC.Record.extend({
|
14
14
|
/** Child Record Namespace */
|
15
|
-
|
15
|
+
nestedRecordNamespace: NestedRecord,
|
16
16
|
|
17
17
|
name: SC.Record.attr(String),
|
18
18
|
people: SC.Record.toMany('NestedRecord.Person', { nested: true })
|
19
19
|
});
|
20
20
|
|
21
|
-
NestedRecord.Person = SC.
|
21
|
+
NestedRecord.Person = SC.Record.extend({
|
22
22
|
/** Child Record Namespace */
|
23
|
-
|
23
|
+
nestedRecordNamespace: NestedRecord,
|
24
24
|
|
25
25
|
name: SC.Record.attr(String),
|
26
26
|
addresses: SC.Record.toMany('NestedRecord.Address', { nested: true })
|
27
27
|
});
|
28
28
|
|
29
|
-
NestedRecord.Address = SC.
|
29
|
+
NestedRecord.Address = SC.Record.extend({
|
30
30
|
street: SC.Record.attr(String),
|
31
31
|
city: SC.Record.attr(String),
|
32
32
|
state: SC.Record.attr(String, {defaultValue: "VA"})
|
@@ -36,7 +36,7 @@ var initModels = function(){
|
|
36
36
|
// ..........................................................
|
37
37
|
// Basic SC.ParentRecord with an Array of Children
|
38
38
|
//
|
39
|
-
module("Complex SC.
|
39
|
+
module("Complex SC.Record: Parent > Array of Children > Array of Children", {
|
40
40
|
|
41
41
|
setup: function() {
|
42
42
|
NestedRecord = SC.Object.create({
|
@@ -184,7 +184,7 @@ test("Basic Read, Testing the First Child Array", function() {
|
|
184
184
|
ok(SC.instanceOf(ppl, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
|
185
185
|
equals(ppl.get('length'), 3, "check that the length of the array of child records is 3");
|
186
186
|
p = ppl.objectAt(0);
|
187
|
-
ok(SC.kindOf(p, SC.
|
187
|
+
ok(SC.kindOf(p, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
|
188
188
|
ok(SC.instanceOf(p, NestedRecord.Person), "check that first ChildRecord from the get() creates an actual instance of a Person Object");
|
189
189
|
|
190
190
|
// Check reference information
|
@@ -225,7 +225,7 @@ test("Basic Read, Testing the Second Child Array", function() {
|
|
225
225
|
ok(SC.instanceOf(addrs, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
|
226
226
|
equals(addrs.get('length'), 2, "check that the length of the array of child records is 2");
|
227
227
|
a = addrs.objectAt(0);
|
228
|
-
ok(SC.kindOf(a, SC.
|
228
|
+
ok(SC.kindOf(a, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
|
229
229
|
ok(SC.instanceOf(a, NestedRecord.Address), "check that first ChildRecord from the get() creates an actual instance of a Address Object");
|
230
230
|
|
231
231
|
// Check reference information
|
@@ -269,7 +269,7 @@ test("Basic Write: Testing the First Child Array", function() {
|
|
269
269
|
ok(SC.instanceOf(ppl, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
|
270
270
|
equals(ppl.get('length'), 2, "after set() on parent, check that the length of the array of child records is 2");
|
271
271
|
p = ppl.objectAt(0);
|
272
|
-
ok(SC.kindOf(p, SC.
|
272
|
+
ok(SC.kindOf(p, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
|
273
273
|
ok(SC.instanceOf(p, NestedRecord.Person), "check that first ChildRecord from the get() creates an actual instance of a Person Object");
|
274
274
|
|
275
275
|
// TODO: [EG] Add test to make sure the number of ChildRecords in store is correct when we add store recored clearing
|
@@ -329,7 +329,7 @@ test("Basic Array Functionality: pushObject", function() {
|
|
329
329
|
ppl = testParent.get('people');
|
330
330
|
equals(ppl.get('length'), 4, "after pushObject() on parent, check that the length of the array of child records is 4");
|
331
331
|
p = ppl.objectAt(3);
|
332
|
-
ok(SC.kindOf(p, SC.
|
332
|
+
ok(SC.kindOf(p, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
|
333
333
|
ok(SC.instanceOf(p, NestedRecord.Person), "check that newly added ChildRecord creates an actual instance of a Person Object");
|
334
334
|
equals(p.get('name'), 'Testikles, God Of Fertility', "after a pushObject on parent, check to see if it has all the right values for the attributes");
|
335
335
|
ok(p.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
|
@@ -353,7 +353,7 @@ test("Basic Array Functionality: popObject", function() {
|
|
353
353
|
ppl = testParent.get('people');
|
354
354
|
equals(ppl.get('length'), 2, "after popObject() on parent, check that the length of the array of child records is 2");
|
355
355
|
p = ppl.objectAt(0);
|
356
|
-
ok(SC.kindOf(p, SC.
|
356
|
+
ok(SC.kindOf(p, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
|
357
357
|
ok(SC.instanceOf(p, NestedRecord.Person), "check that newly added ChildRecord creates an actual instance of a Person Object");
|
358
358
|
equals(p.get('name'), 'Barack Obama', "after a pushObject on parent, check to see if it has all the right values for the attributes");
|
359
359
|
ok(p.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
|
@@ -390,7 +390,7 @@ test("Basic Array Functionality: unshiftObject", function() {
|
|
390
390
|
ppl = testParent.get('people');
|
391
391
|
equals(ppl.get('length'), 4, "after unshiftObject() on parent, check that the length of the array of child records is 4");
|
392
392
|
p = ppl.objectAt(0);
|
393
|
-
ok(SC.kindOf(p, SC.
|
393
|
+
ok(SC.kindOf(p, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
|
394
394
|
ok(SC.instanceOf(p, NestedRecord.Person), "check that newly added ChildRecord creates an actual instance of a Person Object");
|
395
395
|
equals(p.get('name'), 'Testikles, God Of Fertility', "after a pushObject on parent, check to see if it has all the right values for the attributes");
|
396
396
|
ok(p.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Complex Nested Records (SC.
|
2
|
+
* Complex Nested Records (SC.Record) Unit Test
|
3
3
|
*
|
4
4
|
* @author Evin Grano
|
5
5
|
*/
|
@@ -10,15 +10,15 @@
|
|
10
10
|
var NestedRecord, store, testParent;
|
11
11
|
|
12
12
|
var initModels = function(){
|
13
|
-
NestedRecord.Address = SC.
|
13
|
+
NestedRecord.Address = SC.Record.extend({
|
14
14
|
street: SC.Record.attr(String),
|
15
15
|
city: SC.Record.attr(String),
|
16
16
|
state: SC.Record.attr(String, {defaultValue: 'VA'})
|
17
17
|
});
|
18
18
|
|
19
|
-
NestedRecord.Person = SC.
|
19
|
+
NestedRecord.Person = SC.Record.extend({
|
20
20
|
/** Child Record Namespace */
|
21
|
-
|
21
|
+
nestedRecordNamespace: NestedRecord,
|
22
22
|
|
23
23
|
name: SC.Record.attr(String),
|
24
24
|
address: SC.Record.toOne('NestedRecord.Address', { nested: true })
|
@@ -26,7 +26,7 @@ var initModels = function(){
|
|
26
26
|
|
27
27
|
NestedRecord.ParentRecordTest = SC.Record.extend({
|
28
28
|
/** Child Record Namespace */
|
29
|
-
|
29
|
+
nestedRecordNamespace: NestedRecord,
|
30
30
|
|
31
31
|
name: SC.Record.attr(String),
|
32
32
|
person: SC.Record.toOne('NestedRecord.Person', { nested: true })
|
@@ -209,7 +209,7 @@ function() {
|
|
209
209
|
// Test Child Record creation
|
210
210
|
var p = testParent.get('person');
|
211
211
|
// Check Model Class information
|
212
|
-
ok(SC.kindOf(p, SC.
|
212
|
+
ok(SC.kindOf(p, SC.Record), "(parent > child).get() creates an actual instance that is a kind of a SC.Record Object");
|
213
213
|
ok(SC.instanceOf(p, NestedRecord.Person), "(parent > child).get() creates an actual instance of a Person Object");
|
214
214
|
|
215
215
|
// Check reference information
|
@@ -222,7 +222,7 @@ function() {
|
|
222
222
|
|
223
223
|
var a = testParent.getPath('person.address');
|
224
224
|
// Check Model Class information
|
225
|
-
ok(SC.kindOf(a, SC.
|
225
|
+
ok(SC.kindOf(a, SC.Record), "(parent > child > child) w/ getPath() creates an actual instance that is a kind of a SC.Record Object");
|
226
226
|
ok(SC.instanceOf(a, NestedRecord.Address), "(parent > child > child) w/ getPath() creates an actual instance of an Address Object");
|
227
227
|
|
228
228
|
// Check reference information
|
@@ -257,7 +257,7 @@ function() {
|
|
257
257
|
});
|
258
258
|
p = testParent.get('person');
|
259
259
|
// Check Model Class information
|
260
|
-
ok(SC.kindOf(p, SC.
|
260
|
+
ok(SC.kindOf(p, SC.Record), "set() with an object creates an actual instance that is a kind of a SC.Record Object");
|
261
261
|
ok(SC.instanceOf(p, NestedRecord.Person), "set() with an object creates an actual instance of a ChildRecordTest Object");
|
262
262
|
|
263
263
|
// Check reference information
|
@@ -57,12 +57,12 @@ module("SC.Record normalize method", {
|
|
57
57
|
|
58
58
|
// A parent record
|
59
59
|
MyApp.FooParent = SC.Record.extend({
|
60
|
-
|
60
|
+
nestedRecordNamespace: MyApp,
|
61
61
|
myChild: SC.ChildAttribute.attr('MyApp.FooChild')
|
62
62
|
});
|
63
63
|
|
64
64
|
// A child record
|
65
|
-
MyApp.FooChild = SC.
|
65
|
+
MyApp.FooChild = SC.Record.extend({
|
66
66
|
});
|
67
67
|
|
68
68
|
MyApp.Bar = SC.Record.extend({
|
@@ -310,6 +310,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
310
310
|
- %M - Minute of the hour (00..59)
|
311
311
|
- %p - Meridian indicator (``AM'' or ``PM'')
|
312
312
|
- %S - Second of the minute (00..60)
|
313
|
+
- %s - Milliseconds of the second (000..999)
|
313
314
|
- %U - Week number of the current year,
|
314
315
|
starting with the first Sunday as the first
|
315
316
|
day of the first week (00..53)
|
@@ -901,7 +902,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
901
902
|
parse: function(str, fmt) {
|
902
903
|
// Declared as an object not a literal since in some browsers the literal
|
903
904
|
// retains state across function calls
|
904
|
-
var re = new RegExp('(?:%([
|
905
|
+
var re = new RegExp('(?:%([aAbBcdHIjmMpsSUWwxXyYZ%])|(.))', "g");
|
905
906
|
var d, parts, opts = {}, check = {}, scanner = SC.Scanner.create({string: str});
|
906
907
|
|
907
908
|
if (SC.none(fmt)) fmt = SC.DATETIME_ISO8601;
|
@@ -922,6 +923,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
922
923
|
case 'M': opts.minute = scanner.scanInt(1, 2); break;
|
923
924
|
case 'p': opts.meridian = scanner.scanArray(['AM', 'PM']); break;
|
924
925
|
case 'S': opts.second = scanner.scanInt(1, 2); break;
|
926
|
+
case 's': opts.millisecond = scanner.scanInt(1, 3); break;
|
925
927
|
case 'U': throw "%U is not implemented";
|
926
928
|
case 'W': throw "%W is not implemented";
|
927
929
|
case 'w': throw "%w is not implemented";
|
@@ -1013,6 +1015,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
1013
1015
|
case 'M': return this._pad(this._get('minute'));
|
1014
1016
|
case 'p': return this._get('hour') > 11 ? 'PM' : 'AM';
|
1015
1017
|
case 'S': return this._pad(this._get('second'));
|
1018
|
+
case 's': return this._pad(this._get('millisecond'), 3);
|
1016
1019
|
case 'u': return this._pad(this._get('utc')); //utc
|
1017
1020
|
case 'U': return this._pad(this._get('week0'));
|
1018
1021
|
case 'W': return this._pad(this._get('week1'));
|
@@ -1041,7 +1044,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
1041
1044
|
// need to move into local time zone for these calculations
|
1042
1045
|
this._setCalcState(start - (timezone * 60000), 0); // so simulate a shifted 'UTC' time
|
1043
1046
|
|
1044
|
-
return format.replace(/\%([
|
1047
|
+
return format.replace(/\%([aAbBcdDHiIjmMpsSUWwxXyYZ\%])/g, function() {
|
1045
1048
|
var v = that.__toFormattedString.call(that, arguments, start, timezone);
|
1046
1049
|
return v;
|
1047
1050
|
});
|
@@ -1103,38 +1106,3 @@ SC.Binding.dateTime = function(format) {
|
|
1103
1106
|
return value ? value.toFormattedString(format) : null;
|
1104
1107
|
});
|
1105
1108
|
};
|
1106
|
-
|
1107
|
-
if (SC.RecordAttribute && !SC.RecordAttribute.transforms[SC.guidFor(SC.DateTime)]) {
|
1108
|
-
|
1109
|
-
/**
|
1110
|
-
Registers a transform to allow SC.DateTime to be used as a record attribute,
|
1111
|
-
ie SC.Record.attr(SC.DateTime);
|
1112
|
-
|
1113
|
-
Because SC.RecordAttribute is in the datastore framework and SC.DateTime in
|
1114
|
-
the foundation framework, and we don't know which framework is being loaded
|
1115
|
-
first, this chunck of code is duplicated in both frameworks.
|
1116
|
-
|
1117
|
-
IF YOU EDIT THIS CODE MAKE SURE YOU COPY YOUR CHANGES to record_attribute.js.
|
1118
|
-
*/
|
1119
|
-
SC.RecordAttribute.registerTransform(SC.DateTime, {
|
1120
|
-
|
1121
|
-
/** @private
|
1122
|
-
Convert a String to a DateTime
|
1123
|
-
*/
|
1124
|
-
to: function(str, attr) {
|
1125
|
-
if (SC.none(str) || SC.instanceOf(str, SC.DateTime)) return str;
|
1126
|
-
var format = attr.get('format');
|
1127
|
-
return SC.DateTime.parse(str, format ? format : SC.DateTime.recordFormat);
|
1128
|
-
},
|
1129
|
-
|
1130
|
-
/** @private
|
1131
|
-
Convert a DateTime to a String
|
1132
|
-
*/
|
1133
|
-
from: function(dt, attr) {
|
1134
|
-
if (SC.none(dt)) return dt;
|
1135
|
-
var format = attr.get('format');
|
1136
|
-
return dt.toFormattedString(format ? format : SC.DateTime.recordFormat);
|
1137
|
-
}
|
1138
|
-
});
|
1139
|
-
|
1140
|
-
}
|
@@ -14,7 +14,7 @@ SC._mapDisplayNamesUseHashForSeenTypes = ['object', 'number', 'boolean', 'array'
|
|
14
14
|
|
15
15
|
|
16
16
|
SC.mapDisplayNames = function(obj, level, path, seenHash, seenArray) {
|
17
|
-
if (!SC.browser.
|
17
|
+
if (!SC.browser.webkit) return ;
|
18
18
|
|
19
19
|
// Lazily instantiate the hash of types we'll use a hash for the "have we
|
20
20
|
// seen this before?" structure. (Some types are not safe to put in a hash
|
@@ -20,8 +20,7 @@ SC.designsController = SC.ArrayController.create(SC.CollectionViewDelegate,
|
|
20
20
|
|
21
21
|
for(var v in page){
|
22
22
|
if(page.hasOwnProperty(v)){
|
23
|
-
if(page[v] && page[v].kindOf){
|
24
|
-
|
23
|
+
if(v !== '__sc_super__' && page[v] && page[v].kindOf){
|
25
24
|
if(page[v].kindOf(iframe.SC.Pane)){
|
26
25
|
designs.push(SC.Object.create({type: 'pane', view: page.get(v), name: v}));
|
27
26
|
}
|
@@ -252,7 +252,7 @@ SC.ObjectDesigner.mixin({
|
|
252
252
|
didLoadDesign: function(designedObject, sourceObject, attrs) {
|
253
253
|
designedObject.isDesign = YES ; // indicates that we need a designer.
|
254
254
|
designedObject.designAttrs = attrs;
|
255
|
-
designedObject.sourceObject = sourceObject;
|
255
|
+
//designedObject.sourceObject = sourceObject; TODO: don't need this..
|
256
256
|
},
|
257
257
|
|
258
258
|
/**
|
@@ -287,8 +287,8 @@ SC.ObjectDesigner.mixin({
|
|
287
287
|
object.designer = DesignerClass.create({
|
288
288
|
object: object,
|
289
289
|
objectClass: design,
|
290
|
-
designAttrs: origDesign.designAttrs
|
291
|
-
sourceObject: origDesign.sourceObject
|
290
|
+
designAttrs: origDesign.designAttrs
|
291
|
+
//sourceObject: origDesign.sourceObject TODO: don't need this
|
292
292
|
});
|
293
293
|
}
|
294
294
|
}
|
@@ -1135,7 +1135,7 @@ SC.ViewDesigner.mixin({
|
|
1135
1135
|
didLoadDesign: function(designedView, sourceView, attrs) {
|
1136
1136
|
designedView.isDesign = YES ; // indicates that we need a designer.
|
1137
1137
|
designedView.designAttrs = attrs;
|
1138
|
-
designedView.sourceView = sourceView;
|
1138
|
+
//designedView.sourceView = sourceView; TODO: not sure we need this...
|
1139
1139
|
},
|
1140
1140
|
|
1141
1141
|
/**
|
@@ -1170,8 +1170,8 @@ SC.ViewDesigner.mixin({
|
|
1170
1170
|
view.designer = DesignerClass.create({
|
1171
1171
|
view: view,
|
1172
1172
|
viewClass: design,
|
1173
|
-
designAttrs: origDesign.designAttrs
|
1174
|
-
sourceView: origDesign.sourceView
|
1173
|
+
designAttrs: origDesign.designAttrs
|
1174
|
+
//sourceView: origDesign.sourceView TODO: not sure we need this...
|
1175
1175
|
});
|
1176
1176
|
}
|
1177
1177
|
}
|
@@ -14,6 +14,8 @@
|
|
14
14
|
SC.DesignerDropTarget = SC.ContainerView.extend(
|
15
15
|
/** @scope SC.DesignerDropTarget.prototype */ {
|
16
16
|
|
17
|
+
inGlobalOffset: YES,
|
18
|
+
|
17
19
|
// ..........................................................
|
18
20
|
// Key Events
|
19
21
|
//
|
@@ -106,7 +108,7 @@ SC.DesignerDropTarget = SC.ContainerView.extend(
|
|
106
108
|
var data = drag.dataForType('SC.Object'),
|
107
109
|
cv = this.get('contentView'),
|
108
110
|
loc = drag.get('location'),
|
109
|
-
|
111
|
+
iframeOffset = drag.globalTargetOffset,
|
110
112
|
design, size, newView, defaults, layout;
|
111
113
|
var page = cv.get('page');
|
112
114
|
var designController = page.get('designController'),
|
@@ -115,13 +117,17 @@ SC.DesignerDropTarget = SC.ContainerView.extend(
|
|
115
117
|
//TODO: [MB] should we move most of this into the designer's addView?
|
116
118
|
//size and location
|
117
119
|
size = data.get('size');
|
118
|
-
loc.x = loc.x -
|
119
|
-
loc.y = loc.y -
|
120
|
+
loc.x = loc.x - iframeOffset.x - rootDesignerFrame.x;
|
121
|
+
loc.y = loc.y - iframeOffset.y - rootDesignerFrame.y;
|
120
122
|
//setup design (use eval to make sure code comes from iframe)
|
123
|
+
//TODO use new Function("return "+data.get('scClass))() ?...
|
121
124
|
design = eval(data.get('scClass'));
|
122
125
|
defaults = data.get('defaults') || {};
|
123
126
|
layout = defaults.layout || {};
|
124
127
|
layout = SC.merge(layout, {top: loc.y, left: loc.x});
|
128
|
+
//pull width and height from ghost if none exists form defaults
|
129
|
+
if(!layout.width) layout.width = drag.getPath('ghostView.layout').width;
|
130
|
+
if(!layout.height) layout.height = drag.getPath('ghostView.layout').height;
|
125
131
|
defaults.layout = layout;
|
126
132
|
design = design.design(defaults);
|
127
133
|
//drop it in the root designer
|