sproutcore 1.6.0.beta.3 → 1.6.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +33 -0
- data/Rakefile +213 -10
- data/VERSION.yml +1 -1
- data/lib/Buildfile +5 -1
- data/lib/buildtasks/manifest.rake +7 -1
- data/lib/frameworks/sproutcore/Buildfile +3 -2
- data/lib/frameworks/sproutcore/CHANGELOG.md +154 -1
- data/lib/frameworks/sproutcore/README.md +1 -1
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +9 -0
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +254 -207
- data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +243 -172
- data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controls/button.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +36 -14
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +14 -15
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +2 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/responder.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +20 -12
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +61 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +20 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +42 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controls/button.js +39 -57
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +5 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +32 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +28 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +396 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/{system → views}/bindable_span.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +78 -51
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +233 -67
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/core_tools/core.js +8 -2
- data/lib/frameworks/sproutcore/frameworks/core_tools/data_source.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_tools/models/target.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +15 -8
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +66 -55
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/data_source.js +190 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +15 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +212 -182
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +14 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +23 -11
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/alert.css +49 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/a_sample_image.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/apple-logo1.jpeg +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/iframe.html +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/disclosure.css +20 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/drag.css +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/icons.css +214 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/cap.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/downbutton.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-48.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-bookmark-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-bookmark-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-cancel-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-document-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-document-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-down-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-error-48.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-favorite-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-favorite-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-folder-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-folder-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-group-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-group-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-help-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-help-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-48.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-left-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-options-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-options-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-redo-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-right-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-tools-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-trash-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-trash-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-undo-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-up-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-user-16.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-user-24.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-bottom.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-center.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-top.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/track.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/upbutton.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/list_item.css +145 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu.css +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu_item_view.css +88 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/modal.css +3 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/panel.css +91 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/picker.css +37 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/progress.css +29 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/radio.css +11 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +121 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/separator.css +20 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/slider.css +34 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/split.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/split_divider.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/tab.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/toolbar.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/touch-scroller.css +13 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/well.css +65 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +114 -103
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +7 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +4 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +9 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/{panes → views}/select_button.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +35 -33
- data/lib/frameworks/sproutcore/frameworks/foundation/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +15 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +4 -7
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +55 -13
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/render_delegate.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/benchmark.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/blank.gif +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/bootstrap.rhtml +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/button_view.css +36 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/checkbox_view.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/debug/control-test-pane.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/favicon.ico +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-logo.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-landscape.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-landscape.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-portrait.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-portrait.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/inline_editor.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/label.css +47 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/radio_view.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/static_layout.css +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +130 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/chance.js +5 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/system/string.js +0 -43
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +5 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +4 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +6 -3
- data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/system/error.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/statechart/debug/monitor.js +4 -73
- data/lib/frameworks/sproutcore/frameworks/statechart/debug/sequence_matcher.js +189 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/ext/function.js +122 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/system/async.js +88 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/system/empty_state.js +34 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/system/history_state.js +97 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +7 -189
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +14 -78
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/debug/sequence_matcher.js +464 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/basic/with_concurrent_states.js +31 -11
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/async/with_concurrent_states.js +6 -4
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/advanced.js +40 -6
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/basic.js +22 -2
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/intermediate.js +44 -3
- data/lib/frameworks/sproutcore/frameworks/testing/core.js +61 -9
- data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/additions.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/runner.css +11 -2
- data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/testsuite.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +66 -27
- data/lib/frameworks/sproutcore/frameworks/testing/tests/spy_on.js +41 -0
- data/lib/frameworks/sproutcore/frameworks/testing/tests/stub_method.js +9 -0
- data/lib/frameworks/sproutcore/frameworks/yuireset/resources/core.css +24 -0
- data/lib/frameworks/sproutcore/frameworks/yuireset/resources/fonts.css +39 -0
- data/lib/frameworks/sproutcore/frameworks/yuireset/resources/reset.css +126 -0
- data/lib/frameworks/sproutcore/frameworks/yuireset/resources/view.css +57 -0
- data/lib/frameworks/sproutcore/lib/index.rhtml +7 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +13 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +16 -14
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu_item.png +0 -0
- data/lib/gen/app/templates/apps/@target_name@/Buildfile +1 -4
- data/lib/gen/app/templates/apps/@target_name@/core.js +1 -4
- data/lib/gen/app/templates/apps/@target_name@/main.js +1 -4
- data/lib/gen/app/templates/apps/@target_name@/resources/main_page.js +1 -4
- data/lib/gen/app/templates/apps/@target_name@/theme.js +1 -4
- data/lib/gen/controller/templates/controllers/{@filename@.js → @filename@_controller.js} +1 -4
- data/lib/gen/controller/templates/tests/controllers/{@filename@.js → @filename@_test.js} +1 -4
- data/lib/gen/data-source/templates/data_sources/{@filename@.js → @filename@_data_source.js} +1 -4
- data/lib/gen/design/templates/resources/@filename@.js +1 -4
- data/lib/gen/framework/templates/frameworks/@target_name@/core.js +1 -4
- data/lib/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +1 -4
- data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -4
- data/lib/gen/html_app/templates/apps/@target_name@/resources/stylesheets/@target_name@.css +2 -0
- data/lib/gen/html_project/templates/@filename@/Buildfile +1 -4
- data/lib/gen/html_project/templates/@filename@/README +1 -4
- data/lib/gen/language/templates/@filename@/strings.js +1 -4
- data/lib/gen/model/templates/fixtures/{@filename@.js → @filename@_fixtures.js} +2 -5
- data/lib/gen/model/templates/models/{@filename@.js → @filename@_model.js} +1 -4
- data/lib/gen/model/templates/tests/models/{@filename@.js → @filename@_test.js} +1 -4
- data/lib/gen/page/templates/pages/@target_name@/Buildfile +1 -4
- data/lib/gen/page/templates/pages/@target_name@/core.js +1 -4
- data/lib/gen/page/templates/pages/@target_name@/en.lproj/strings.js +1 -4
- data/lib/gen/page/templates/pages/@target_name@/resources/body.css +3 -1
- data/lib/gen/project/templates/@filename@/Buildfile +1 -4
- data/lib/gen/project/templates/@filename@/README +1 -5
- data/lib/gen/responder/templates/states/{@filename@.js → @filename@_state.js} +1 -4
- data/lib/gen/test/templates/tests/{@filename@.js → @filename@_test.js} +1 -4
- data/lib/gen/theme/templates/themes/@target_name@/resources/theme_styles.css +1 -5
- data/lib/gen/theme/templates/themes/@target_name@/theme.js +1 -4
- data/lib/gen/view/templates/tests/views/{@filename@.js → @filename@_test.js} +1 -4
- data/lib/gen/view/templates/views/{@filename@.js → @filename@_view.js} +1 -4
- data/lib/sproutcore.rb +4 -1
- data/lib/sproutcore/builders/handlebars.rb +1 -1
- data/lib/sproutcore/builders/module.rb +2 -2
- data/lib/sproutcore/helpers/static_helper.rb +4 -2
- data/lib/sproutcore/models/generator.rb +22 -0
- data/lib/sproutcore/models/manifest_entry.rb +1 -0
- data/lib/sproutcore/models/target.rb +4 -1
- data/lib/sproutcore/rack/builder.rb +3 -0
- data/lib/sproutcore/tools.rb +11 -11
- data/lib/sproutcore/tools/init.rb +10 -22
- data/lib/sproutcore/tools/manifest.rb +21 -22
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +21 -1
- data/spec/fixtures/ordered_entries/apps/template_style/a.js +0 -0
- data/spec/fixtures/ordered_entries/apps/template_style/template_style.js +0 -0
- data/spec/lib/buildfile_commands/build_task_spec.rb +1 -1
- data/spec/lib/tools/manifest_spec.rb +11 -0
- data/sproutcore.gemspec +2 -2
- data/vendor/chance/lib/chance/instance.rb +3 -1
- metadata +118 -74
- data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/core.css +0 -378
- data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/view.css +0 -57
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +0 -56
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +0 -73
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +0 -916
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +0 -185
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +0 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +0 -101
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +0 -91
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +0 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +0 -33
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +0 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +0 -132
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +0 -19
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +0 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +0 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/well.css +0 -71
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +0 -40
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +0 -47
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +0 -146
- data/lib/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +0 -69
@@ -0,0 +1,29 @@
|
|
1
|
+
/* SC.ProgressView */
|
2
|
+
|
3
|
+
.sc-progress-view {
|
4
|
+
border: 1px solid #555555;
|
5
|
+
background-color: #c8c8c8;
|
6
|
+
-webkit-border-radius: 2px;
|
7
|
+
border-radius: 2px;
|
8
|
+
&.disabled {
|
9
|
+
background-color: #e8e8e8;
|
10
|
+
border: 1px #9a9a9a solid;
|
11
|
+
}
|
12
|
+
.sc-inner {
|
13
|
+
position: absolute;
|
14
|
+
left: 0px;
|
15
|
+
top: 0px;
|
16
|
+
bottom: 0px;
|
17
|
+
background: #555555;
|
18
|
+
border-right: 1px solid #555555;
|
19
|
+
-webkit-transition: all 0.01s linear;
|
20
|
+
-webkit-transform: translate3d(0,0,0);
|
21
|
+
}
|
22
|
+
&.sc-indeterminate .sc-inner {
|
23
|
+
background: #555555;
|
24
|
+
border: 0;
|
25
|
+
}
|
26
|
+
&.sc-empty .sc-inner {
|
27
|
+
border: none;
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
.sc-segmented-view {
|
2
|
+
display: block;
|
3
|
+
white-space: nowrap;
|
4
|
+
img.icon {
|
5
|
+
position: relative;
|
6
|
+
vertical-align: middle;
|
7
|
+
top: -2px;
|
8
|
+
margin-right: 2px;
|
9
|
+
height: 16px;
|
10
|
+
width: 16px;
|
11
|
+
}
|
12
|
+
.sc-segment-view {
|
13
|
+
position: relative;
|
14
|
+
display: inline-block;
|
15
|
+
top: 0;
|
16
|
+
height: 22px;
|
17
|
+
line-height: 22px;
|
18
|
+
border-right: 1px #555 solid;
|
19
|
+
text-shadow: #b0b0b0 0px 1px 0px;
|
20
|
+
text-decoration: none ;
|
21
|
+
color: black ;
|
22
|
+
text-align: center;
|
23
|
+
&:focus {
|
24
|
+
outline: none;
|
25
|
+
}
|
26
|
+
&.sc-first-segment {
|
27
|
+
padding-left: 10px;
|
28
|
+
padding-right: 10px;
|
29
|
+
background: #DDDDDD;
|
30
|
+
.sc-button-inner {
|
31
|
+
padding-right: 10px;
|
32
|
+
}
|
33
|
+
.active,
|
34
|
+
.sel {
|
35
|
+
background: #999999;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
&.sc-last-segment {
|
39
|
+
padding-right: 10px;
|
40
|
+
border:none;
|
41
|
+
background: #DDDDDD;
|
42
|
+
.sc-button-inner {
|
43
|
+
padding-left: 10px;
|
44
|
+
}
|
45
|
+
.active,
|
46
|
+
.sel {
|
47
|
+
background: #999999;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
.sc-middle-segment .sc-button-inner {
|
51
|
+
padding-left: 10px;
|
52
|
+
padding-right: 10px;
|
53
|
+
}
|
54
|
+
|
55
|
+
.sc-button-inner {
|
56
|
+
background: #DDDDDD;
|
57
|
+
}
|
58
|
+
|
59
|
+
.sel .sc-button-inner {
|
60
|
+
background: #999999;
|
61
|
+
text-shadow: #909090 0px 1px 0px;
|
62
|
+
}
|
63
|
+
|
64
|
+
.active .sc-button-inner {
|
65
|
+
background: #999999;
|
66
|
+
text-shadow: #909090 0px 1px 0px;
|
67
|
+
}
|
68
|
+
|
69
|
+
&.disabled .sc-button-inner {
|
70
|
+
background: #FFFFFF;
|
71
|
+
color: #999;
|
72
|
+
}
|
73
|
+
|
74
|
+
&.sc-first-segment.disabled {
|
75
|
+
background: #FFFFFF;
|
76
|
+
.sel.disabled {
|
77
|
+
background: #FFFFFF;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
&.sc-last-segment.disabled {
|
82
|
+
background: #FFFFFF;
|
83
|
+
.sel.disabled {
|
84
|
+
background: #FFFFFF;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
&.sel .sc-button-inner.disabled {
|
89
|
+
background: #FFFFFF;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
.sc-button-inner {
|
93
|
+
display: block;
|
94
|
+
min-width: 20px;
|
95
|
+
min-height: 22px;
|
96
|
+
}
|
97
|
+
|
98
|
+
&.disabled{
|
99
|
+
.sc-segment-view .sc-button-inner {
|
100
|
+
background: #FFFFFF;
|
101
|
+
color: #999;
|
102
|
+
}
|
103
|
+
.sc-segment-view{
|
104
|
+
&.sc-first-segment {
|
105
|
+
background: #FFFFFF;
|
106
|
+
.sel {
|
107
|
+
background: #FFFFFF;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
&.sc-last-segment {
|
111
|
+
background: #FFFFFF;
|
112
|
+
&.sel {
|
113
|
+
background: #FFFFFF;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
&.sel .sc-button-inner {
|
117
|
+
background: #FFFFFF;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
.sc-separator-view{
|
2
|
+
span{
|
3
|
+
position: absolute;
|
4
|
+
background-color: #fefefe;
|
5
|
+
}
|
6
|
+
&.sc-layout-horizontal span {
|
7
|
+
top: 50%;
|
8
|
+
height: 1px;
|
9
|
+
border-top: 1px #ccc solid;
|
10
|
+
left: 0;
|
11
|
+
right: 0;
|
12
|
+
}
|
13
|
+
&.sc-layout-vertical span {
|
14
|
+
left: 50%;
|
15
|
+
width: 1px;
|
16
|
+
border-left: 1px #ccc solid;
|
17
|
+
top: 0;
|
18
|
+
bottom: 0;
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/* @group SC.SliderView */
|
2
|
+
|
3
|
+
.sc-slider-view {
|
4
|
+
height: 21px;
|
5
|
+
.sc-inner {
|
6
|
+
position: absolute;
|
7
|
+
left: 8px;
|
8
|
+
right: 8px;
|
9
|
+
height: 5px;
|
10
|
+
top: 6px;
|
11
|
+
background: gray ;
|
12
|
+
-webkit-border-radius: 3px;
|
13
|
+
-moz-border-radius: 3px;
|
14
|
+
border-radius: 3px;
|
15
|
+
.sc-leftcap{
|
16
|
+
display: none;
|
17
|
+
}
|
18
|
+
.sc-righcap {
|
19
|
+
display: none;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
.sc-handle {
|
23
|
+
height: 12px;
|
24
|
+
width: 12px;
|
25
|
+
margin-left: -9px;
|
26
|
+
top: -4px;
|
27
|
+
position: absolute ;
|
28
|
+
background: black;
|
29
|
+
border-radius:6px;
|
30
|
+
-moz-border-radius:6px;
|
31
|
+
-webkit-transform: translate3d(0,0,0);
|
32
|
+
-webkit-transition: left 0.01s ease-in-out;
|
33
|
+
}
|
34
|
+
}
|
File without changes
|
data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/split_divider.css
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/touch-scroller.css
RENAMED
@@ -1,40 +1,40 @@
|
|
1
1
|
/* Track */
|
2
|
-
.sc-
|
2
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .track {
|
3
3
|
background: none;
|
4
4
|
display: none;
|
5
5
|
}
|
6
6
|
|
7
7
|
/* Cap */
|
8
|
-
.sc-
|
9
|
-
.sc-
|
8
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .cap,
|
9
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .endcap {
|
10
10
|
background: none;
|
11
11
|
display: none;
|
12
12
|
}
|
13
13
|
|
14
14
|
/* Buttons */
|
15
|
-
.sc-
|
15
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .button-top {
|
16
16
|
background: none;
|
17
17
|
display: none;
|
18
18
|
}
|
19
19
|
|
20
|
-
.sc-
|
20
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .button-bottom {
|
21
21
|
background: none;
|
22
22
|
display: none;
|
23
23
|
}
|
24
24
|
|
25
25
|
/* Active */
|
26
|
-
.sc-
|
26
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .button-top:active {
|
27
27
|
background: none;
|
28
28
|
display: none;
|
29
29
|
}
|
30
30
|
|
31
|
-
.sc-
|
31
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .button-bottom:active {
|
32
32
|
background: none;
|
33
33
|
display: none;
|
34
34
|
}
|
35
35
|
|
36
36
|
/* Thumb */
|
37
|
-
.sc-
|
37
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .thumb {
|
38
38
|
position: absolute;
|
39
39
|
opacity: 0.5;
|
40
40
|
-webkit-transform: translateZ(0px);
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
|
47
47
|
|
48
|
-
.sc-
|
48
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .thumb-top {
|
49
49
|
-webkit-border-top-left-radius: 4px;
|
50
50
|
-webkit-border-top-right-radius: 4px;
|
51
51
|
position: absolute;
|
@@ -56,7 +56,7 @@
|
|
56
56
|
background: black;
|
57
57
|
}
|
58
58
|
|
59
|
-
.sc-
|
59
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .thumb-clip {
|
60
60
|
position: absolute;
|
61
61
|
overflow:hidden;
|
62
62
|
height: 1034px;
|
@@ -65,7 +65,7 @@
|
|
65
65
|
left: 5px;
|
66
66
|
}
|
67
67
|
|
68
|
-
.sc-
|
68
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .thumb-inner {
|
69
69
|
-webkit-transform: translate3d(0px,0px,0px);
|
70
70
|
position: absolute;
|
71
71
|
left: 0px;
|
@@ -74,7 +74,7 @@
|
|
74
74
|
height: 1034px;
|
75
75
|
}
|
76
76
|
|
77
|
-
.sc-
|
77
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .thumb-center {
|
78
78
|
position: absolute;
|
79
79
|
width: 5px;
|
80
80
|
left: 0px;
|
@@ -83,7 +83,7 @@
|
|
83
83
|
background: black;
|
84
84
|
}
|
85
85
|
|
86
|
-
.sc-
|
86
|
+
.sc-view.sc-touch-scroller-view.sc-vertical .thumb-bottom {
|
87
87
|
-webkit-border-bottom-left-radius: 4px;
|
88
88
|
-webkit-border-bottom-right-radius: 4px;
|
89
89
|
position: absolute;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
.sc-well-view{
|
2
|
+
.top-right-edge {
|
3
|
+
position: absolute;
|
4
|
+
width: 7px;
|
5
|
+
height: 7px;
|
6
|
+
top: 0px;
|
7
|
+
right: 0px;
|
8
|
+
}
|
9
|
+
.top-left-edge {
|
10
|
+
position: absolute;
|
11
|
+
width: 7px;
|
12
|
+
height: 7px;
|
13
|
+
top: 0px;
|
14
|
+
left: 0px;
|
15
|
+
}
|
16
|
+
.bottom-left-edge {
|
17
|
+
position: absolute;
|
18
|
+
width: 7px;
|
19
|
+
height: 7px;
|
20
|
+
bottom: 0px;
|
21
|
+
left: 0px;
|
22
|
+
}
|
23
|
+
.bottom-right-edge {
|
24
|
+
position: absolute;
|
25
|
+
width: 7px;
|
26
|
+
height: 7px;
|
27
|
+
bottom: 0px;
|
28
|
+
right: 0px;
|
29
|
+
}
|
30
|
+
.top-edge {
|
31
|
+
position: absolute;
|
32
|
+
height: 5px;
|
33
|
+
top: 0px;
|
34
|
+
right: 7px;
|
35
|
+
left: 7px;
|
36
|
+
}
|
37
|
+
.bottom-edge {
|
38
|
+
position: absolute;
|
39
|
+
height: 5px;
|
40
|
+
bottom: 0px;
|
41
|
+
right: 7px;
|
42
|
+
left: 7px;
|
43
|
+
}
|
44
|
+
.left-edge {
|
45
|
+
position: absolute;
|
46
|
+
width: 7px;
|
47
|
+
top: 7px;
|
48
|
+
bottom: 7px;
|
49
|
+
left: 0px;
|
50
|
+
}
|
51
|
+
.right-edge {
|
52
|
+
position: absolute;
|
53
|
+
width: 7px;
|
54
|
+
top: 7px;
|
55
|
+
bottom: 7px;
|
56
|
+
right: 0px;
|
57
|
+
}
|
58
|
+
.content-background {
|
59
|
+
position: absolute;
|
60
|
+
top: 5px;
|
61
|
+
bottom: 5px;
|
62
|
+
right: 7px;
|
63
|
+
left: 7px;
|
64
|
+
}
|
65
|
+
}
|
@@ -7,120 +7,131 @@
|
|
7
7
|
|
8
8
|
/*global module test equals context ok same htmlbody Q$ */
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
(function() {
|
11
|
+
var pane, view, triggered = false;
|
12
|
+
|
13
|
+
module("SC.Checkbox", {
|
14
|
+
setup: function() {
|
15
|
+
SC.RunLoop.begin();
|
16
|
+
pane = SC.MainPane.create({
|
17
|
+
childViews: [
|
18
|
+
SC.CheckboxView.extend({
|
19
|
+
layout: { right: 20, bottom: 20, width: 100, height: 23 },
|
20
|
+
title: "First Name",
|
21
|
+
value: YES,
|
22
|
+
action: function() {
|
23
|
+
triggered = true;
|
24
|
+
}
|
25
|
+
})]
|
26
|
+
});
|
27
|
+
pane.append(); // make sure there is a layer...
|
28
|
+
SC.RunLoop.end();
|
29
|
+
|
30
|
+
view = pane.childViews[0];
|
31
|
+
},
|
32
|
+
|
33
|
+
teardown: function() {
|
34
|
+
pane.remove();
|
35
|
+
pane = view = null;
|
36
|
+
triggered = false;
|
37
|
+
}
|
38
|
+
});
|
39
|
+
|
40
|
+
test("renders something that is NOT an input tag with appropriate attributes", function() {
|
41
|
+
equals(view.get('value'), YES, 'precon - value should be YES');
|
42
|
+
|
43
|
+
var q = view.$();
|
44
|
+
equals(q.attr('role'), 'checkbox', 'should have type=checkbox');
|
45
|
+
equals(q.attr('aria-checked'), 'true', 'should be checked');
|
46
|
+
});
|
47
|
+
|
48
|
+
test("double-check that there is NO input element. Just in case.", function(){
|
49
|
+
equals(view.$("input").length, 0, "CoreQuery lookup for inputs should have length of 0.");
|
50
|
+
});
|
51
|
+
|
52
|
+
test("should have span with title inside", function() {
|
53
|
+
var q = Q$('span', view.get('layer'));
|
54
|
+
ok(view.get('displayTitle').length>0, 'precond - display title should not be empty');
|
55
|
+
equals(q.text(), view.get('displayTitle'), 'should have display title');
|
56
|
+
});
|
57
|
+
|
58
|
+
test("changing the title should update the span", function() {
|
59
|
+
var oldDisplayTitle = view.get('displayTitle');
|
13
60
|
SC.RunLoop.begin();
|
14
|
-
|
15
|
-
childViews: [
|
16
|
-
SC.CheckboxView.extend({
|
17
|
-
layout: { right: 20, bottom: 20, width: 100, height: 23 },
|
18
|
-
title: "First Name",
|
19
|
-
value: YES
|
20
|
-
})]
|
21
|
-
});
|
22
|
-
pane.append(); // make sure there is a layer...
|
61
|
+
view.set('title', 'Last Name');
|
23
62
|
SC.RunLoop.end();
|
24
|
-
|
25
|
-
view = pane.childViews[0];
|
26
|
-
},
|
27
|
-
|
28
|
-
teardown: function() {
|
29
|
-
pane.remove();
|
30
|
-
pane = view = null ;
|
31
|
-
}
|
32
|
-
});
|
33
|
-
|
34
|
-
test("renders something that is NOT an input tag with appropriate attributes", function() {
|
35
|
-
equals(view.get('value'), YES, 'precon - value should be YES');
|
36
|
-
|
37
|
-
var q = view.$();
|
38
|
-
equals(q.attr('role'), 'checkbox', 'should have type=checkbox');
|
39
|
-
equals(q.attr('aria-checked'), 'true', 'should be checked');
|
40
|
-
});
|
41
|
-
|
42
|
-
test("double-check that there is NO input element. Just in case.", function(){
|
43
|
-
equals(view.$("input").length, 0, "CoreQuery lookup for inputs should have length of 0.");
|
44
|
-
});
|
45
|
-
|
46
|
-
test("should have span with title inside", function() {
|
47
|
-
var q = Q$('span', view.get('layer'));
|
48
|
-
ok(view.get('displayTitle').length>0, 'precond - display title should not be empty');
|
49
|
-
equals(q.text(), view.get('displayTitle'), 'should have display title');
|
50
|
-
});
|
51
|
-
|
52
|
-
test("changing the title should update the span", function() {
|
53
|
-
var oldDisplayTitle = view.get('displayTitle');
|
54
|
-
SC.RunLoop.begin();
|
55
|
-
view.set('title', 'Last Name');
|
56
|
-
SC.RunLoop.end();
|
57
|
-
|
58
|
-
ok(view.get('displayTitle') !== oldDisplayTitle, 'precond - should have changed display title');
|
59
|
-
|
60
|
-
var q = Q$('span', view.get('layer'));
|
61
|
-
equals(q.text(), view.get('displayTitle'), 'should have display title');
|
62
|
-
});
|
63
|
-
|
64
|
-
test("isEnabled=NO should add disabled class", function() {
|
65
|
-
SC.RunLoop.begin();
|
66
|
-
view.set('isEnabled', NO);
|
67
|
-
SC.RunLoop.end();
|
68
|
-
|
69
|
-
ok(view.$().hasClass('disabled'), 'should have disabled class');
|
70
|
-
});
|
71
63
|
|
64
|
+
ok(view.get('displayTitle') !== oldDisplayTitle, 'precond - should have changed display title');
|
72
65
|
|
73
|
-
|
66
|
+
var q = Q$('span', view.get('layer'));
|
67
|
+
equals(q.text(), view.get('displayTitle'), 'should have display title');
|
68
|
+
});
|
74
69
|
|
75
|
-
|
76
|
-
|
77
|
-
|
70
|
+
test("isEnabled=NO should add disabled class", function() {
|
71
|
+
SC.RunLoop.begin();
|
72
|
+
view.set('isEnabled', NO);
|
73
|
+
SC.RunLoop.end();
|
78
74
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
75
|
+
ok(view.$().hasClass('disabled'), 'should have disabled class');
|
76
|
+
});
|
77
|
+
|
78
|
+
|
79
|
+
test("isSelected should alter sel classname and sync with value property", function() {
|
80
|
+
|
81
|
+
// check initial render state
|
82
|
+
ok(view.get('isSelected'), 'isSelected should match value');
|
83
|
+
ok(view.$().hasClass('sel'), 'should have sel class');
|
84
|
+
|
85
|
+
// update value -- make sure isSelected changes.
|
86
|
+
SC.RunLoop.begin();
|
87
|
+
view.set('value', 0); // make falsy. (but not NO exactly)
|
88
|
+
SC.RunLoop.end();
|
89
|
+
|
90
|
+
ok(!view.get('isSelected'), 'isSelected should now be NO');
|
91
|
+
ok(!view.$().hasClass('sel'), 'should no longer have sel class');
|
92
|
+
equals(view.$().attr('aria-checked'), 'false', 'view should not be checked');
|
93
|
+
|
94
|
+
// update isSelected -- make sure it edits the value
|
95
|
+
SC.RunLoop.begin();
|
96
|
+
view.set('isSelected', YES);
|
97
|
+
SC.RunLoop.end();
|
97
98
|
|
98
|
-
|
99
|
+
ok(view.get('isSelected'), 'isSelected should match value');
|
100
|
+
ok(view.$().hasClass('sel'), 'should have sel class');
|
101
|
+
equals(view.$().attr('aria-checked'), 'true', 'aria-checked should be true');
|
102
|
+
});
|
99
103
|
|
100
|
-
|
104
|
+
test("mouseDown and then mouseUp anywhere in the checkbox should toggle the selection", function() {
|
105
|
+
var elem = view.get('layer');
|
101
106
|
|
102
|
-
|
103
|
-
ok(view.get('isActive'), 'view should be active');
|
104
|
-
ok(view.get('value'), 'value should not change yet');
|
105
|
-
equals(view.$().attr('aria-checked'), 'true', 'aria-checked should be true');
|
107
|
+
ok(!triggered, 'precond - action should not have been triggered yet');
|
106
108
|
|
107
|
-
|
108
|
-
|
109
|
+
SC.Event.trigger(elem, 'mousedown');
|
110
|
+
ok(view.get('isActive'), 'view should be active');
|
111
|
+
ok(view.get('value'), 'value should not change yet');
|
112
|
+
equals(view.$().attr('aria-checked'), 'true', 'aria-checked should be true');
|
109
113
|
|
110
|
-
|
111
|
-
|
112
|
-
equals(view.$().attr('aria-checked'), 'false', 'aria-checked should be false');
|
114
|
+
// simulate mouseUp and browser-native change to control
|
115
|
+
SC.Event.trigger(elem,'mouseup');
|
113
116
|
|
114
|
-
|
115
|
-
|
117
|
+
ok(!view.get('isActive'), 'view should no longer be active');
|
118
|
+
ok(!view.get('value'), 'value should change to NO');
|
119
|
+
equals(view.$().attr('aria-checked'), 'false', 'aria-checked should be false');
|
120
|
+
|
121
|
+
ok(triggered, 'action should have been triggered');
|
122
|
+
|
123
|
+
elem = null ;
|
124
|
+
});
|
125
|
+
|
126
|
+
test("isEnabled=NO should add disabled attr to input", function() {
|
127
|
+
SC.RunLoop.begin();
|
128
|
+
view.set('isEnabled', NO);
|
129
|
+
SC.RunLoop.end();
|
116
130
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
131
|
+
ok(view.get('value'), 'precond - value should be true');
|
132
|
+
view.mouseDown();
|
133
|
+
view.mouseUp();
|
134
|
+
ok(view.get('value'), 'value should not change when clicked');
|
135
|
+
});
|
121
136
|
|
122
|
-
|
123
|
-
view.mouseDown();
|
124
|
-
view.mouseUp();
|
125
|
-
ok(view.get('value'), 'value should not change when clicked');
|
126
|
-
});
|
137
|
+
})();
|