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
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
/*global module test htmlbody ok equals same */
|
|
9
9
|
|
|
10
|
-
htmlbody('<style
|
|
10
|
+
htmlbody('<style></style>');
|
|
11
|
+
|
|
11
12
|
(function() {
|
|
12
13
|
var logoURL = "http://www.sproutcore.com/assets/images/logo.png";
|
|
13
14
|
var sampleURLs = [ "http://www.public-domain-image.com/cache/nature-landscapes-public-domain-images-pictures/canyon-public-domain-images-pictures/zion-hiker-the-sweetie-hiking-in-zion-narrows_w725_h544.jpg",
|
|
@@ -118,29 +119,38 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
118
119
|
test("Using imageQueue", function() {
|
|
119
120
|
var imageHolder = pane.view('image_holder'),
|
|
120
121
|
imageView1,
|
|
121
|
-
imageView2
|
|
122
|
+
imageView2,
|
|
123
|
+
lastMod1,
|
|
124
|
+
lastMod2;
|
|
125
|
+
|
|
126
|
+
stop();
|
|
127
|
+
|
|
128
|
+
// Only allow 1 image at a time
|
|
129
|
+
SC.imageQueue.loadLimit = 1;
|
|
130
|
+
|
|
131
|
+
// Add a random value so that the images appear as unique
|
|
132
|
+
lastMod1 = Math.round(Math.random() * 100000);
|
|
133
|
+
lastMod2 = Math.round(Math.random() * 100000);
|
|
122
134
|
|
|
123
135
|
// Set the first view to load in the background (ie. it should load last although it was created first)
|
|
124
136
|
imageView1 = SC.ImageView.create({
|
|
125
|
-
value: logoURL + "?lastmod=" +
|
|
137
|
+
value: logoURL + "?lastmod=" + lastMod1,
|
|
126
138
|
canLoadInBackground: YES
|
|
127
139
|
});
|
|
128
140
|
imageView2 = SC.ImageView.create({
|
|
129
|
-
value: logoURL + "?lastmod=" +
|
|
141
|
+
value: logoURL + "?lastmod=" + lastMod2,
|
|
130
142
|
canLoadInBackground: NO
|
|
131
143
|
});
|
|
132
144
|
|
|
133
|
-
stop();
|
|
134
|
-
|
|
135
145
|
// The second image should load first and the first not be loaded yet
|
|
136
146
|
imageView2.addObserver('status', this, function() {
|
|
137
|
-
equals(imageView2.get('status'), SC.IMAGE_STATE_LOADED, 'imageView2 status');
|
|
138
|
-
equals(imageView1.get('status'), SC.IMAGE_STATE_LOADING, 'imageView1 status');
|
|
147
|
+
equals(imageView2.get('status'), SC.IMAGE_STATE_LOADED, 'imageView2 status on imageView2 status change');
|
|
148
|
+
equals(imageView1.get('status'), SC.IMAGE_STATE_LOADING, 'imageView1 status on imageView2 status change');
|
|
139
149
|
});
|
|
140
150
|
|
|
141
151
|
imageView1.addObserver('status', this, function() {
|
|
142
|
-
equals(imageView2.get('status'), SC.IMAGE_STATE_LOADED, 'imageView2 status');
|
|
143
|
-
equals(imageView1.get('status'), SC.IMAGE_STATE_LOADED, 'imageView1 status');
|
|
152
|
+
equals(imageView2.get('status'), SC.IMAGE_STATE_LOADED, 'imageView2 status on imageView1 status change');
|
|
153
|
+
equals(imageView1.get('status'), SC.IMAGE_STATE_LOADED, 'imageView1 status on imageView1 status change');
|
|
144
154
|
|
|
145
155
|
window.start(); // starts the test runner
|
|
146
156
|
});
|
|
@@ -149,92 +159,27 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
149
159
|
imageHolder.appendChild(imageView2);
|
|
150
160
|
});
|
|
151
161
|
|
|
152
|
-
|
|
153
|
-
var imageHolder = pane.view('image_holder'),
|
|
154
|
-
imageView,
|
|
155
|
-
imgEl;
|
|
156
|
-
|
|
157
|
-
// The logo is 294x60
|
|
158
|
-
imageView = SC.ImageView.create({
|
|
159
|
-
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
160
|
-
layout: { top: 0, left: 0, width: 588, height: 90 },
|
|
161
|
-
useCanvas: NO
|
|
162
|
-
});
|
|
163
|
-
|
|
162
|
+
function testScale(imageView, isImg) {
|
|
164
163
|
stop();
|
|
165
164
|
|
|
166
165
|
// Default is SC.FILL
|
|
167
166
|
imageView.addObserver('status', this, function() {
|
|
168
167
|
// Status has changed, but the observer fires immediately, so pause in order to have the DOM updated
|
|
169
168
|
setTimeout(function() {
|
|
170
|
-
imgEl
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
equals(imgEl.css('height'), "90px", "SC.FILL height");
|
|
174
|
-
|
|
175
|
-
SC.RunLoop.begin();
|
|
176
|
-
imageView.set('scale', SC.SCALE_NONE);
|
|
177
|
-
SC.RunLoop.end();
|
|
178
|
-
|
|
179
|
-
equals(imgEl.css('width'), "294px", "SC.SCALE_NONE width");
|
|
180
|
-
equals(imgEl.css('height'), "60px", "SC.SCALE_NONE height");
|
|
181
|
-
|
|
182
|
-
SC.RunLoop.begin();
|
|
183
|
-
imageView.set('scale', SC.FILL_PROPORTIONALLY);
|
|
184
|
-
SC.RunLoop.end();
|
|
185
|
-
|
|
186
|
-
equals(imgEl.css('width'), "588px", "SC.FILL_PROPORTIONALLY width");
|
|
187
|
-
equals(imgEl.css('height'), "120px", "SC.FILL_PROPORTIONALLY height");
|
|
188
|
-
|
|
189
|
-
SC.RunLoop.begin();
|
|
190
|
-
imageView.set('scale', SC.BEST_FIT);
|
|
191
|
-
SC.RunLoop.end();
|
|
192
|
-
|
|
193
|
-
equals(imgEl.css('width'), "441px", "SC.BEST_FIT width");
|
|
194
|
-
equals(imgEl.css('height'), "90px", "SC.BEST_FIT height");
|
|
195
|
-
|
|
196
|
-
SC.RunLoop.begin();
|
|
197
|
-
imageView.set('scale', SC.BEST_FIT_DOWN_ONLY);
|
|
198
|
-
SC.RunLoop.end();
|
|
199
|
-
|
|
200
|
-
equals(imgEl.css('width'), "294px", "SC.BEST_FIT_DOWN_ONLY width (larger frame)");
|
|
201
|
-
equals(imgEl.css('height'), "60px", "SC.BEST_FIT_DOWN_ONLY height (larger frame)");
|
|
202
|
-
|
|
203
|
-
SC.RunLoop.begin();
|
|
204
|
-
imageView.set('layout', { top: 0, left: 0, width: 147, height: 90 });
|
|
205
|
-
SC.RunLoop.end();
|
|
206
|
-
|
|
207
|
-
equals(imgEl.css('width'), "147px", "SC.BEST_FIT_DOWN_ONLY width (smaller size frame)");
|
|
208
|
-
equals(imgEl.css('height'), "30px", "SC.BEST_FIT_DOWN_ONLY height (smaller size frame)");
|
|
209
|
-
|
|
210
|
-
window.start(); // starts the test runner
|
|
211
|
-
}, 100);
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
imageHolder.appendChild(imageView);
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
test("Scaling images (canvas)", function() {
|
|
218
|
-
var imageHolder = pane.view('image_holder'),
|
|
219
|
-
imageView,
|
|
220
|
-
innerFrame;
|
|
221
|
-
|
|
222
|
-
// The logo is 294x60
|
|
223
|
-
imageView = SC.ImageView.create({
|
|
224
|
-
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
225
|
-
layout: { top: 0, left: 0, width: 588, height: 90 }
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
stop();
|
|
229
|
-
|
|
230
|
-
imageView.addObserver('status', this, function() {
|
|
231
|
-
// Status has changed, but the observer fires immediately, so pause in order to have the DOM updated
|
|
232
|
-
setTimeout(function() {
|
|
233
|
-
innerFrame = imageView.get('innerFrame');
|
|
169
|
+
var imgEl,
|
|
170
|
+
innerFrame,
|
|
171
|
+
testImg = !imageView.get('useCanvas');
|
|
234
172
|
|
|
235
173
|
// Default is SC.FILL
|
|
174
|
+
innerFrame = imageView.get('innerFrame');
|
|
236
175
|
equals(innerFrame.width, 588, "SC.FILL width");
|
|
237
176
|
equals(innerFrame.height, 90, "SC.FILL height");
|
|
177
|
+
if (testImg) {
|
|
178
|
+
imgEl = imageView.$('img');
|
|
179
|
+
|
|
180
|
+
equals(imgEl.css('width'), "588px", "SC.FILL width");
|
|
181
|
+
equals(imgEl.css('height'), "90px", "SC.FILL height");
|
|
182
|
+
}
|
|
238
183
|
|
|
239
184
|
SC.RunLoop.begin();
|
|
240
185
|
imageView.set('scale', SC.SCALE_NONE);
|
|
@@ -243,6 +188,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
243
188
|
innerFrame = imageView.get('innerFrame');
|
|
244
189
|
equals(innerFrame.width, 294, "SC.SCALE_NONE width");
|
|
245
190
|
equals(innerFrame.height, 60, "SC.SCALE_NONE height");
|
|
191
|
+
if (testImg) {
|
|
192
|
+
equals(imgEl.css('width'), "294px", "SC.SCALE_NONE width");
|
|
193
|
+
equals(imgEl.css('height'), "60px", "SC.SCALE_NONE height");
|
|
194
|
+
}
|
|
246
195
|
|
|
247
196
|
SC.RunLoop.begin();
|
|
248
197
|
imageView.set('scale', SC.FILL_PROPORTIONALLY);
|
|
@@ -251,6 +200,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
251
200
|
innerFrame = imageView.get('innerFrame');
|
|
252
201
|
equals(innerFrame.width, 588, "SC.FILL_PROPORTIONALLY width");
|
|
253
202
|
equals(innerFrame.height, 120, "SC.FILL_PROPORTIONALLY height");
|
|
203
|
+
if (testImg) {
|
|
204
|
+
equals(imgEl.css('width'), "588px", "SC.FILL_PROPORTIONALLY width");
|
|
205
|
+
equals(imgEl.css('height'), "120px", "SC.FILL_PROPORTIONALLY height");
|
|
206
|
+
}
|
|
254
207
|
|
|
255
208
|
SC.RunLoop.begin();
|
|
256
209
|
imageView.set('scale', SC.BEST_FIT);
|
|
@@ -259,6 +212,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
259
212
|
innerFrame = imageView.get('innerFrame');
|
|
260
213
|
equals(innerFrame.width, 441, "SC.BEST_FIT width");
|
|
261
214
|
equals(innerFrame.height, 90, "SC.BEST_FIT height");
|
|
215
|
+
if (testImg) {
|
|
216
|
+
equals(imgEl.css('width'), "441px", "SC.BEST_FIT width");
|
|
217
|
+
equals(imgEl.css('height'), "90px", "SC.BEST_FIT height");
|
|
218
|
+
}
|
|
262
219
|
|
|
263
220
|
SC.RunLoop.begin();
|
|
264
221
|
imageView.set('scale', SC.BEST_FIT_DOWN_ONLY);
|
|
@@ -267,6 +224,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
267
224
|
innerFrame = imageView.get('innerFrame');
|
|
268
225
|
equals(innerFrame.width, 294, "SC.BEST_FIT_DOWN_ONLY width (larger frame)");
|
|
269
226
|
equals(innerFrame.height, 60, "SC.BEST_FIT_DOWN_ONLY height (larger frame)");
|
|
227
|
+
if (testImg) {
|
|
228
|
+
equals(imgEl.css('width'), "294px", "SC.BEST_FIT_DOWN_ONLY width (larger frame)");
|
|
229
|
+
equals(imgEl.css('height'), "60px", "SC.BEST_FIT_DOWN_ONLY height (larger frame)");
|
|
230
|
+
}
|
|
270
231
|
|
|
271
232
|
SC.RunLoop.begin();
|
|
272
233
|
imageView.set('layout', { top: 0, left: 0, width: 147, height: 90 });
|
|
@@ -275,125 +236,100 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
275
236
|
innerFrame = imageView.get('innerFrame');
|
|
276
237
|
equals(innerFrame.width, 147, "SC.BEST_FIT_DOWN_ONLY width (smaller size frame)");
|
|
277
238
|
equals(innerFrame.height, 30, "SC.BEST_FIT_DOWN_ONLY height (smaller size frame)");
|
|
239
|
+
if (testImg) {
|
|
240
|
+
equals(imgEl.css('width'), "147px", "SC.BEST_FIT_DOWN_ONLY width (smaller size frame)");
|
|
241
|
+
equals(imgEl.css('height'), "30px", "SC.BEST_FIT_DOWN_ONLY height (smaller size frame)");
|
|
242
|
+
}
|
|
278
243
|
|
|
279
244
|
window.start(); // starts the test runner
|
|
280
|
-
},
|
|
245
|
+
}, 100);
|
|
281
246
|
});
|
|
247
|
+
}
|
|
282
248
|
|
|
283
|
-
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
test("Aligning images (img)", function() {
|
|
249
|
+
test("Scaling images (img)", function() {
|
|
287
250
|
var imageHolder = pane.view('image_holder'),
|
|
288
|
-
imageView
|
|
289
|
-
imgEl;
|
|
251
|
+
imageView;
|
|
290
252
|
|
|
291
253
|
// The logo is 294x60
|
|
292
254
|
imageView = SC.ImageView.create({
|
|
293
255
|
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
294
|
-
layout: { top: 0, left: 0, width: 588, height:
|
|
295
|
-
useCanvas: NO
|
|
296
|
-
scale: SC.SCALE_NONE
|
|
256
|
+
layout: { top: 0, left: 0, width: 588, height: 90 },
|
|
257
|
+
useCanvas: NO
|
|
297
258
|
});
|
|
298
259
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
// Default is SC.FILL
|
|
302
|
-
imageView.addObserver('status', this, function() {
|
|
303
|
-
// Status has changed, but the observer fires immediately, so pause in order to have the DOM updated
|
|
304
|
-
setTimeout(function() {
|
|
305
|
-
imgEl = imageView.$('img');
|
|
306
|
-
|
|
307
|
-
// Default is SC.ALIGN_CENTER
|
|
308
|
-
equals(imgEl.css('top'), "30px", "SC.ALIGN_CENTER top");
|
|
309
|
-
equals(imgEl.css('left'), "147px", "SC.ALIGN_CENTER left");
|
|
310
|
-
|
|
311
|
-
SC.RunLoop.begin();
|
|
312
|
-
imageView.set('align', SC.ALIGN_TOP_LEFT);
|
|
313
|
-
SC.RunLoop.end();
|
|
314
|
-
|
|
315
|
-
equals(imgEl.css('top'), "0px", "SC.ALIGN_TOP_LEFT top");
|
|
316
|
-
equals(imgEl.css('left'), "0px", "SC.ALIGN_TOP_LEFT left");
|
|
317
|
-
|
|
318
|
-
SC.RunLoop.begin();
|
|
319
|
-
imageView.set('align', SC.ALIGN_TOP);
|
|
320
|
-
SC.RunLoop.end();
|
|
321
|
-
|
|
322
|
-
equals(imgEl.css('top'), "0px", "SC.ALIGN_TOP top");
|
|
323
|
-
equals(imgEl.css('left'), "147px", "SC.ALIGN_TOP left");
|
|
324
|
-
|
|
325
|
-
SC.RunLoop.begin();
|
|
326
|
-
imageView.set('align', SC.ALIGN_TOP_RIGHT);
|
|
327
|
-
SC.RunLoop.end();
|
|
260
|
+
testScale(imageView);
|
|
328
261
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
SC.RunLoop.begin();
|
|
333
|
-
imageView.set('align', SC.ALIGN_RIGHT);
|
|
334
|
-
SC.RunLoop.end();
|
|
335
|
-
|
|
336
|
-
equals(imgEl.css('top'), "30px", "SC.ALIGN_RIGHT top");
|
|
337
|
-
equals(imgEl.css('left'), "294px", "SC.ALIGN_RIGHT left");
|
|
338
|
-
|
|
339
|
-
SC.RunLoop.begin();
|
|
340
|
-
imageView.set('align', SC.ALIGN_BOTTOM_RIGHT);
|
|
341
|
-
SC.RunLoop.end();
|
|
342
|
-
|
|
343
|
-
equals(imgEl.css('top'), "60px", "SC.ALIGN_BOTTOM_RIGHT top");
|
|
344
|
-
equals(imgEl.css('left'), "294px", "SC.ALIGN_BOTTOM_RIGHT left");
|
|
345
|
-
|
|
346
|
-
SC.RunLoop.begin();
|
|
347
|
-
imageView.set('align', SC.ALIGN_BOTTOM);
|
|
348
|
-
SC.RunLoop.end();
|
|
262
|
+
imageHolder.appendChild(imageView);
|
|
263
|
+
});
|
|
349
264
|
|
|
350
|
-
|
|
351
|
-
|
|
265
|
+
test("Scaling images (img) with static layout", function() {
|
|
266
|
+
var imageHolder = pane.view('image_holder'),
|
|
267
|
+
imageView;
|
|
352
268
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
269
|
+
// The logo is 294x60
|
|
270
|
+
imageView = SC.ImageView.create({
|
|
271
|
+
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
272
|
+
layout: { top: 0, left: 0, width: 588, height: 90 },
|
|
273
|
+
useCanvas: NO,
|
|
274
|
+
useStaticLayout: YES
|
|
275
|
+
});
|
|
356
276
|
|
|
357
|
-
|
|
358
|
-
equals(imgEl.css('left'), "0px", "SC.ALIGN_BOTTOM_LEFT left");
|
|
277
|
+
testScale(imageView);
|
|
359
278
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
SC.RunLoop.end();
|
|
279
|
+
imageHolder.appendChild(imageView);
|
|
280
|
+
});
|
|
363
281
|
|
|
364
|
-
|
|
365
|
-
|
|
282
|
+
test("Scaling images (canvas)", function() {
|
|
283
|
+
var imageHolder = pane.view('image_holder'),
|
|
284
|
+
imageView;
|
|
366
285
|
|
|
367
|
-
|
|
368
|
-
|
|
286
|
+
// The logo is 294x60
|
|
287
|
+
imageView = SC.ImageView.create({
|
|
288
|
+
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
289
|
+
layout: { top: 0, left: 0, width: 588, height: 90 }
|
|
369
290
|
});
|
|
370
291
|
|
|
292
|
+
testScale(imageView);
|
|
293
|
+
|
|
371
294
|
imageHolder.appendChild(imageView);
|
|
372
295
|
});
|
|
373
296
|
|
|
374
|
-
test("
|
|
297
|
+
test("Scaling images (canvas) with static layout", function() {
|
|
375
298
|
var imageHolder = pane.view('image_holder'),
|
|
376
|
-
imageView
|
|
377
|
-
innerFrame;
|
|
299
|
+
imageView;
|
|
378
300
|
|
|
379
301
|
// The logo is 294x60
|
|
380
302
|
imageView = SC.ImageView.create({
|
|
381
303
|
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
382
|
-
layout: { top: 0, left: 0, width: 588, height:
|
|
383
|
-
|
|
304
|
+
layout: { top: 0, left: 0, width: 588, height: 90 },
|
|
305
|
+
useStaticLayout: YES
|
|
384
306
|
});
|
|
385
307
|
|
|
308
|
+
testScale(imageView);
|
|
309
|
+
|
|
310
|
+
imageHolder.appendChild(imageView);
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
function testAlign(imageView) {
|
|
386
314
|
stop();
|
|
387
315
|
|
|
388
316
|
// Default is SC.FILL
|
|
389
317
|
imageView.addObserver('status', this, function() {
|
|
390
318
|
// Status has changed, but the observer fires immediately, so pause in order to have the DOM updated
|
|
391
319
|
setTimeout(function() {
|
|
392
|
-
|
|
320
|
+
var imgEl,
|
|
321
|
+
innerFrame,
|
|
322
|
+
testImg = !imageView.get('useCanvas');
|
|
393
323
|
|
|
394
324
|
// Default is SC.ALIGN_CENTER
|
|
325
|
+
innerFrame = imageView.get('innerFrame');
|
|
395
326
|
equals(innerFrame.y, 30, "SC.ALIGN_CENTER top");
|
|
396
327
|
equals(innerFrame.x, 147, "SC.ALIGN_CENTER left");
|
|
328
|
+
if (testImg) {
|
|
329
|
+
imgEl = imageView.$('img');
|
|
330
|
+
equals(imgEl.css('top'), "30px", "SC.ALIGN_CENTER top");
|
|
331
|
+
equals(imgEl.css('left'), "147px", "SC.ALIGN_CENTER left");
|
|
332
|
+
}
|
|
397
333
|
|
|
398
334
|
SC.RunLoop.begin();
|
|
399
335
|
imageView.set('align', SC.ALIGN_TOP_LEFT);
|
|
@@ -402,6 +338,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
402
338
|
innerFrame = imageView.get('innerFrame');
|
|
403
339
|
equals(innerFrame.y, 0, "SC.ALIGN_TOP_LEFT top");
|
|
404
340
|
equals(innerFrame.x, 0, "SC.ALIGN_TOP_LEFT left");
|
|
341
|
+
if (testImg) {
|
|
342
|
+
equals(imgEl.css('top'), "0px", "SC.ALIGN_TOP_LEFT top");
|
|
343
|
+
equals(imgEl.css('left'), "0px", "SC.ALIGN_TOP_LEFT left");
|
|
344
|
+
}
|
|
405
345
|
|
|
406
346
|
SC.RunLoop.begin();
|
|
407
347
|
imageView.set('align', SC.ALIGN_TOP);
|
|
@@ -410,6 +350,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
410
350
|
innerFrame = imageView.get('innerFrame');
|
|
411
351
|
equals(innerFrame.y, 0, "SC.ALIGN_TOP top");
|
|
412
352
|
equals(innerFrame.x, 147, "SC.ALIGN_TOP left");
|
|
353
|
+
if (testImg) {
|
|
354
|
+
equals(imgEl.css('top'), "0px", "SC.ALIGN_TOP top");
|
|
355
|
+
equals(imgEl.css('left'), "147px", "SC.ALIGN_TOP left");
|
|
356
|
+
}
|
|
413
357
|
|
|
414
358
|
SC.RunLoop.begin();
|
|
415
359
|
imageView.set('align', SC.ALIGN_TOP_RIGHT);
|
|
@@ -418,7 +362,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
418
362
|
innerFrame = imageView.get('innerFrame');
|
|
419
363
|
equals(innerFrame.y, 0, "SC.ALIGN_TOP_RIGHT top");
|
|
420
364
|
equals(innerFrame.x, 294, "SC.ALIGN_TOP_RIGHT left");
|
|
421
|
-
|
|
365
|
+
if (testImg) {
|
|
366
|
+
equals(imgEl.css('top'), "0px", "SC.ALIGN_TOP_RIGHT top");
|
|
367
|
+
equals(imgEl.css('left'), "294px", "SC.ALIGN_TOP_RIGHT left");
|
|
368
|
+
}
|
|
422
369
|
SC.RunLoop.begin();
|
|
423
370
|
imageView.set('align', SC.ALIGN_RIGHT);
|
|
424
371
|
SC.RunLoop.end();
|
|
@@ -426,6 +373,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
426
373
|
innerFrame = imageView.get('innerFrame');
|
|
427
374
|
equals(innerFrame.y, 30, "SC.ALIGN_RIGHT top");
|
|
428
375
|
equals(innerFrame.x, 294, "SC.ALIGN_RIGHT left");
|
|
376
|
+
if (testImg) {
|
|
377
|
+
equals(imgEl.css('top'), "30px", "SC.ALIGN_RIGHT top");
|
|
378
|
+
equals(imgEl.css('left'), "294px", "SC.ALIGN_RIGHT left");
|
|
379
|
+
}
|
|
429
380
|
|
|
430
381
|
SC.RunLoop.begin();
|
|
431
382
|
imageView.set('align', SC.ALIGN_BOTTOM_RIGHT);
|
|
@@ -434,6 +385,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
434
385
|
innerFrame = imageView.get('innerFrame');
|
|
435
386
|
equals(innerFrame.y, 60, "SC.ALIGN_BOTTOM_RIGHT top");
|
|
436
387
|
equals(innerFrame.x, 294, "SC.ALIGN_BOTTOM_RIGHT left");
|
|
388
|
+
if (testImg) {
|
|
389
|
+
equals(imgEl.css('top'), "60px", "SC.ALIGN_BOTTOM_RIGHT top");
|
|
390
|
+
equals(imgEl.css('left'), "294px", "SC.ALIGN_BOTTOM_RIGHT left");
|
|
391
|
+
}
|
|
437
392
|
|
|
438
393
|
SC.RunLoop.begin();
|
|
439
394
|
imageView.set('align', SC.ALIGN_BOTTOM);
|
|
@@ -442,6 +397,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
442
397
|
innerFrame = imageView.get('innerFrame');
|
|
443
398
|
equals(innerFrame.y, 60, "SC.ALIGN_BOTTOM top");
|
|
444
399
|
equals(innerFrame.x, 147, "SC.ALIGN_BOTTOM left");
|
|
400
|
+
if (testImg) {
|
|
401
|
+
equals(imgEl.css('top'), "60px", "SC.ALIGN_BOTTOM top");
|
|
402
|
+
equals(imgEl.css('left'), "147px", "SC.ALIGN_BOTTOM left");
|
|
403
|
+
}
|
|
445
404
|
|
|
446
405
|
SC.RunLoop.begin();
|
|
447
406
|
imageView.set('align', SC.ALIGN_BOTTOM_LEFT);
|
|
@@ -450,6 +409,10 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
450
409
|
innerFrame = imageView.get('innerFrame');
|
|
451
410
|
equals(innerFrame.y, 60, "SC.ALIGN_BOTTOM_LEFT top");
|
|
452
411
|
equals(innerFrame.x, 0, "SC.ALIGN_BOTTOM_LEFT left");
|
|
412
|
+
if (testImg) {
|
|
413
|
+
equals(imgEl.css('top'), "60px", "SC.ALIGN_BOTTOM_LEFT top");
|
|
414
|
+
equals(imgEl.css('left'), "0px", "SC.ALIGN_BOTTOM_LEFT left");
|
|
415
|
+
}
|
|
453
416
|
|
|
454
417
|
SC.RunLoop.begin();
|
|
455
418
|
imageView.set('align', SC.ALIGN_LEFT);
|
|
@@ -458,10 +421,80 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
|
|
|
458
421
|
innerFrame = imageView.get('innerFrame');
|
|
459
422
|
equals(innerFrame.y, 30, "SC.ALIGN_LEFT top");
|
|
460
423
|
equals(innerFrame.x, 0, "SC.ALIGN_LEFT left");
|
|
424
|
+
if (testImg) {
|
|
425
|
+
equals(imgEl.css('top'), "30px", "SC.ALIGN_LEFT top");
|
|
426
|
+
equals(imgEl.css('left'), "0px", "SC.ALIGN_LEFT left");
|
|
427
|
+
}
|
|
461
428
|
|
|
462
429
|
window.start(); // starts the test runner
|
|
463
|
-
},
|
|
430
|
+
}, 100);
|
|
464
431
|
});
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
test("Aligning images (img)", function() {
|
|
435
|
+
var imageHolder = pane.view('image_holder'),
|
|
436
|
+
imageView;
|
|
437
|
+
|
|
438
|
+
// The logo is 294x60
|
|
439
|
+
imageView = SC.ImageView.create({
|
|
440
|
+
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
441
|
+
layout: { top: 0, left: 0, width: 588, height: 120 },
|
|
442
|
+
useCanvas: NO,
|
|
443
|
+
scale: SC.SCALE_NONE
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
testAlign(imageView);
|
|
447
|
+
|
|
448
|
+
imageHolder.appendChild(imageView);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
test("Aligning images (img) with static layout", function() {
|
|
452
|
+
var imageHolder = pane.view('image_holder'),
|
|
453
|
+
imageView;
|
|
454
|
+
|
|
455
|
+
// The logo is 294x60
|
|
456
|
+
imageView = SC.ImageView.create({
|
|
457
|
+
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
458
|
+
layout: { top: 0, left: 0, width: 588, height: 120 },
|
|
459
|
+
useCanvas: NO,
|
|
460
|
+
useStaticLayout: YES,
|
|
461
|
+
scale: SC.SCALE_NONE
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
testAlign(imageView);
|
|
465
|
+
|
|
466
|
+
imageHolder.appendChild(imageView);
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
test("Aligning images (canvas)", function() {
|
|
470
|
+
var imageHolder = pane.view('image_holder'),
|
|
471
|
+
imageView;
|
|
472
|
+
|
|
473
|
+
// The logo is 294x60
|
|
474
|
+
imageView = SC.ImageView.create({
|
|
475
|
+
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
476
|
+
layout: { top: 0, left: 0, width: 588, height: 120 },
|
|
477
|
+
scale: SC.SCALE_NONE
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
testAlign(imageView);
|
|
481
|
+
|
|
482
|
+
imageHolder.appendChild(imageView);
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
test("Aligning images (canvas) with static layout", function() {
|
|
486
|
+
var imageHolder = pane.view('image_holder'),
|
|
487
|
+
imageView;
|
|
488
|
+
|
|
489
|
+
// The logo is 294x60
|
|
490
|
+
imageView = SC.ImageView.create({
|
|
491
|
+
value: logoURL + "?lastmod=" + Math.round(Math.random() * 100000),
|
|
492
|
+
layout: { top: 0, left: 0, width: 588, height: 120 },
|
|
493
|
+
useStaticLayout: YES,
|
|
494
|
+
scale: SC.SCALE_NONE
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
testAlign(imageView);
|
|
465
498
|
|
|
466
499
|
imageHolder.appendChild(imageView);
|
|
467
500
|
});
|
|
@@ -68,7 +68,7 @@ pane.verifyEmpty = function verifyEmpty(view, expectedHint) {
|
|
|
68
68
|
var layer = view.$();
|
|
69
69
|
|
|
70
70
|
ok(!layer.hasClass('not-empty'), 'layer should not have not-empty class');
|
|
71
|
-
if(SC.browser.
|
|
71
|
+
if(SC.browser.webkit) equals(input.val(), '', 'input should have empty value');
|
|
72
72
|
else equals(input.val(), expectedHint, 'input should have empty value');
|
|
73
73
|
if (expectedHint) {
|
|
74
74
|
var hint = view.$('.sc-hint');
|