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
data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/root_responder.js
RENAMED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
|
6
6
|
// ==========================================================================
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
sc_require('system/ready');
|
|
9
|
+
sc_require('system/platform');
|
|
9
10
|
|
|
10
11
|
/** Set to NO to leave the backspace key under the control of the browser.*/
|
|
11
12
|
SC.CAPTURE_BACKSPACE_KEY = NO ;
|
|
@@ -52,7 +53,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
52
53
|
pane attaches or detaches, it will update itself in this array.
|
|
53
54
|
*/
|
|
54
55
|
panes: null,
|
|
55
|
-
|
|
56
|
+
|
|
56
57
|
init: function() {
|
|
57
58
|
sc_super();
|
|
58
59
|
this.panes = SC.Set.create();
|
|
@@ -307,19 +308,12 @@ SC.RootResponder = SC.Object.extend({
|
|
|
307
308
|
// calculate new window size...
|
|
308
309
|
var newSize = this.computeWindowSize(), oldSize = this.get('currentWindowSize');
|
|
309
310
|
this.set('currentWindowSize', newSize); // update size
|
|
310
|
-
|
|
311
|
+
|
|
311
312
|
if (!SC.rectsEqual(newSize, oldSize)) {
|
|
312
313
|
//Notify orientation change. This is faster than waiting for the orientation
|
|
313
314
|
//change event.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
if(newSize.height>= newSize.width) {
|
|
317
|
-
SC.device.set('orientation', 'portrait');
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
SC.device.set('orientation', 'landscape');
|
|
321
|
-
}
|
|
322
|
-
}
|
|
315
|
+
SC.device.windowSizeDidChange(newSize);
|
|
316
|
+
|
|
323
317
|
// notify panes
|
|
324
318
|
if (this.panes) {
|
|
325
319
|
SC.run(function() {
|
|
@@ -343,7 +337,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
343
337
|
Handle window focus. Change hasFocus and add sc-focus CSS class
|
|
344
338
|
(removing sc-blur). Also notify panes.
|
|
345
339
|
*/
|
|
346
|
-
focus: function() {
|
|
340
|
+
focus: function() {
|
|
347
341
|
if (!this.get('hasFocus')) {
|
|
348
342
|
SC.$('body').addClass('sc-focus').removeClass('sc-blur');
|
|
349
343
|
|
|
@@ -353,19 +347,19 @@ SC.RootResponder = SC.Object.extend({
|
|
|
353
347
|
}
|
|
354
348
|
return YES ; // allow default
|
|
355
349
|
},
|
|
356
|
-
|
|
350
|
+
|
|
357
351
|
/**
|
|
358
352
|
Handle window focus event for IE. Listening to the focus event is not
|
|
359
|
-
reliable as per every focus event you receive you inmediately get a blur
|
|
353
|
+
reliable as per every focus event you receive you inmediately get a blur
|
|
360
354
|
event (Only on IE of course ;)
|
|
361
355
|
*/
|
|
362
356
|
focusin: function() {
|
|
363
357
|
this.focus();
|
|
364
358
|
},
|
|
365
|
-
|
|
359
|
+
|
|
366
360
|
/**
|
|
367
361
|
Handle window blur event for IE. Listening to the focus event is not
|
|
368
|
-
reliable as per every focus event you receive you inmediately get a blur
|
|
362
|
+
reliable as per every focus event you receive you inmediately get a blur
|
|
369
363
|
event (Only on IE of course ;)
|
|
370
364
|
*/
|
|
371
365
|
focusout: function() {
|
|
@@ -428,7 +422,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
428
422
|
*/
|
|
429
423
|
sendAction: function( action, target, sender, pane, context, firstResponder) {
|
|
430
424
|
target = this.targetForAction(action, target, sender, pane, firstResponder) ;
|
|
431
|
-
|
|
425
|
+
|
|
432
426
|
// HACK: If the target is a ResponderContext, forward the action.
|
|
433
427
|
if (target && target.isResponderContext) {
|
|
434
428
|
return !!target.sendAction(action, sender, context, firstResponder);
|
|
@@ -437,7 +431,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
437
431
|
|
|
438
432
|
_responderFor: function(target, methodName, firstResponder) {
|
|
439
433
|
var defaultResponder = target ? target.get('defaultResponder') : null;
|
|
440
|
-
|
|
434
|
+
|
|
441
435
|
if (target) {
|
|
442
436
|
target = firstResponder || target.get('firstResponder') || target;
|
|
443
437
|
do {
|
|
@@ -489,7 +483,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
489
483
|
// 2. an explicit target was passed...
|
|
490
484
|
if (target) {
|
|
491
485
|
if (SC.typeOf(target) === SC.T_STRING) {
|
|
492
|
-
target = SC.objectForPropertyPath(target) ||
|
|
486
|
+
target = SC.objectForPropertyPath(target) ||
|
|
493
487
|
SC.objectForPropertyPath(target, sender);
|
|
494
488
|
}
|
|
495
489
|
|
|
@@ -506,7 +500,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
506
500
|
|
|
507
501
|
// 3. an explicit pane was passed...
|
|
508
502
|
if (pane) {
|
|
509
|
-
target = this._responderFor(pane, methodName, firstResponder);
|
|
503
|
+
target = this._responderFor(pane, methodName, firstResponder);
|
|
510
504
|
if (target) return target;
|
|
511
505
|
}
|
|
512
506
|
|
|
@@ -621,7 +615,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
621
615
|
// handle basic events
|
|
622
616
|
this.listenFor('keydown keyup beforedeactivate mousedown mouseup click dblclick mousemove selectstart contextmenu'.w(), document)
|
|
623
617
|
.listenFor('resize'.w(), window);
|
|
624
|
-
|
|
618
|
+
|
|
625
619
|
if(SC.browser.msie) this.listenFor('focusin focusout'.w(), document);
|
|
626
620
|
else this.listenFor('focus blur'.w(), window);
|
|
627
621
|
|
|
@@ -706,7 +700,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
706
700
|
// Iterate through the touches we're currently tracking
|
|
707
701
|
for (touch in touches) {
|
|
708
702
|
if (touches[touch]._rescuedElement) continue; // only do once
|
|
709
|
-
|
|
703
|
+
|
|
710
704
|
target = elem = touches[touch].target;
|
|
711
705
|
|
|
712
706
|
// Travel up the hierarchy looking for the document body
|
|
@@ -721,11 +715,11 @@ SC.RootResponder = SC.Object.extend({
|
|
|
721
715
|
// Actually clone this node and replace it in the original
|
|
722
716
|
// layer if needed
|
|
723
717
|
if (target.parentNode && target.cloneNode) {
|
|
724
|
-
var clone = target.cloneNode(true);
|
|
718
|
+
var clone = target.cloneNode(true);
|
|
725
719
|
target.parentNode.replaceChild(clone, target);
|
|
726
720
|
target.swapNode = clone; // save for restore later
|
|
727
721
|
}
|
|
728
|
-
|
|
722
|
+
|
|
729
723
|
// Create a holding pen if needed for these views...
|
|
730
724
|
var pen = SC.touchHoldingPen;
|
|
731
725
|
if (!pen) {
|
|
@@ -740,7 +734,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
740
734
|
// // In MobileSafari, our target can sometimes
|
|
741
735
|
// // be a text node, so make sure we handle that case.
|
|
742
736
|
// textNode = (target.nodeType === 3);
|
|
743
|
-
//
|
|
737
|
+
//
|
|
744
738
|
// if (textNode && target.parentElement) {
|
|
745
739
|
// // Hide the text node's parent element if it has one
|
|
746
740
|
// target = target.parentElement;
|
|
@@ -753,10 +747,10 @@ SC.RootResponder = SC.Object.extend({
|
|
|
753
747
|
// // Standard Element, just toggle its display off.
|
|
754
748
|
// target.style.display = 'none';
|
|
755
749
|
// }
|
|
756
|
-
//
|
|
750
|
+
//
|
|
757
751
|
// // Now move the captured and hidden element back to the DOM.
|
|
758
752
|
// document.body.appendChild(target);
|
|
759
|
-
|
|
753
|
+
|
|
760
754
|
// ...and save the element to be garbage collected on
|
|
761
755
|
// touchEnd.
|
|
762
756
|
touches[touch]._rescuedElement = target;
|
|
@@ -766,24 +760,8 @@ SC.RootResponder = SC.Object.extend({
|
|
|
766
760
|
};
|
|
767
761
|
SC.RunLoop.prototype.endRunLoop = patch;
|
|
768
762
|
}
|
|
769
|
-
|
|
770
|
-
// Orientation changes are not being reliably reported with iPhone 0S 3
|
|
771
|
-
// We do this initialization to double check the right orientation.
|
|
772
|
-
// This happens if the orientation has changed from the moment the app
|
|
773
|
-
// started loading until the app is set until isReady
|
|
774
|
-
if(SC.platform.touch){
|
|
775
|
-
var newSize = this.computeWindowSize(),
|
|
776
|
-
body = SC.$(document.body);
|
|
777
|
-
|
|
778
|
-
if(newSize.height>= newSize.width) {
|
|
779
|
-
SC.device.set('orientation', 'portrait');
|
|
780
|
-
}
|
|
781
|
-
else {
|
|
782
|
-
SC.device.set('orientation', 'landscape');
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
763
|
},
|
|
786
|
-
|
|
764
|
+
|
|
787
765
|
// ................................................................................
|
|
788
766
|
// TOUCH SUPPORT
|
|
789
767
|
//
|
|
@@ -833,21 +811,21 @@ SC.RootResponder = SC.Object.extend({
|
|
|
833
811
|
*/
|
|
834
812
|
averagedTouchesForView: function(view, added) {
|
|
835
813
|
var t = this.touchesForView(view),
|
|
836
|
-
|
|
814
|
+
|
|
837
815
|
// cache per view to avoid gc
|
|
838
816
|
averaged = view._scrr_averagedTouches || (view._scrr_averagedTouches = {});
|
|
839
|
-
|
|
817
|
+
|
|
840
818
|
if ((!t || t.length === 0) && !added) {
|
|
841
819
|
averaged.x = 0;
|
|
842
820
|
averaged.y = 0;
|
|
843
821
|
averaged.d = 0;
|
|
844
822
|
averaged.touchCount = 0;
|
|
845
|
-
|
|
823
|
+
|
|
846
824
|
} else {
|
|
847
825
|
// make array of touches using cached array
|
|
848
826
|
var touches = this._averagedTouches_touches || (this._averagedTouches_touches = []);
|
|
849
827
|
touches.length = 0;
|
|
850
|
-
|
|
828
|
+
|
|
851
829
|
// copy touches into array
|
|
852
830
|
if (t) {
|
|
853
831
|
var i, len = t.length;
|
|
@@ -888,26 +866,26 @@ SC.RootResponder = SC.Object.extend({
|
|
|
888
866
|
|
|
889
867
|
// average
|
|
890
868
|
ad /= len;
|
|
891
|
-
|
|
869
|
+
|
|
892
870
|
averaged.x = ax;
|
|
893
871
|
averaged.y = ay;
|
|
894
872
|
averaged.d = ad;
|
|
895
873
|
averaged.touchCount = len;
|
|
896
874
|
}
|
|
897
|
-
|
|
875
|
+
|
|
898
876
|
return averaged;
|
|
899
877
|
},
|
|
900
878
|
|
|
901
879
|
assignTouch: function(touch, view) {
|
|
902
880
|
// sanity-check
|
|
903
881
|
if (touch.hasEnded) throw "Attemt to assign a touch that is already finished.";
|
|
904
|
-
|
|
882
|
+
|
|
905
883
|
// unassign from old view if necessary
|
|
906
884
|
if (touch.view === view) return;
|
|
907
885
|
if (touch.view) {
|
|
908
886
|
this.unassignTouch(touch);
|
|
909
887
|
}
|
|
910
|
-
|
|
888
|
+
|
|
911
889
|
// create view entry if needed
|
|
912
890
|
if (!this._touchedViews[SC.guidFor(view)]) {
|
|
913
891
|
this._touchedViews[SC.guidFor(view)] = {
|
|
@@ -996,7 +974,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
996
974
|
*/
|
|
997
975
|
makeTouchResponder: function(touch, responder, shouldStack, upViewChain) {
|
|
998
976
|
|
|
999
|
-
// In certain cases (SC.Gesture being one), we have to call makeTouchResponder
|
|
977
|
+
// In certain cases (SC.Gesture being one), we have to call makeTouchResponder
|
|
1000
978
|
// from inside makeTouchResponder so we queue it up here.
|
|
1001
979
|
if (this._isMakingTouchResponder) {
|
|
1002
980
|
this._queuedTouchResponder = [touch, responder, shouldStack, upViewChain];
|
|
@@ -1024,7 +1002,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1024
1002
|
else pane = this.get('keyPane') || this.get('mainPane') ;
|
|
1025
1003
|
|
|
1026
1004
|
// if the responder is not already in the stack...
|
|
1027
|
-
|
|
1005
|
+
|
|
1028
1006
|
if (stack.indexOf(responder) < 0) {
|
|
1029
1007
|
// if we need to go up the view chain, do so
|
|
1030
1008
|
if (upViewChain) {
|
|
@@ -1036,7 +1014,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1036
1014
|
responder = null;
|
|
1037
1015
|
}
|
|
1038
1016
|
} else {
|
|
1039
|
-
|
|
1017
|
+
|
|
1040
1018
|
if ((responder.get ? responder.get("acceptsMultitouch") : responder.acceptsMultitouch) || !responder.hasTouch) {
|
|
1041
1019
|
if (!responder.touchStart(touch)) responder = null;
|
|
1042
1020
|
} else {
|
|
@@ -1054,7 +1032,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1054
1032
|
// get passed back to the touch responder-- even while it continues to get events because
|
|
1055
1033
|
// the touchResponder is still set!
|
|
1056
1034
|
this.unassignTouch(touch);
|
|
1057
|
-
|
|
1035
|
+
|
|
1058
1036
|
// pop all other items
|
|
1059
1037
|
var idx = stack.length - 1, last = stack[idx];
|
|
1060
1038
|
while (last && last !== responder) {
|
|
@@ -1148,32 +1126,32 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1148
1126
|
// Thankfully, makeTouchResponder does exactly that: starts at the view it is supplied and keeps calling startTouch
|
|
1149
1127
|
this.makeTouchResponder(touch, target, shouldStack, YES);
|
|
1150
1128
|
},
|
|
1151
|
-
|
|
1129
|
+
|
|
1152
1130
|
/** @private
|
|
1153
1131
|
Artificially calls endTouch for any touch which is no longer present. This is necessary because
|
|
1154
1132
|
_sometimes_, WebKit ends up not sending endtouch.
|
|
1155
1133
|
*/
|
|
1156
1134
|
endMissingTouches: function(presentTouches) {
|
|
1157
1135
|
var idx, len = presentTouches.length, map = {}, end = [];
|
|
1158
|
-
|
|
1136
|
+
|
|
1159
1137
|
// make a map of what touches _are_ present
|
|
1160
1138
|
for (idx = 0; idx < len; idx++) {
|
|
1161
1139
|
map[presentTouches[idx].identifier] = YES;
|
|
1162
1140
|
}
|
|
1163
|
-
|
|
1141
|
+
|
|
1164
1142
|
// check if any of the touches we have recorded are NOT present
|
|
1165
1143
|
for (idx in this._touches) {
|
|
1166
1144
|
var id = this._touches[idx].identifier;
|
|
1167
1145
|
if (!map[id]) end.push(this._touches[idx]);
|
|
1168
1146
|
}
|
|
1169
|
-
|
|
1147
|
+
|
|
1170
1148
|
// end said touches
|
|
1171
1149
|
for (idx = 0, len = end.length; idx < len; idx++) {
|
|
1172
1150
|
this.endTouch(end[idx]);
|
|
1173
1151
|
this.finishTouch(end[idx]);
|
|
1174
1152
|
}
|
|
1175
1153
|
},
|
|
1176
|
-
|
|
1154
|
+
|
|
1177
1155
|
_touchCount: 0,
|
|
1178
1156
|
/** @private
|
|
1179
1157
|
Ends a specific touch (for a bit, at least). This does not "finish" a touch; it merely calls
|
|
@@ -1181,30 +1159,25 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1181
1159
|
the process; it would have to be restarted separately, through touch.end().
|
|
1182
1160
|
*/
|
|
1183
1161
|
endTouch: function(touchEntry, action, evt) {
|
|
1184
|
-
if (!action) action = "touchEnd";
|
|
1185
|
-
|
|
1162
|
+
if (!action) { action = "touchEnd"; }
|
|
1163
|
+
|
|
1186
1164
|
var responderIdx, responders, responder, originalResponder;
|
|
1187
|
-
|
|
1165
|
+
|
|
1188
1166
|
// unassign
|
|
1189
1167
|
this.unassignTouch(touchEntry);
|
|
1190
1168
|
|
|
1191
1169
|
// call end for all items in chain
|
|
1192
1170
|
if (touchEntry.touchResponder) {
|
|
1193
1171
|
originalResponder = touchEntry.touchResponder;
|
|
1194
|
-
|
|
1172
|
+
|
|
1195
1173
|
responders = touchEntry.touchResponders;
|
|
1196
1174
|
responderIdx = responders.length - 1;
|
|
1197
1175
|
responder = responders[responderIdx];
|
|
1198
1176
|
while (responder) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
if (responder[action]) responder[action](touchEntry, evt);
|
|
1202
|
-
} catch(e) {
|
|
1203
|
-
console.error('crashed on endTouch');
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1177
|
+
if (responder[action]) { responder[action](touchEntry, evt); }
|
|
1178
|
+
|
|
1206
1179
|
// check to see if the responder changed, and stop immediately if so.
|
|
1207
|
-
if (touchEntry.touchResponder !== originalResponder) break;
|
|
1180
|
+
if (touchEntry.touchResponder !== originalResponder) { break; }
|
|
1208
1181
|
|
|
1209
1182
|
// next
|
|
1210
1183
|
responderIdx--;
|
|
@@ -1213,19 +1186,19 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1213
1186
|
}
|
|
1214
1187
|
}
|
|
1215
1188
|
},
|
|
1216
|
-
|
|
1189
|
+
|
|
1217
1190
|
/**
|
|
1218
1191
|
@private
|
|
1219
1192
|
"Finishes" a touch. That is, it eradicates it from our touch entries and removes all responder, etc. properties.
|
|
1220
1193
|
*/
|
|
1221
1194
|
finishTouch: function(touch) {
|
|
1222
1195
|
var elem;
|
|
1223
|
-
|
|
1196
|
+
|
|
1224
1197
|
// ensure the touch is indeed unassigned.
|
|
1225
1198
|
this.unassignTouch(touch);
|
|
1226
|
-
|
|
1227
|
-
// If we rescued this touch's initial element, we should remove it
|
|
1228
|
-
// from the DOM and garbage collect now. See setup() for an
|
|
1199
|
+
|
|
1200
|
+
// If we rescued this touch's initial element, we should remove it
|
|
1201
|
+
// from the DOM and garbage collect now. See setup() for an
|
|
1229
1202
|
// explanation of this bug/workaround.
|
|
1230
1203
|
if (elem = touch._rescuedElement) {
|
|
1231
1204
|
if (elem.swapNode && elem.swapNode.parentNode) {
|
|
@@ -1237,8 +1210,8 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1237
1210
|
elem.swapNode = null;
|
|
1238
1211
|
elem = null;
|
|
1239
1212
|
}
|
|
1240
|
-
|
|
1241
|
-
|
|
1213
|
+
|
|
1214
|
+
|
|
1242
1215
|
// clear responders (just to be thorough)
|
|
1243
1216
|
touch.touchResponders = null;
|
|
1244
1217
|
touch.touchResponder = null;
|
|
@@ -1267,7 +1240,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1267
1240
|
// sometimes WebKit is a bit... iffy:
|
|
1268
1241
|
this.endMissingTouches(evt.touches);
|
|
1269
1242
|
|
|
1270
|
-
// as you were...
|
|
1243
|
+
// as you were...
|
|
1271
1244
|
// loop through changed touches, calling touchStart, etc.
|
|
1272
1245
|
var idx, touches = evt.changedTouches, len = touches.length,
|
|
1273
1246
|
target, view, touch, touchEntry;
|
|
@@ -1310,12 +1283,12 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1310
1283
|
}
|
|
1311
1284
|
}, this);
|
|
1312
1285
|
|
|
1313
|
-
|
|
1286
|
+
|
|
1314
1287
|
// hack for text fields
|
|
1315
1288
|
if (hidingTouchIntercept) {
|
|
1316
1289
|
return YES;
|
|
1317
1290
|
}
|
|
1318
|
-
|
|
1291
|
+
|
|
1319
1292
|
return evt.hasCustomEventHandling;
|
|
1320
1293
|
},
|
|
1321
1294
|
|
|
@@ -1408,7 +1381,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1408
1381
|
for (idx = 0; idx < len; idx++) {
|
|
1409
1382
|
touch = touches[idx];
|
|
1410
1383
|
touchEntry = this._touches[touch.identifier];
|
|
1411
|
-
touchEntry.event = null;
|
|
1384
|
+
if (touchEntry) touchEntry.event = null;
|
|
1412
1385
|
}
|
|
1413
1386
|
}, this);
|
|
1414
1387
|
|
|
@@ -1462,12 +1435,12 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1462
1435
|
}
|
|
1463
1436
|
}, this);
|
|
1464
1437
|
|
|
1465
|
-
|
|
1438
|
+
|
|
1466
1439
|
// for text fields
|
|
1467
1440
|
if (hidesTouchIntercept) {
|
|
1468
1441
|
return YES;
|
|
1469
1442
|
}
|
|
1470
|
-
|
|
1443
|
+
|
|
1471
1444
|
return evt.hasCustomEventHandling;
|
|
1472
1445
|
},
|
|
1473
1446
|
|
|
@@ -1479,7 +1452,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1479
1452
|
evt.isCancel = YES;
|
|
1480
1453
|
this.touchend(evt);
|
|
1481
1454
|
},
|
|
1482
|
-
|
|
1455
|
+
|
|
1483
1456
|
// ..........................................................
|
|
1484
1457
|
// KEYBOARD HANDLING
|
|
1485
1458
|
//
|
|
@@ -1579,7 +1552,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1579
1552
|
var keyCode = evt.keyCode;
|
|
1580
1553
|
if(SC.browser.mozilla && evt.keyCode===9){
|
|
1581
1554
|
this.keydownCounter=1;
|
|
1582
|
-
}
|
|
1555
|
+
}
|
|
1583
1556
|
// Fix for IME input (japanese, mandarin).
|
|
1584
1557
|
// If the KeyCode is 229 wait for the keyup and
|
|
1585
1558
|
// trigger a keyDown if it is is enter onKeyup.
|
|
@@ -1692,11 +1665,11 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1692
1665
|
/**
|
|
1693
1666
|
IE's default behavior to blur textfields and other controls can only be
|
|
1694
1667
|
blocked by returning NO to this event. However we don't want to block
|
|
1695
|
-
its default behavior otherwise textfields won't loose focus by clicking on
|
|
1696
|
-
an empty area as it's expected. If you want to block IE from bluring another
|
|
1697
|
-
control set blockIEDeactivate to true on the especific view in which you
|
|
1698
|
-
want to avoid this. Think of an autocomplete menu, you want to click on
|
|
1699
|
-
the menu but don't loose focus.
|
|
1668
|
+
its default behavior otherwise textfields won't loose focus by clicking on
|
|
1669
|
+
an empty area as it's expected. If you want to block IE from bluring another
|
|
1670
|
+
control set blockIEDeactivate to true on the especific view in which you
|
|
1671
|
+
want to avoid this. Think of an autocomplete menu, you want to click on
|
|
1672
|
+
the menu but don't loose focus.
|
|
1700
1673
|
*/
|
|
1701
1674
|
beforedeactivate: function(evt) {
|
|
1702
1675
|
var toElement = evt.toElement;
|
|
@@ -1718,9 +1691,9 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1718
1691
|
evt.allowDefault();
|
|
1719
1692
|
return YES;
|
|
1720
1693
|
}
|
|
1721
|
-
|
|
1694
|
+
|
|
1722
1695
|
if(!SC.browser.msie) window.focus();
|
|
1723
|
-
|
|
1696
|
+
|
|
1724
1697
|
// First, save the click count. The click count resets if the mouse down
|
|
1725
1698
|
// event occurs more than 250 ms later than the mouse up event or more
|
|
1726
1699
|
// than 8 pixels away from the mouse down event.
|
|
@@ -1753,7 +1726,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1753
1726
|
|
|
1754
1727
|
view = this._mouseDownView = this.sendEvent('mouseDown', evt, view) ;
|
|
1755
1728
|
if (view && view.respondsTo('mouseDragged')) this._mouseCanDrag = YES ;
|
|
1756
|
-
|
|
1729
|
+
|
|
1757
1730
|
|
|
1758
1731
|
return view ? evt.hasCustomEventHandling : YES;
|
|
1759
1732
|
},
|
|
@@ -1770,9 +1743,9 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1770
1743
|
evt.allowDefault();
|
|
1771
1744
|
return YES;
|
|
1772
1745
|
}
|
|
1773
|
-
|
|
1746
|
+
|
|
1774
1747
|
this.targetViewForEvent(evt);
|
|
1775
|
-
|
|
1748
|
+
|
|
1776
1749
|
if (this._drag) {
|
|
1777
1750
|
this._drag.tryToPerform('mouseUp', evt) ;
|
|
1778
1751
|
this._drag = null ;
|
|
@@ -1820,7 +1793,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1820
1793
|
// Save timestamp of mouseup at last possible moment.
|
|
1821
1794
|
// (This is used to calculate double click events)
|
|
1822
1795
|
this._lastMouseUpAt = Date.now() ;
|
|
1823
|
-
|
|
1796
|
+
|
|
1824
1797
|
return (handler) ? evt.hasCustomEventHandling : YES ;
|
|
1825
1798
|
},
|
|
1826
1799
|
|
|
@@ -1835,7 +1808,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1835
1808
|
mousewheel: function(evt) {
|
|
1836
1809
|
var view = this.targetViewForEvent(evt) ,
|
|
1837
1810
|
handler = this.sendEvent('mouseWheel', evt, view) ;
|
|
1838
|
-
|
|
1811
|
+
|
|
1839
1812
|
return (handler) ? evt.hasCustomEventHandling : YES ;
|
|
1840
1813
|
},
|
|
1841
1814
|
|
|
@@ -1855,7 +1828,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1855
1828
|
evt.allowDefault();
|
|
1856
1829
|
return YES;
|
|
1857
1830
|
}
|
|
1858
|
-
|
|
1831
|
+
|
|
1859
1832
|
if (SC.browser.msie) {
|
|
1860
1833
|
if (this._lastMoveX === evt.clientX && this._lastMoveY === evt.clientY) return;
|
|
1861
1834
|
}
|
|
@@ -1884,15 +1857,15 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1884
1857
|
} else {
|
|
1885
1858
|
var lh = this._lastHovered || [] , nh = [] , exited, loc, len,
|
|
1886
1859
|
view = this.targetViewForEvent(evt) ;
|
|
1887
|
-
|
|
1888
|
-
// first collect all the responding view starting with the
|
|
1860
|
+
|
|
1861
|
+
// first collect all the responding view starting with the
|
|
1889
1862
|
// target view from the given mouse move event
|
|
1890
1863
|
while (view && (view !== this)) {
|
|
1891
1864
|
nh.push(view);
|
|
1892
1865
|
view = view.get('nextResponder');
|
|
1893
1866
|
}
|
|
1894
|
-
|
|
1895
|
-
// next exit views that are no longer part of the
|
|
1867
|
+
|
|
1868
|
+
// next exit views that are no longer part of the
|
|
1896
1869
|
// responding chain
|
|
1897
1870
|
for (loc=0, len=lh.length; loc < len; loc++) {
|
|
1898
1871
|
view = lh[loc] ;
|
|
@@ -1901,7 +1874,7 @@ SC.RootResponder = SC.Object.extend({
|
|
|
1901
1874
|
view.tryToPerform('mouseExited', evt);
|
|
1902
1875
|
}
|
|
1903
1876
|
}
|
|
1904
|
-
|
|
1877
|
+
|
|
1905
1878
|
// finally, either perform mouse moved or mouse entered depending on
|
|
1906
1879
|
// whether a responding view was or was not part of the last
|
|
1907
1880
|
// hovered views
|
|
@@ -2024,13 +1997,13 @@ SC.Touch = function(touch, touchContext) {
|
|
|
2024
1997
|
// get the raw target view (we'll refine later)
|
|
2025
1998
|
this.touchContext = touchContext;
|
|
2026
1999
|
this.identifier = touch.identifier; // for now, our internal id is WebKit's id.
|
|
2027
|
-
|
|
2000
|
+
|
|
2028
2001
|
var target = touch.target, targetView;
|
|
2029
2002
|
if (target && SC.$(target).hasClass("touch-intercept")) {
|
|
2030
2003
|
touch.target.style.webkitTransform = "translate3d(0px,-5000px,0px)";
|
|
2031
2004
|
target = document.elementFromPoint(touch.pageX, touch.pageY);
|
|
2032
2005
|
if (target) targetView = SC.$(target).view()[0];
|
|
2033
|
-
|
|
2006
|
+
|
|
2034
2007
|
this.hidesTouchIntercept = NO;
|
|
2035
2008
|
if (target.tagName === "INPUT") {
|
|
2036
2009
|
this.hidesTouchIntercept = touch.target;
|
|
@@ -2124,7 +2097,7 @@ SC.Touch.prototype = {
|
|
|
2124
2097
|
touchesForView: function(view) {
|
|
2125
2098
|
return this.touchContext.touchesForView(view);
|
|
2126
2099
|
},
|
|
2127
|
-
|
|
2100
|
+
|
|
2128
2101
|
/**
|
|
2129
2102
|
Same as touchesForView, but sounds better for responders.
|
|
2130
2103
|
*/
|
|
@@ -575,17 +575,20 @@ SC.SelectionSet = SC.Object.extend(SC.Enumerable, SC.Freezable, SC.Copyable,
|
|
|
575
575
|
Freezing a SelectionSet also freezes its internal sets.
|
|
576
576
|
*/
|
|
577
577
|
freeze: function() {
|
|
578
|
-
if (this.isFrozen) return this ;
|
|
578
|
+
if (this.get('isFrozen')) { return this ; }
|
|
579
579
|
var sets = this._sets,
|
|
580
580
|
loc = sets ? sets.length : 0,
|
|
581
581
|
set ;
|
|
582
582
|
|
|
583
583
|
while(--loc >= 0) {
|
|
584
|
-
|
|
584
|
+
set = sets[loc];
|
|
585
|
+
if (set) { set.freeze(); }
|
|
585
586
|
}
|
|
586
587
|
|
|
587
|
-
if (this._objects) this._objects.freeze();
|
|
588
|
-
|
|
588
|
+
if (this._objects) { this._objects.freeze(); }
|
|
589
|
+
this.set('isFrozen', YES);
|
|
590
|
+
return this;
|
|
591
|
+
// return sc_super();
|
|
589
592
|
},
|
|
590
593
|
|
|
591
594
|
// ..........................................................
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|