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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Project: SproutCore - JavaScript Application Framework
|
|
3
|
+
// Copyright: ©2006-2010 Apple Inc. and contributors.
|
|
4
|
+
// License: Licensed under MIT license (see license.js)
|
|
5
|
+
// ==========================================================================
|
|
6
|
+
|
|
7
|
+
/*global module test equals context ok same */
|
|
8
|
+
|
|
9
|
+
// .......................................................
|
|
10
|
+
// render()
|
|
11
|
+
//
|
|
12
|
+
module("SC.View#render");
|
|
13
|
+
|
|
14
|
+
test("default implementation invokes renderChildViews if firstTime = YES", function() {
|
|
15
|
+
|
|
16
|
+
var rendered = 0, updated = 0, parentRendered = 0, parentUpdated = 0 ;
|
|
17
|
+
var view = SC.View.create({
|
|
18
|
+
displayProperties: ["triggerRenderProperty"],
|
|
19
|
+
childViews: ["child"],
|
|
20
|
+
|
|
21
|
+
render: function(context) {
|
|
22
|
+
parentRendered++;
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
update: function(jquery) {
|
|
26
|
+
parentUpdated++;
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
child: SC.View.create({
|
|
30
|
+
render: function(context) {
|
|
31
|
+
rendered++;
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
update: function(jquery) {
|
|
35
|
+
updated++;
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
view.createLayer();
|
|
41
|
+
equals(rendered, 1, 'rendered the child');
|
|
42
|
+
equals(parentRendered, 1);
|
|
43
|
+
|
|
44
|
+
view.updateLayer();
|
|
45
|
+
equals(rendered, 1, 'didn\'t call render again');
|
|
46
|
+
equals(parentRendered, 1, 'didn\'t call the parent\'s render again');
|
|
47
|
+
equals(parentUpdated, 1, 'called the parent\'t update');
|
|
48
|
+
equals(updated, 0, 'didn\'t call the child\'s update');
|
|
49
|
+
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// .......................................................
|
|
53
|
+
// renderChildViews()
|
|
54
|
+
//
|
|
55
|
+
|
|
56
|
+
module("SC.View#renderChildViews");
|
|
57
|
+
|
|
58
|
+
test("creates a context and then invokes renderToContext or updateLayer on each childView", function() {
|
|
59
|
+
|
|
60
|
+
var runCount = 0, curContext, curFirstTime ;
|
|
61
|
+
|
|
62
|
+
var ChildView = SC.View.extend({
|
|
63
|
+
renderToContext: function(context) {
|
|
64
|
+
equals(context.prevObject, curContext, 'passed child context of curContext');
|
|
65
|
+
|
|
66
|
+
equals(context.tagName(), this.get('tagName'), 'context setup with current tag name');
|
|
67
|
+
|
|
68
|
+
runCount++; // record run
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
updateLayer: function() {
|
|
72
|
+
runCount++;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
var view = SC.View.create({
|
|
77
|
+
childViews: [
|
|
78
|
+
ChildView.extend({ tagName: 'foo' }),
|
|
79
|
+
ChildView.extend({ tagName: 'bar' }),
|
|
80
|
+
ChildView.extend({ tagName: 'baz' })
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// VERIFY: firstTime= YES
|
|
85
|
+
curContext = view.renderContext('div');
|
|
86
|
+
curFirstTime= YES ;
|
|
87
|
+
equals(view.renderChildViews(curContext, curFirstTime), curContext, 'returns context');
|
|
88
|
+
equals(runCount, 3, 'renderToContext() invoked for each child view');
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
// VERIFY: firstTime= NO
|
|
92
|
+
runCount = 0 ; //reset
|
|
93
|
+
curContext = view.renderContext('div');
|
|
94
|
+
curFirstTime= NO ;
|
|
95
|
+
equals(view.renderChildViews(curContext, curFirstTime), curContext, 'returns context');
|
|
96
|
+
equals(runCount, 3, 'updateLayer() invoked for each child view');
|
|
97
|
+
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test("creates a context and then invokes renderChildViews to call renderToContext on each childView", function() {
|
|
101
|
+
|
|
102
|
+
var runCount = 0, curContext ;
|
|
103
|
+
|
|
104
|
+
var ChildView = SC.View.extend({
|
|
105
|
+
renderToContext: function(context) {
|
|
106
|
+
equals(context.prevObject, curContext, 'passed child context of curContext');
|
|
107
|
+
equals(context.tagName(), this.get('tagName'), 'context setup with current tag name');
|
|
108
|
+
runCount++; // record run
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
var view = SC.View.create({
|
|
113
|
+
childViews: [
|
|
114
|
+
ChildView.extend({ tagName: 'foo' }),
|
|
115
|
+
ChildView.extend({ tagName: 'bar' }),
|
|
116
|
+
ChildView.extend({ tagName: 'baz' })
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// VERIFY: firstTime= YES
|
|
121
|
+
curContext = view.renderContext('div');
|
|
122
|
+
view.renderChildViews(curContext);
|
|
123
|
+
equals(runCount, 3, 'renderToContext() invoked for each child view');
|
|
124
|
+
|
|
125
|
+
});
|
|
File without changes
|
data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/replaceChild.js
RENAMED
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module("SC.View - Static Layout functionality");
|
|
2
|
+
|
|
3
|
+
test("Static layout", function() {
|
|
4
|
+
var view = SC.View.create({
|
|
5
|
+
useStaticLayout: YES
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
view.createLayer();
|
|
9
|
+
|
|
10
|
+
ok(view.$().is('.sc-static-layout'), "views with useStaticLayout get the sc-static-layout class");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test("Background color", function() {
|
|
14
|
+
var view = SC.View.create({
|
|
15
|
+
backgroundColor: "red"
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
view.createLayer();
|
|
19
|
+
|
|
20
|
+
ok(view.$().css('background-color') == "red", "backgroundColor sets the CSS background-color class");
|
|
21
|
+
});
|
data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/theme.js
RENAMED
|
File without changes
|
data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/updateLayer.js
RENAMED
|
File without changes
|
|
File without changes
|
data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/view.js
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
SC.CheckboxSupport = {
|
|
2
|
+
didCreateLayer: function() {
|
|
3
|
+
this.$('input').change(jQuery.proxy(function() {
|
|
4
|
+
SC.RunLoop.begin();
|
|
5
|
+
this.notifyPropertyChange('value');
|
|
6
|
+
SC.RunLoop.end();
|
|
7
|
+
}, this));
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
value: function(key, value) {
|
|
11
|
+
if (value !== undefined) {
|
|
12
|
+
this.$('input').attr('checked', value);
|
|
13
|
+
} else {
|
|
14
|
+
value = this.$('input').attr('checked');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return value;
|
|
18
|
+
}.property().idempotent()
|
|
19
|
+
};
|
|
20
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
sc_require('views/template');
|
|
2
|
+
|
|
3
|
+
SC.TemplateCollectionView = SC.TemplateView.extend({
|
|
4
|
+
tagName: 'ul',
|
|
5
|
+
content: null,
|
|
6
|
+
template: SC.Handlebars.compile(''),
|
|
7
|
+
emptyView: null,
|
|
8
|
+
|
|
9
|
+
// In case a default content was set, trigger the child view creation
|
|
10
|
+
// as soon as the empty layer was created
|
|
11
|
+
didCreateLayer: function() {
|
|
12
|
+
if(this.get('content')) {
|
|
13
|
+
var indexSet = SC.IndexSet.create(0, this.getPath('content.length'));
|
|
14
|
+
this.arrayContentDidChange(this.get('content'), null, '[]', indexSet);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
itemView: "SC.TemplateView",
|
|
19
|
+
|
|
20
|
+
itemViewClass: function() {
|
|
21
|
+
var itemView = this.get('itemView');
|
|
22
|
+
// hash of properties to override in our
|
|
23
|
+
// item view class
|
|
24
|
+
var extensions = {};
|
|
25
|
+
|
|
26
|
+
if(SC.typeOf(itemView) === SC.T_STRING) {
|
|
27
|
+
itemView = SC.objectForPropertyPath(itemView);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (this.get('itemViewTemplate')) {
|
|
31
|
+
extensions.template = this.get('itemViewTemplate');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (this.get('tagName') === 'ul') {
|
|
35
|
+
extensions.tagname = 'li';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return itemView.extend(extensions);
|
|
39
|
+
}.property('itemView').cacheable(),
|
|
40
|
+
|
|
41
|
+
contentDidChange: function() {
|
|
42
|
+
this.removeAllChildren();
|
|
43
|
+
this.$().empty();
|
|
44
|
+
this.didCreateLayer();
|
|
45
|
+
|
|
46
|
+
this.get('content').addRangeObserver(null, this, this.arrayContentDidChange);
|
|
47
|
+
}.observes('content').observes('content.[]'),
|
|
48
|
+
|
|
49
|
+
arrayContentDidChange: function(array, objects, key, indexes) {
|
|
50
|
+
var content = this.get('content'),
|
|
51
|
+
itemViewClass = this.get('itemViewClass'),
|
|
52
|
+
childViews = this.get('childViews'),
|
|
53
|
+
toDestroy = [], toReuse = [],
|
|
54
|
+
view, item, matchIndex, lastView, length, i;
|
|
55
|
+
|
|
56
|
+
emptyView = this.get('emptyView');
|
|
57
|
+
if(emptyView) { emptyView.$().remove(); emptyView.removeFromParent(); }
|
|
58
|
+
|
|
59
|
+
// Destroy unused views
|
|
60
|
+
for (i=0, length=childViews.get('length'); i < length; i++) {
|
|
61
|
+
view = childViews.objectAt(i);
|
|
62
|
+
if (content.contains(view.get('content'))) {
|
|
63
|
+
toReuse.push(view);
|
|
64
|
+
} else {
|
|
65
|
+
toDestroy.push(view);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
for (i=0, length=toDestroy.length; i < length; i++) { toDestroy[i].destroy(); }
|
|
70
|
+
|
|
71
|
+
childViews = [];
|
|
72
|
+
|
|
73
|
+
if(array.get('length') === 0 && this.get('inverseTemplate')) {
|
|
74
|
+
view = this.createChildView(SC.TemplateView.extend({
|
|
75
|
+
template: this.get('inverseTemplate'),
|
|
76
|
+
content: this
|
|
77
|
+
}));
|
|
78
|
+
this.set('emptyView', view);
|
|
79
|
+
view.createLayer().$().appendTo(this.$());
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Add items, using previous if possible
|
|
83
|
+
for (i=0, length=array.get('length'); i < length; i++) {
|
|
84
|
+
item = array.objectAt(i);
|
|
85
|
+
view = toReuse.find(function(v){ return v.get('content') === item; });
|
|
86
|
+
if (!view) {
|
|
87
|
+
view = this.createChildView(itemViewClass.extend({
|
|
88
|
+
content: item,
|
|
89
|
+
tagName: 'li'
|
|
90
|
+
}));
|
|
91
|
+
view.createLayer().$().appendTo(this.$());
|
|
92
|
+
}
|
|
93
|
+
childViews.push(view);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this.childViews = childViews;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/text_field_support.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
SC.TextFieldSupport = {
|
|
2
|
+
value: function(key, value) {
|
|
3
|
+
if (value !== undefined) {
|
|
4
|
+
this.$('input').val(value);
|
|
5
|
+
} else {
|
|
6
|
+
value = this.$('input').val();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return value;
|
|
10
|
+
}.property().idempotent(),
|
|
11
|
+
|
|
12
|
+
didCreateLayer: function() {
|
|
13
|
+
SC.Event.add(this.$('input'), 'focus', this, this.focusIn);
|
|
14
|
+
SC.Event.add(this.$('input'), 'blur', this, this.focusOut);
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
focusIn: function(event) {
|
|
18
|
+
this.becomeFirstResponder();
|
|
19
|
+
this.tryToPerform('focus', event);
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
focusOut: function(event) {
|
|
23
|
+
this.resignFirstResponder();
|
|
24
|
+
this.tryToPerform('blur', event);
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
keyUp: function(event) {
|
|
28
|
+
if (event.keyCode === 13) {
|
|
29
|
+
return this.tryToPerform('insertNewline', event);
|
|
30
|
+
} else if (event.keyCode === 27) {
|
|
31
|
+
return this.tryToPerform('cancel', event);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
sc_require("views/view/base");
|
|
2
|
+
|
|
3
|
+
// Global hash of shared templates. This will automatically be populated
|
|
4
|
+
// by the build tools so that you can store your Handlebars templates in
|
|
5
|
+
// separate files that get loaded into JavaScript at buildtime.
|
|
6
|
+
SC.TEMPLATES = SC.Object.create();
|
|
7
|
+
|
|
8
|
+
/** @class
|
|
9
|
+
|
|
10
|
+
SC.TemplateView allows you to create a view that uses the Handlebars templating
|
|
11
|
+
engine to generate its HTML representation.
|
|
12
|
+
|
|
13
|
+
@extends SC.CoreView
|
|
14
|
+
@since SproutCore 1.5
|
|
15
|
+
*/
|
|
16
|
+
SC.TemplateView = SC.CoreView.extend(
|
|
17
|
+
/** @scope SC.TemplateView.prototype */ {
|
|
18
|
+
|
|
19
|
+
// This makes it easier to build custom views on top of TemplateView without
|
|
20
|
+
// gotchas, but may have tab navigation reprecussions. The tab navigation
|
|
21
|
+
// system should be revisited.
|
|
22
|
+
acceptsFirstResponder: YES,
|
|
23
|
+
|
|
24
|
+
templateName: null,
|
|
25
|
+
|
|
26
|
+
templates: SC.TEMPLATES,
|
|
27
|
+
|
|
28
|
+
template: function() {
|
|
29
|
+
var templateName = this.get('templateName');
|
|
30
|
+
var template = this.get('templates').get(templateName);
|
|
31
|
+
|
|
32
|
+
if (!template) {
|
|
33
|
+
//@if(debug)
|
|
34
|
+
if (templateName) {
|
|
35
|
+
SC.Logger.warn('%@ - Unable to find template "%@".'.fmt(this, templateName));
|
|
36
|
+
}
|
|
37
|
+
//@endif
|
|
38
|
+
|
|
39
|
+
return function() { return ''; };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return template;
|
|
43
|
+
}.property('templateName').cacheable(),
|
|
44
|
+
|
|
45
|
+
context: function() {
|
|
46
|
+
return this;
|
|
47
|
+
}.property().cacheable(),
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
When the view is asked to render, we look for the appropriate
|
|
51
|
+
template and invoke it with this view as the context, as well
|
|
52
|
+
as a hash that contains a reference to the view.
|
|
53
|
+
|
|
54
|
+
@param {SC.RenderContext} context the render context
|
|
55
|
+
*/
|
|
56
|
+
render: function(context) {
|
|
57
|
+
var template = this.get('template');
|
|
58
|
+
|
|
59
|
+
this._didRenderChildViews = YES;
|
|
60
|
+
|
|
61
|
+
context.push(template(this.get('context'), null, null, { view: this, isRenderData: true }));
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// in TemplateView, updating is handled by observers created by helpers in the
|
|
65
|
+
// template. As a result, we create an empty update method so that the old
|
|
66
|
+
// (pre-1.5) behavior which would force a full re-render does not get activated.
|
|
67
|
+
update: function() { },
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
Since mouseUp events will not fire unless we return YES to mouseDown, the
|
|
71
|
+
default mouseDown implementation returns YES if a mouseDown method exists.
|
|
72
|
+
*/
|
|
73
|
+
mouseDown: function() {
|
|
74
|
+
if (this.mouseUp) { return YES; }
|
|
75
|
+
return NO;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
sc_require("views/view");
|
|
2
|
+
sc_require("views/view/layout_style");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Properties that can be animated
|
|
6
|
+
(Hash for faster lookup)
|
|
7
|
+
*/
|
|
8
|
+
SC.ANIMATABLE_PROPERTIES = {
|
|
9
|
+
top: YES,
|
|
10
|
+
left: YES,
|
|
11
|
+
bottom: YES,
|
|
12
|
+
right: YES,
|
|
13
|
+
width: YES,
|
|
14
|
+
height: YES,
|
|
15
|
+
centerX: YES,
|
|
16
|
+
centerY: YES,
|
|
17
|
+
opacity: YES,
|
|
18
|
+
scale: YES,
|
|
19
|
+
rotate: YES,
|
|
20
|
+
rotateX: YES,
|
|
21
|
+
rotateY: YES,
|
|
22
|
+
rotateZ: YES
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
SC.View.reopen(
|
|
26
|
+
/** @scope SC.View.prototype */ {
|
|
27
|
+
|
|
28
|
+
didCreateLayerMixin: function() {
|
|
29
|
+
// Animation prep
|
|
30
|
+
if (SC.platform.supportsCSSTransitions) { this.resetAnimation(); }
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Animate a given property using CSS animations.
|
|
35
|
+
|
|
36
|
+
Takes a key, value and either a duration, or a hash of options.
|
|
37
|
+
The options hash has the following parameters
|
|
38
|
+
- duration: Duration of animation in seconds
|
|
39
|
+
- callback: Callback method to run when animation completes
|
|
40
|
+
- timing: Animation timing function
|
|
41
|
+
|
|
42
|
+
@param {String|Hash} key
|
|
43
|
+
@param {Object} value
|
|
44
|
+
@params {Number|Hash} duration or options
|
|
45
|
+
@returns {SC.View} receiver
|
|
46
|
+
*/
|
|
47
|
+
animate: function(keyOrHash, valueOrOptions, optionsOrCallback, callback) {
|
|
48
|
+
var hash, options;
|
|
49
|
+
|
|
50
|
+
if (typeof keyOrHash === SC.T_STRING) {
|
|
51
|
+
hash = {};
|
|
52
|
+
hash[keyOrHash] = valueOrOptions;
|
|
53
|
+
options = optionsOrCallback;
|
|
54
|
+
} else {
|
|
55
|
+
hash = keyOrHash;
|
|
56
|
+
options = valueOrOptions;
|
|
57
|
+
callback = optionsOrCallback;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var optionsType = SC.typeOf(options);
|
|
61
|
+
if (optionsType === SC.T_NUMBER) {
|
|
62
|
+
options = { duration: options };
|
|
63
|
+
} else if (optionsType !== SC.T_HASH) {
|
|
64
|
+
throw "Must provide options hash or duration!";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (callback) { options.callback = callback; }
|
|
68
|
+
|
|
69
|
+
var timing = options.timing;
|
|
70
|
+
if (timing) {
|
|
71
|
+
if (typeof timing !== SC.T_STRING) {
|
|
72
|
+
options.timing = "cubic-bezier("+timing[0]+", "+timing[1]+", "+
|
|
73
|
+
timing[2]+", "+timing[3]+")";
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
options.timing = 'linear';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var layout = SC.clone(this.get('layout')), didChange = NO, value, cur, animValue, curAnim, key;
|
|
80
|
+
|
|
81
|
+
if (!layout.animate) { layout.animate = {}; }
|
|
82
|
+
|
|
83
|
+
// Very similar to #adjust
|
|
84
|
+
for(key in hash) {
|
|
85
|
+
if (!hash.hasOwnProperty(key)) { continue; }
|
|
86
|
+
value = hash[key];
|
|
87
|
+
cur = layout[key];
|
|
88
|
+
|
|
89
|
+
if (cur !== value) { didChange = YES; }
|
|
90
|
+
|
|
91
|
+
if (SC.ANIMATABLE_PROPERTIES[key]) {
|
|
92
|
+
curAnim = layout.animate[key];
|
|
93
|
+
|
|
94
|
+
// loose comparison used instead of (value === null || value === undefined)
|
|
95
|
+
if (value == null) { throw "Can only animate to an actual value!"; }
|
|
96
|
+
|
|
97
|
+
// FIXME: We should check more than duration
|
|
98
|
+
if (curAnim && curAnim.duration !== options.duration) { didChange = YES; }
|
|
99
|
+
|
|
100
|
+
layout.animate[key] = options;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
layout[key] = value;
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// now set adjusted layout
|
|
108
|
+
if (didChange) { this.set('layout', layout) ; }
|
|
109
|
+
|
|
110
|
+
return this ;
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
Resets animation, stopping all existing animations.
|
|
115
|
+
*/
|
|
116
|
+
resetAnimation: function() {
|
|
117
|
+
var layout = this.get('layout'),
|
|
118
|
+
animations = layout.animate,
|
|
119
|
+
didChange = NO, key;
|
|
120
|
+
|
|
121
|
+
if (!animations) { return; }
|
|
122
|
+
|
|
123
|
+
var hasAnimations;
|
|
124
|
+
|
|
125
|
+
for (key in animations) {
|
|
126
|
+
didChange = YES;
|
|
127
|
+
delete animations[key];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (didChange) {
|
|
131
|
+
this.set('layout', layout);
|
|
132
|
+
this.notifyPropertyChange('layout');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return this;
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
Called when animation ends, should not usually be called manually
|
|
140
|
+
*/
|
|
141
|
+
transitionDidEnd: function(evt){
|
|
142
|
+
// WARNING: Sometimes this will get called more than once for a property. Not sure why.
|
|
143
|
+
this.get('layoutStyleCalculator').transitionDidEnd(evt);
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
Setting wantsAcceleratedLayer to YES will use transforms to move the
|
|
148
|
+
layer when available. On some platforms transforms are hardware accelerated.
|
|
149
|
+
*/
|
|
150
|
+
wantsAcceleratedLayer: NO,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
Specifies whether transforms can be used to move the layer.
|
|
154
|
+
*/
|
|
155
|
+
hasAcceleratedLayer: function(){
|
|
156
|
+
if (this.get('wantsAcceleratedLayer') && SC.platform.supportsAcceleratedLayers) {
|
|
157
|
+
var layout = this.get('layout'),
|
|
158
|
+
animations = layout.animate,
|
|
159
|
+
AUTO = SC.LAYOUT_AUTO,
|
|
160
|
+
key;
|
|
161
|
+
|
|
162
|
+
if (animations && (animations.top || animations.left)) {
|
|
163
|
+
for (key in animations) {
|
|
164
|
+
// If we're animating other transforms at different speeds, don't use acceleratedLayer
|
|
165
|
+
if (
|
|
166
|
+
SC.CSS_TRANSFORM_MAP[key] &&
|
|
167
|
+
((animations.top && animations.top.duration !== animations[key].duration) ||
|
|
168
|
+
(animations.left && animations.left.duration !== animations[key].duration))
|
|
169
|
+
) {
|
|
170
|
+
return NO;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// loose comparison used instead of (layout.X === null || layout.X === undefined)
|
|
176
|
+
if (
|
|
177
|
+
layout.left != null && !SC.isPercentage(layout.left) && layout.left !== AUTO &&
|
|
178
|
+
layout.top != null && !SC.isPercentage(layout.top) && layout.top !== AUTO &&
|
|
179
|
+
layout.width != null && !SC.isPercentage(layout.width) && layout.width !== AUTO &&
|
|
180
|
+
layout.height != null && !SC.isPercentage(layout.height) && layout.height !== AUTO
|
|
181
|
+
) {
|
|
182
|
+
return YES;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return NO;
|
|
186
|
+
}.property('wantsAcceleratedLayer').cacheable()
|
|
187
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SC.CoreView = SC.Responder.extend(SC.DelegateSupport);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
sc_require("views/view");
|
|
2
|
+
|
|
3
|
+
SC.View.reopen(
|
|
4
|
+
/** @scope SC.View.prototype */ {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
You can set this to an SC.Cursor instance; whenever that SC.Cursor's
|
|
8
|
+
'cursorStyle' changes, the cursor for this view will automatically
|
|
9
|
+
be updated to match. This allows you to coordinate the cursors of
|
|
10
|
+
many views by making them all share the same cursor instance.
|
|
11
|
+
|
|
12
|
+
For example, SC.SplitView uses this ensure that it and all of its
|
|
13
|
+
children have the same cursor while dragging, so that whether you are
|
|
14
|
+
hovering over the divider or another child of the split view, the
|
|
15
|
+
proper cursor is visible.
|
|
16
|
+
|
|
17
|
+
@property {SC.Cursor String}
|
|
18
|
+
*/
|
|
19
|
+
cursor: function(key, value) {
|
|
20
|
+
var parent;
|
|
21
|
+
|
|
22
|
+
if (value) { this._setCursor = value; }
|
|
23
|
+
if (this._setCursor !== undefined) { return this._setCursor; }
|
|
24
|
+
|
|
25
|
+
parent = this.get('parentView');
|
|
26
|
+
if (this.get('shouldInheritCursor') && parent) {
|
|
27
|
+
return parent.get('cursor');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return null;
|
|
31
|
+
}.property('parentView', 'shouldInheritCursor').cacheable(),
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
A child view without a cursor of its own inherits its parent's cursor by
|
|
35
|
+
default. Set this to NO to prevent this behavior.
|
|
36
|
+
|
|
37
|
+
@property {Boolean}
|
|
38
|
+
*/
|
|
39
|
+
shouldInheritCursor: YES
|
|
40
|
+
|
|
41
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
sc_require("views/view");
|
|
2
|
+
|
|
3
|
+
SC.View.reopen({
|
|
4
|
+
// ..........................................................
|
|
5
|
+
// IS ENABLED SUPPORT
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
Set to true when the item is enabled. Note that changing this value
|
|
10
|
+
will alter the isVisibleInWindow property for this view and any
|
|
11
|
+
child views as well as to automatically add or remove a 'disabled' CSS
|
|
12
|
+
class name.
|
|
13
|
+
|
|
14
|
+
This property is observable and bindable.
|
|
15
|
+
|
|
16
|
+
@property {Boolean}
|
|
17
|
+
*/
|
|
18
|
+
isEnabled: YES,
|
|
19
|
+
isEnabledBindingDefault: SC.Binding.oneWay().bool(),
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
Computed property returns YES if the view and all of its parent views
|
|
23
|
+
are enabled in the pane. You should use this property when deciding
|
|
24
|
+
whether to respond to an incoming event or not.
|
|
25
|
+
|
|
26
|
+
This property is not observable.
|
|
27
|
+
|
|
28
|
+
@property {Boolean}
|
|
29
|
+
*/
|
|
30
|
+
isEnabledInPane: function() {
|
|
31
|
+
var ret = this.get('isEnabled'), pv ;
|
|
32
|
+
if (ret && (pv = this.get('parentView'))) { ret = pv.get('isEnabledInPane'); }
|
|
33
|
+
return ret ;
|
|
34
|
+
}.property('parentView', 'isEnabled'),
|
|
35
|
+
|
|
36
|
+
/** @private
|
|
37
|
+
Observes the isEnabled property and resigns first responder if set to NO.
|
|
38
|
+
This will avoid cases where, for example, a disabled text field retains
|
|
39
|
+
its focus rings.
|
|
40
|
+
|
|
41
|
+
@observes isEnabled
|
|
42
|
+
*/
|
|
43
|
+
_sc_view_isEnabledDidChange: function(){
|
|
44
|
+
if(!this.get('isEnabled') && this.get('isFirstResponder')){
|
|
45
|
+
this.resignFirstResponder();
|
|
46
|
+
}
|
|
47
|
+
}.observes('isEnabled'),
|
|
48
|
+
|
|
49
|
+
applyAttributesToContext: function(original, context) {
|
|
50
|
+
original(context);
|
|
51
|
+
|
|
52
|
+
if (!this.get('isEnabled')) {
|
|
53
|
+
context.addClass('disabled');
|
|
54
|
+
context.attr('aria-disabled', 'true');
|
|
55
|
+
}
|
|
56
|
+
}.enhance()
|
|
57
|
+
});
|