sproutcore 1.6.0.beta.2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.mailmap +32 -0
- data/.rspec +1 -0
- data/CHANGELOG +170 -0
- data/Gemfile +3 -0
- data/History.txt +54 -0
- data/README.txt +129 -0
- data/Rakefile +62 -0
- data/Todo.txt +1 -0
- data/VERSION.yml +4 -0
- data/bin/sc-build +13 -0
- data/bin/sc-build-number +13 -0
- data/bin/sc-docs +14 -0
- data/bin/sc-gen +13 -0
- data/bin/sc-init +13 -0
- data/bin/sc-manifest +13 -0
- data/bin/sc-server +13 -0
- data/bin/sproutcore +13 -0
- data/lib/Buildfile +152 -0
- data/lib/buildtasks/build.rake +119 -0
- data/lib/buildtasks/entry.rake +68 -0
- data/lib/buildtasks/manifest.rake +893 -0
- data/lib/buildtasks/render.rake +21 -0
- data/lib/buildtasks/target.rake +66 -0
- data/lib/doc_templates/jsdoc/allclasses.tmpl +17 -0
- data/lib/doc_templates/jsdoc/allfiles.tmpl +56 -0
- data/lib/doc_templates/jsdoc/class.tmpl +487 -0
- data/lib/doc_templates/jsdoc/index.tmpl +38 -0
- data/lib/doc_templates/jsdoc/publish.js +170 -0
- data/lib/doc_templates/jsdoc/static/default.css +162 -0
- data/lib/doc_templates/jsdoc/static/header.html +2 -0
- data/lib/doc_templates/jsdoc/static/index.html +19 -0
- data/lib/doc_templates/jsdoc/symbol.tmpl +35 -0
- data/lib/doc_templates/sproutcore/allclasses.tmpl +0 -0
- data/lib/doc_templates/sproutcore/allfiles.tmpl +56 -0
- data/lib/doc_templates/sproutcore/class.tmpl +674 -0
- data/lib/doc_templates/sproutcore/classes-json.tmpl +55 -0
- data/lib/doc_templates/sproutcore/index.tmpl +62 -0
- data/lib/doc_templates/sproutcore/publish.js +346 -0
- data/lib/doc_templates/sproutcore/static/default.css +258 -0
- data/lib/doc_templates/sproutcore/static/header.html +2 -0
- data/lib/doc_templates/sproutcore/static/index.html +19 -0
- data/lib/doc_templates/sproutcore/symbol.tmpl +35 -0
- data/lib/frameworks/sproutcore/Buildfile +104 -0
- data/lib/frameworks/sproutcore/CHANGELOG.md +435 -0
- data/lib/frameworks/sproutcore/README.md +139 -0
- data/lib/frameworks/sproutcore/apps/test_controls/Buildfile +0 -0
- data/lib/frameworks/sproutcore/apps/test_controls/controllers/alert.js +39 -0
- data/lib/frameworks/sproutcore/apps/test_controls/controllers/buttons.js +21 -0
- data/lib/frameworks/sproutcore/apps/test_controls/controllers/categories.js +125 -0
- data/lib/frameworks/sproutcore/apps/test_controls/controllers/category.js +36 -0
- data/lib/frameworks/sproutcore/apps/test_controls/controllers/split.js +74 -0
- data/lib/frameworks/sproutcore/apps/test_controls/core.js +29 -0
- data/lib/frameworks/sproutcore/apps/test_controls/main.js +14 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/buttons_page.js +158 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/checkboxes_page.js +53 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/flow_layout_page.js +85 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/list_page.js +40 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/loading.rhtml +9 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/main_page.css +60 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/main_page.js +151 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/panels_page.js +62 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/progress_page.js +33 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/radio_page.js +55 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/scroll_page.js +77 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/segmented_page.js +99 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/select_page.js +61 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/sliders_page.js +54 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/split_page.js +141 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/strings.js +50 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/tab_page.js +53 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/text_field_page.js +65 -0
- data/lib/frameworks/sproutcore/apps/test_controls/theme.js +34 -0
- data/lib/frameworks/sproutcore/apps/tests/controllers/detail.js +25 -0
- data/lib/frameworks/sproutcore/apps/tests/controllers/source.js +29 -0
- data/lib/frameworks/sproutcore/apps/tests/controllers/target.js +26 -0
- data/lib/frameworks/sproutcore/apps/tests/controllers/targets.js +86 -0
- data/lib/frameworks/sproutcore/apps/tests/controllers/tests.js +33 -0
- data/lib/frameworks/sproutcore/apps/tests/core.js +133 -0
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +9 -0
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +48 -0
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +233 -0
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/strings.js +26 -0
- data/lib/frameworks/sproutcore/apps/tests/main.js +27 -0
- data/lib/frameworks/sproutcore/apps/tests/states/no_targets.js +26 -0
- data/lib/frameworks/sproutcore/apps/tests/states/ready.js +56 -0
- data/lib/frameworks/sproutcore/apps/tests/states/ready_detail.js +41 -0
- data/lib/frameworks/sproutcore/apps/tests/states/ready_empty.js +48 -0
- data/lib/frameworks/sproutcore/apps/tests/states/ready_list.js +41 -0
- data/lib/frameworks/sproutcore/apps/tests/states/ready_loading.js +44 -0
- data/lib/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +31 -0
- data/lib/frameworks/sproutcore/apps/tests/states/start.js +39 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/controllers/detail.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/controllers/source.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/controllers/target.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/controllers/targets.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/controllers/tests.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/models/target.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/models/test.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/tests/views/offset_checkbox.js +15 -0
- data/lib/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +26 -0
- data/lib/frameworks/sproutcore/apps/welcome/controllers/targets.js +55 -0
- data/lib/frameworks/sproutcore/apps/welcome/core.js +30 -0
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/images/main-bg.png +0 -0
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/loading.rhtml +10 -0
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +25 -0
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +67 -0
- data/lib/frameworks/sproutcore/apps/welcome/english.lproj/strings.js +15 -0
- data/lib/frameworks/sproutcore/apps/welcome/main.js +19 -0
- data/lib/frameworks/sproutcore/apps/welcome/tests/controllers/targets.js +15 -0
- data/lib/frameworks/sproutcore/design/Record State Table.numbers +0 -0
- data/lib/frameworks/sproutcore/design/greenhouse-statechart.pdf +0 -0
- data/lib/frameworks/sproutcore/frameworks/ajax/fixtures/file_exists.json +1 -0
- data/lib/frameworks/sproutcore/frameworks/ajax/fixtures/malformed.json +11 -0
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +609 -0
- data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +550 -0
- data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +276 -0
- data/lib/frameworks/sproutcore/frameworks/animation/Buildfile +3 -0
- data/lib/frameworks/sproutcore/frameworks/animation/LICENSE +25 -0
- data/lib/frameworks/sproutcore/frameworks/animation/README.md +79 -0
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +1205 -0
- data/lib/frameworks/sproutcore/frameworks/animation/tests/core.js +152 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/README +9 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/core.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/setup_body_class_names.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/bench.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +225 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/tests/system/browser.js +187 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +524 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +342 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controls/button.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +189 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/function.js +39 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +293 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +57 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/localization.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/view.js +96 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars.js +73 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/object.js +81 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/run_loop.js +163 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/string.js +60 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/delegate_support.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/responder_context.js +268 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/selection_support.js +249 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +63 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +174 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/keyboard.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +95 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/manipulation.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +670 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/observable_protocol.js +40 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/sparse_array_delegate.js +131 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/core.css +378 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/view.css +57 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/bindable_span.js +164 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/browser.js +36 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/builder.js +202 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/core_query.js +141 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/cursor.js +131 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +210 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +991 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +289 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +106 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +419 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/ready.js +103 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +1030 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/responder.js +124 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +2180 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +693 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +401 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +162 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/theme.js +316 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +548 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils/rect.js +104 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +155 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +301 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/enum_case.js +206 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/null_case.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/selection_support.js +344 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/single_case.js +136 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/empty_case.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/multiple_case.js +111 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_case.js +193 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +265 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controls/button.js +78 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/responder_context.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/string.js +78 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/checkbox_support.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +193 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/panes/template.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/builder.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/core_query/within.js +71 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/locale.js +140 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/ready/done.js +40 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/begin.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/element.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/end.js +124 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/get.js +51 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_attr.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_basic.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_className.js +177 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +109 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/init.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/join.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/push_text.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/tag.js +46 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/update.js +219 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeKeyPane.js +124 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeMainPane.js +68 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeMenuPane.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js +108 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/targetForAction.js +288 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/selection_set/add.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/selection_set/copy.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/selection_set/indexSetForSource.js +98 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/selection_set/isEqual.js +60 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/selection_set/remove.js +111 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +256 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/theme.js +78 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/timer/invalidate.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/timer/invokeLater.js +209 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/timer/isPaused.js +77 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/timer/performAction.js +75 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/timer/schedule.js +176 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/utils/normalizeURL.js +24 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/utils/offset.js +284 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/utils/rect.js +105 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +224 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/firstResponder.js +148 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/keyPane.js +133 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/layout.js +31 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/sendEvent.js +206 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +249 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/core.js +160 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +937 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +382 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +85 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build_children.js +89 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +117 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertFrames.js +248 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +153 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createChildViews.js +132 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +97 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroyLayer.js +83 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +83 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/findLayerInParentLayer.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/init.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +217 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisible.js +85 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisibleInWindow.js +122 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +146 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +162 -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 +745 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/parentViewDidChange.js +67 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/prepareContext.js +203 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/removeChild.js +189 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render.js +203 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render_delegate_support.js +163 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceChild.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/static_layout.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +45 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayer.js +148 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayerLocation.js +213 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +202 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +132 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +244 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +182 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/base.js +4 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +48 -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 +1116 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +624 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +401 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +400 -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 +118 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +1521 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/core.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/data_source.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/english.lproj/strings.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/fixtures/target.js +87 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/fixtures/test.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/models/target.js +108 -0
- data/lib/frameworks/sproutcore/frameworks/core_tools/models/test.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/core.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +176 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +530 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +393 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/debug/json.js +71 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +96 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/fixtures/author_fixtures.js +2503 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/fixtures/sample.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +105 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +100 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +152 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +1441 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +604 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +157 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +277 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +453 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +613 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +1526 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +758 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +2860 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/cascade.js +133 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +122 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +131 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +119 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +91 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +56 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/datetime_recordattribute.js +73 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +423 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +180 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +313 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +363 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +421 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +304 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +56 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +336 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +53 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +170 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +66 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +112 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +252 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +284 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +204 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +180 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +173 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +158 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/core_methods.js +70 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +113 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +102 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +180 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +126 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +163 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +166 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +219 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare.js +144 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/contains.js +131 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/containsRecordTypes.js +81 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/copy.js +30 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +197 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +117 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/expandedRecordTypes.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +224 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/queryWithScope.js +57 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +70 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +71 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/array_observers.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +177 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +230 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +54 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +137 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +221 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +156 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +157 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +278 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/error_methods.js +62 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +530 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/loadRecord.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/loadRecords.js +100 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +61 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +144 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +200 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecords.js +90 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +125 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +1103 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +390 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/resources/strings.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +91 -0
- data/lib/frameworks/sproutcore/frameworks/debug/core.js +114 -0
- data/lib/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +259 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +34 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/debug/drag.js +42 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +56 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/a_sample_image.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/apple-logo1.jpeg +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/iframe.html +23 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +73 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +7 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +916 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/cap.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/downbutton.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-bottom.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-center.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-top.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/track.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/upbutton.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +185 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +12 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +101 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +9 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +91 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +35 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +33 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +132 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +19 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +69 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +6 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +7 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/toolbar.css +5 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/touch-scroller.css +196 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/well.css +71 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +161 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +711 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +97 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +300 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +138 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +267 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +589 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +1081 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +96 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +193 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +939 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +950 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +237 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +79 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +187 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +301 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +112 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +98 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/collection.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +59 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/helpers/slicing.js +35 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/image_button.js +51 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/master_detail.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js +60 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/panel.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/picker.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/popup_button.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +100 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +84 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +116 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +58 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segmented.js +80 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +83 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/source_list.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/toolbar.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/well.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/workspace.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +1017 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/system/key_bindings.js +42 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +224 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/mixins/border.js +106 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +320 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +136 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +283 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +35 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/pane_page.js +42 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +69 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +98 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/methods.js +194 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/ui.js +220 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +46 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/content.js +189 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/displayProperties.js +89 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/keyEquivalents.js +57 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +166 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +236 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +126 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +121 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +249 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +215 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/displayProperties.js +31 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +300 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +65 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +88 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +262 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +121 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +177 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +240 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +205 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +211 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +141 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +188 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +456 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +102 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/image_button/ui.js +52 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +183 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +133 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +131 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +130 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +56 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +205 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +131 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +396 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +46 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +128 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +418 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +119 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +338 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/integration.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +143 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +162 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroller.js +118 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +62 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +457 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +144 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/ui.js +224 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +163 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +180 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +60 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +59 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +238 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +46 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +54 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/toolbar/method.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/toolbar/ui.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/well/ui.js +54 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +944 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +120 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +3186 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +343 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +85 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +243 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +657 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +995 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +313 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +720 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +702 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation.js +261 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +191 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +303 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +259 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +404 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +211 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1987 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +995 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +193 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +1088 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +907 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +400 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/separator.js +52 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +299 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list.js +61 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +176 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +897 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +58 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +121 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +148 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +286 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +65 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +138 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +103 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +81 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +285 -0
- data/lib/frameworks/sproutcore/frameworks/documentation/core.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +8 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/README.md +23 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/README +18 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/TODO +56 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/beautify.js +1058 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/design.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/file.js +35 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js +40 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/layout.js +53 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/library.js +194 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/page.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/property.js +19 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/property_editor.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/target.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/targets.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/view_configs.js +100 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/core.js +65 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/core_file.js +124 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/data_source.js +250 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/app_page.js +399 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/app-selector.css +107 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/button.css +314 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/dock.css +90 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/general.css +51 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/main-page.css +93 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/menu.css +49 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/modal.css +41 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/picker.css +195 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/search.css +60 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/css/text-field.css +67 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/dialogs.js +303 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/fonts/museosans_500.eot +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/fonts/museosans_500.otf +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/fonts/museosans_500.woff +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/fonts/museosans_500_italic.eot +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/fonts/museosans_500_italic.otf +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/fonts/museosans_500_italic.woff +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/app-selector/choose-app.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/app-selector/list-item-sel.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/sel-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule/sel-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/active-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/regular-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/dark/sel-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/shared/active-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/shared/disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/shared/regular-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/shared/sel-active-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/shared/sel-disabled-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/shared/sel-m.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/regular-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/regular-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/sel-active-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/sel-active-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/sel-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/buttons/square/sel-r.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/actions-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/actions.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/inspector-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/inspector.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/library-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/library.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/projects-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/projects.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/run-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/run.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/save-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/icons/save.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/logos/greenhouse-l.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/logos/greenhouse-s.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/logos/sproutcore.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/main-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/bottom-left.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/bottom-right.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/bottom.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/close-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/close.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/left.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/pointer-bottom.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/pointer-left.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/pointer-right.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/pointer-top.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/right.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/search-active.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/search.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/top-left.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/top-right.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/picker/top.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/images/toolbar-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/inspectors.js +365 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/loading.rhtml +9 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/main_page.js +95 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/english.lproj/strings.js +93 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/fixtures/file.js +35 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/main.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/mixins/drop_down.js +97 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/design.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/dir.js +93 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/file.js +51 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/target.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/resources/test_page.js +37 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/states/inspector.js +152 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/states/library.js +142 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/states/main.js +283 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/states/modals.js +299 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/states/ready.js +235 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/controllers/design.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/controllers/designs.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/controllers/file.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/controllers/files.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/models/file.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/models/view_config.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/views/list_item.js +16 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/tests/views/plist_item.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/theme.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/anchor.js +277 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/application_list_item.js +19 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/event_blocker.js +32 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/label_designer.js +16 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/list_item.js +42 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/plist_item.js +178 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/simple_button.js +157 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/tear_off_picker.js +56 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/views/web.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/coders/design.js +22 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/coders/object.js +349 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/controllers.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/design.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/designs.js +139 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/page_design.js +172 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/page_files.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/core.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/css/css_rule.js +22 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/css/css_style.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/css/css_style_sheet.js +199 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/button.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/label.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/object_designer.js +298 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/tab.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/text_field.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/view_designer.js +1269 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/css/designer.css +96 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/design_page.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/high_light.css +10 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/controller.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/dock-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/dock-item-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/dock-item-divider.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/dock-item-sel-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/dock-item-sel-divider.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/main-bg.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/page.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/pane.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/images/view.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/english.lproj/selection_handles.css +58 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/binding.js +39 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/object.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/page.js +60 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/view.js +30 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/mixins/button.js +13 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/mixins/snap_lines.js +228 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/tests/coders/page.js +54 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/tests/designers/view_designer.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/designer_drop_target.js +144 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/drawing.js +226 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/high_light.js +66 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/page_item_view.js +130 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/selection_handles.js +78 -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/forms/english.lproj/default_styles.css +5 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/english.lproj/strings.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/edit_mode.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/emptiness.js +94 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form_row.js +20 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_checkbox_field.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_field.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_label.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_radio_field.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_row.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_text_field.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +285 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form_row.js +187 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +46 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphism/many.js +79 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphism/simple.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphism/single.js +67 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_child.js +229 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_thumb.js +236 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split_divider.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/children.js +100 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/dividers.js +243 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/methods.js +294 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/split_child.js +135 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/split_thumb.js +160 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split.js +929 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split_divider.js +40 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/thumb.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/TESTING +46 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +133 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/core.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +201 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +90 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/benchmark.css +146 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/blank.gif +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +67 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +40 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/checkbox_view.css +5 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +9 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/favicon.ico +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-logo.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/inline_editor.css +12 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +47 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/radio_view.css +7 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/static_layout.css +5 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +146 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/ext/string.js +89 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/fixtures/file_exists.json +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/fixtures/malformed.json +11 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +119 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +234 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +157 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/license.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +41 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +355 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +180 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +113 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +227 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +282 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +153 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +745 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gestureable.js +214 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editable.js +254 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor.js +188 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor_delegate.js +195 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +194 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +75 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +164 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +198 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +916 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/container.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/helpers/sizing.js +174 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/image.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +119 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/render_delegate.js +386 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +727 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/chance.js +65 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/cookie.js +176 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/core_query.js +63 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/exception_handler.js +91 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/gesture.js +363 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/image_queue.js +429 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/math.js +57 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +591 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/string.js +422 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/task_queue.js +153 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +103 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +392 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/colors.js +87 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/misc.js +157 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/range.js +71 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +254 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +41 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tasks/task.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +108 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/selection_support.js +340 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +113 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/delegates/inline_text_field/inline_text_field.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +118 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_display.js +57 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_value_support/content.js +168 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +89 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/editable/ui.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_editable/beginEditing.js +194 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_editable/commitEditing.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_editable/discardEditing.js +151 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_editor/beginEditing.js +114 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_editor/commitEditing.js +151 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_editor/discardEditing.js +152 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/api.js +52 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +228 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/ui.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +149 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +325 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +718 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +484 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/render_delegates/render_delegate.js +78 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/cookie.js +182 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/setClass.js +65 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/math.js +39 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/string.js +34 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/task_queue.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js +30 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/pointInElement.js +241 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/range.js +68 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +41 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +24 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/not_empty.js +56 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +53 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js +19 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/validator.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +180 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +512 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +173 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +87 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/nextValidKeyView.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +614 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +125 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date.js +79 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/email.js +45 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/number.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/password.js +86 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/positive_integer.js +85 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/validator.js +328 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +141 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +337 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +382 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +648 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +225 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +1117 -0
- data/lib/frameworks/sproutcore/frameworks/handlebars/handlebars.js +1435 -0
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffer.js +390 -0
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +210 -0
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery-sc.js +12 -0
- data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +7179 -0
- data/lib/frameworks/sproutcore/frameworks/jquery/tests/set_class.js +40 -0
- data/lib/frameworks/sproutcore/frameworks/media/resources/controls.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/media/resources/playeras3.fla +0 -0
- data/lib/frameworks/sproutcore/frameworks/media/resources/video.css +124 -0
- data/lib/frameworks/sproutcore/frameworks/media/resources/videoCanvas.swf +0 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +741 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +88 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/media_slider.js +243 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +63 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/simple_controls.js +54 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/video.js +832 -0
- data/lib/frameworks/sproutcore/frameworks/mini/license.js +30 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/README.md +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/package.json +21 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.css +215 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.js +1442 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/headless.html +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/index.html +18 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.html +17 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/same.js +1421 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +314 -0
- data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +503 -0
- data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +362 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/README +12 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +758 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +391 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +121 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +34 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +46 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +371 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +100 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +94 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/ext/date.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/ext/function.js +189 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/ext/string.js +31 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/license.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +911 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +79 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1341 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +109 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1499 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +181 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +179 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +124 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +195 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +1013 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +107 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/error.js +162 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/function.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +1209 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/json.js +515 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +1585 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +940 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +273 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +308 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +538 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/string.js +60 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +36 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +108 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/console.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +115 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/inspect.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +27 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +77 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/keys.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +81 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array_observers.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/comparable.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +623 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable_observers.js +81 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/chained.js +44 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +868 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observersForKey.js +36 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +161 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +155 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +87 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +474 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/error.js +59 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +212 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/addEach.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +42 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +38 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +38 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +40 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +36 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +189 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/removeEach.js +49 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +89 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/json.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/logger.js +265 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +201 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +385 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/concatenated_properties.js +77 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +196 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/observer_set.js +56 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +59 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +75 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +117 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +110 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +65 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +126 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +324 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/core.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/debug/monitor.js +155 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +1253 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +1546 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/advanced/respond_to_event.js +401 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/advanced/without_concurrent_states.js +306 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/basic/with_concurrent_states.js +183 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/basic/without_concurrent_states.js +122 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/responder/pane.js +89 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/responder/responder_chain.js +109 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/responder/root_responder.js +74 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state/initial_substate.js +67 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state/is_current_state.js +60 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state/namespacing.js +248 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state/plugin/mixin.js +68 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state/plugin/nesting.js +95 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state/state_observes.js +235 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/async/core.js +94 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/async/with_concurrent_states.js +123 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/async/without_concurrent_states.js +191 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/history_state/initial_substate/core.js +48 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/history_state/initial_substate/without_concurrent_states.js +218 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/history_state/standard/with_concurrent_states.js +88 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/history_state/standard/without_concurrent_states/context.js +191 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/history_state/standard/without_concurrent_states/core.js +200 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/advanced.js +239 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/basic.js +131 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/intermediate.js +120 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/without_concurrent_states/context.js +144 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/without_concurrent_states/core.js +281 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/transient/without_concurrent_states.js +162 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/create/assigned_root_state.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/create/unassigned_root_state.js +162 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/destroy.js +73 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/invoke_state_method.js +241 -0
- data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/owner.js +236 -0
- data/lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js +41 -0
- data/lib/frameworks/sproutcore/frameworks/table/system/table_column.js +125 -0
- data/lib/frameworks/sproutcore/frameworks/table/views/table.js +440 -0
- data/lib/frameworks/sproutcore/frameworks/table/views/table_cell.js +63 -0
- data/lib/frameworks/sproutcore/frameworks/table/views/table_head.js +158 -0
- data/lib/frameworks/sproutcore/frameworks/table/views/table_header.js +214 -0
- data/lib/frameworks/sproutcore/frameworks/table/views/table_row.js +155 -0
- data/lib/frameworks/sproutcore/frameworks/testing/core.js +199 -0
- data/lib/frameworks/sproutcore/frameworks/testing/english.lproj/additions.css +8 -0
- data/lib/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +128 -0
- data/lib/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +136 -0
- data/lib/frameworks/sproutcore/frameworks/testing/extras.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/dump.js +205 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/equiv.js +201 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +708 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +219 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/suite.js +222 -0
- data/lib/frameworks/sproutcore/frameworks/testing/utils.js +62 -0
- data/lib/frameworks/sproutcore/lib/index.rhtml +167 -0
- data/lib/frameworks/sproutcore/license.js +32 -0
- data/lib/frameworks/sproutcore/themes/ace/designs/dark.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/designs/light.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/designs/switch/switch_handle.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/designs/switch/switch_off.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/designs/switch/switch_on.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/body.css +13 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/18px/active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/18px/button.css +33 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/18px/normal_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/18px/selected_active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/18px/selected_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/active_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/button.css +102 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/normal_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/normal_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/normal_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/selected_active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/selected_active_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/selected_active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/selected_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/selected_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/24px/selected_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/button.css +78 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/normal_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/normal_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/selected_active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/selected_active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/selected_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/30px/selected_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/button.css +39 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/normal_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/button.css +41 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/active_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/button.css +93 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/normal_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/normal_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/normal_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/selected_active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/selected_active_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/selected_active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/selected_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/selected_button_capsule.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/24px/selected_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/button.css +72 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/normal_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/normal_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/selected_active_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/selected_active_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/selected_button.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/30px/selected_button_pointer.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/button.css +17 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/dark/button.js +5 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/popup/active_select.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/popup/normal_select.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/button/popup/select.css +21 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox.css +40 -0
- 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.css +40 -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/checkbox/ace/checkbox.css +7 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +4 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +17 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/source-list/selection.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/source-list/source-list.js +3 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/source-list/source_list_view.css +36 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/disclosure/ace/disclosure.css +24 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/disclosure/ace/disclosure_closed.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/disclosure/ace/disclosure_closed_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/disclosure/ace/disclosure_open.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/disclosure/ace/disclosure_open_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/imagebutton/ace/imagebutton.css +11 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/loading.css +50 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/master-detail/master-detail.css +27 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/checkmark.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/checkmark_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/down.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu.css +79 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu_item.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/menu/up.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/pane/pane.css +3 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel.css +13 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/panel.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.css +41 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.js +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/pointers.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/picker.js +32 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover.css +111 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover.js +12 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover_empty.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover_notoolbar.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover_pointers.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover_pointers_notoolbar.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/workspace.js +28 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/progress/ace/progress.css +27 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/progress/ace/progress_view_content.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/progress/ace/progress_view_track.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/radio/radio.css +57 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/radio/radio_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/radio/radio_mixed.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/radio/radio_mixed_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/radio/radio_selected.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/radio/radio_selected_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/radio/radio_unselected.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal.css +78 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal_touch.css +91 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/thumb.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/track_and_arrows.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/track_and_arrows_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/thumb.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/track_and_arrows.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/track_and_arrows_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical.css +80 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical_touch.css +92 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented.css +91 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented_normal.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented_selected.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented_selected_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented.css +91 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented_normal.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented_selected.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented_selected_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented.css +91 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented_normal.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented_selected.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented_selected_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented.css +95 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented_normal.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented_selected.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented_selected_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/segmented.css +83 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/knob.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/knob_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/slider.css +27 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/knob.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/knob_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/slider.css +27 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/knob.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/knob_active.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/slider.css +27 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/track.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/slider.css +8 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/track.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/split/split.css +31 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/tab/tab.css +3 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/toolbar/toolbar.css +8 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/toolbar/toolbar.png +0 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/well/well.css +7 -0
- data/lib/frameworks/sproutcore/themes/ace/theme.js +30 -0
- data/lib/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +69 -0
- data/lib/frameworks/sproutcore/themes/empty_theme/theme.js +16 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/button.css +41 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/core.css +8 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/backButton.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/blueButton.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/cancel.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/grayButton.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/leftButton.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrow.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrowSel.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listGroup.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/loading.gif +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/pinstripes.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/rightButton.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/selection.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/thumb.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggle.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggleOn.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolButton.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolbar.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/whiteButton.png +0 -0
- data/lib/frameworks/sproutcore/themes/iphone_theme/english.lproj/strings.js +15 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/10.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/100.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/102.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/110.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/120.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/127.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/18.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/19.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/2.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/24.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/26.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/27.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/28.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/29.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/30.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/31.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/33.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/37.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/41.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/16/99.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/10.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/100.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/102.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/110.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/120.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/127.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/18.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/19.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/2.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/24.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/26.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/27.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/28.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/29.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/30.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/31.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/33.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/37.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/41.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/24/99.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/10.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/100.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/102.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/110.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/120.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/127.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/18.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/19.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/2.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/24.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/26.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/27.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/28.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/29.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/30.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/31.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/33.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/37.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/41.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/32/99.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/48/10.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/48/18.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/48/19.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/Source/icons/48/2.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/button.css +399 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/checkbox.css +78 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/collection.css +135 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/core.css +76 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/disclosure.css +57 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/icons/mini_222222.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/icons/mini_454545.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/icons/mini_888888.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/icons/mini_ffffff.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/panels/sprite-x.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/panels/sprite-y.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/sc-scroller-repeat-x.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/sc-scroller-repeat-y.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/sc-scroller-sprite.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/sc-theme-ysprite.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/images/sc-toolbar-view.png +0 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/label.css +11 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/list_item.css +82 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/menu.css +20 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/menu_item_view.css +36 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/pane.css +18 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/panel.css +33 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/picker.css +17 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/progress.css +27 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/radio.css +125 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/scroller.css +159 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/segmented.css +270 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/slider.css +94 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/split_view.css +11 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/tab.css +14 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/table.css +14 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/text_field.css +5 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/toolbar.css +7 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/well.css +36 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/button.js +89 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/panel.js +28 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/progress.js +194 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/slider.js +67 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/well.js +27 -0
- data/lib/frameworks/sproutcore/themes/legacy_theme/theme.js +13 -0
- data/lib/gen/Buildfile +16 -0
- data/lib/gen/app/Buildfile +36 -0
- data/lib/gen/app/README +1 -0
- data/lib/gen/app/USAGE +13 -0
- data/lib/gen/app/templates/apps/@target_name@/Buildfile +14 -0
- data/lib/gen/app/templates/apps/@target_name@/core.js +27 -0
- data/lib/gen/app/templates/apps/@target_name@/main.js +30 -0
- data/lib/gen/app/templates/apps/@target_name@/resources/loading.rhtml +9 -0
- data/lib/gen/app/templates/apps/@target_name@/resources/main_page.js +24 -0
- data/lib/gen/app/templates/apps/@target_name@/theme.js +27 -0
- data/lib/gen/controller/Buildfile +18 -0
- data/lib/gen/controller/README +1 -0
- data/lib/gen/controller/USAGE +13 -0
- data/lib/gen/controller/templates/controllers/@filename@.js +18 -0
- data/lib/gen/controller/templates/tests/controllers/@filename@.js +15 -0
- data/lib/gen/data-source/Buildfile +18 -0
- data/lib/gen/data-source/README +1 -0
- data/lib/gen/data-source/USAGE +15 -0
- data/lib/gen/data-source/templates/data_sources/@filename@.js +64 -0
- data/lib/gen/design/Buildfile +23 -0
- data/lib/gen/design/README +1 -0
- data/lib/gen/design/USAGE +10 -0
- data/lib/gen/design/templates/resources/@filename@.js +16 -0
- data/lib/gen/framework/Buildfile +36 -0
- data/lib/gen/framework/README +1 -0
- data/lib/gen/framework/USAGE +13 -0
- data/lib/gen/framework/templates/frameworks/@target_name@/core.js +21 -0
- data/lib/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +15 -0
- 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 +4 -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/gen/language/Buildfile +26 -0
- data/lib/gen/language/README +1 -0
- data/lib/gen/language/USAGE +13 -0
- data/lib/gen/language/templates/@filename@/strings.js +14 -0
- data/lib/gen/model/Buildfile +16 -0
- data/lib/gen/model/README +1 -0
- data/lib/gen/model/USAGE +15 -0
- data/lib/gen/model/templates/fixtures/@filename@.js +35 -0
- data/lib/gen/model/templates/models/@filename@.js +19 -0
- data/lib/gen/model/templates/tests/models/@filename@.js +15 -0
- data/lib/gen/page/Buildfile +36 -0
- data/lib/gen/page/README +1 -0
- data/lib/gen/page/USAGE +15 -0
- data/lib/gen/page/templates/pages/@target_name@/Buildfile +16 -0
- data/lib/gen/page/templates/pages/@target_name@/core.js +22 -0
- data/lib/gen/page/templates/pages/@target_name@/en.lproj/strings.js +14 -0
- data/lib/gen/page/templates/pages/@target_name@/resources/body.css +1 -0
- data/lib/gen/page/templates/pages/@target_name@/resources/body.rhtml +7 -0
- data/lib/gen/project/Buildfile +45 -0
- data/lib/gen/project/INIT +3 -0
- data/lib/gen/project/README +1 -0
- data/lib/gen/project/USAGE +2 -0
- data/lib/gen/project/templates/@filename@/Buildfile +12 -0
- data/lib/gen/project/templates/@filename@/README +7 -0
- data/lib/gen/responder/Buildfile +18 -0
- data/lib/gen/responder/README +1 -0
- data/lib/gen/responder/USAGE +15 -0
- data/lib/gen/responder/templates/states/@filename@.js +39 -0
- data/lib/gen/test/Buildfile +25 -0
- data/lib/gen/test/README +1 -0
- data/lib/gen/test/USAGE +12 -0
- data/lib/gen/test/templates/tests/@filename@.js +15 -0
- data/lib/gen/theme/Buildfile +36 -0
- data/lib/gen/theme/README +1 -0
- data/lib/gen/theme/USAGE +13 -0
- data/lib/gen/theme/templates/themes/@target_name@/Buildfile +3 -0
- data/lib/gen/theme/templates/themes/@target_name@/resources/theme_styles.css +11 -0
- data/lib/gen/theme/templates/themes/@target_name@/theme.js +23 -0
- data/lib/gen/view/Buildfile +18 -0
- data/lib/gen/view/README +1 -0
- data/lib/gen/view/USAGE +13 -0
- data/lib/gen/view/templates/tests/views/@filename@.js +15 -0
- data/lib/gen/view/templates/views/@filename@.js +18 -0
- data/lib/sproutcore/builders/base.rb +97 -0
- data/lib/sproutcore/builders/chance_file.rb +78 -0
- data/lib/sproutcore/builders/combine.rb +61 -0
- data/lib/sproutcore/builders/handlebars.rb +30 -0
- data/lib/sproutcore/builders/html.rb +213 -0
- data/lib/sproutcore/builders/javascript.rb +107 -0
- data/lib/sproutcore/builders/less.rb +41 -0
- data/lib/sproutcore/builders/minify.rb +148 -0
- data/lib/sproutcore/builders/module.rb +74 -0
- data/lib/sproutcore/builders/sass.rb +65 -0
- data/lib/sproutcore/builders/string_wrapper.rb +41 -0
- data/lib/sproutcore/builders/strings.rb +45 -0
- data/lib/sproutcore/builders/stylesheet.rb +49 -0
- data/lib/sproutcore/builders/test.rb +59 -0
- data/lib/sproutcore/builders/test_index.rb +26 -0
- data/lib/sproutcore/builders.rb +15 -0
- data/lib/sproutcore/buildfile/build_task.rb +33 -0
- data/lib/sproutcore/buildfile/buildfile_dsl.rb +169 -0
- data/lib/sproutcore/buildfile/early_time.rb +30 -0
- data/lib/sproutcore/buildfile/invocation_chain.rb +64 -0
- data/lib/sproutcore/buildfile/namespace.rb +33 -0
- data/lib/sproutcore/buildfile/string_ext.rb +202 -0
- data/lib/sproutcore/buildfile/task.rb +325 -0
- data/lib/sproutcore/buildfile/task_arguments.rb +106 -0
- data/lib/sproutcore/buildfile/task_manager.rb +204 -0
- data/lib/sproutcore/buildfile.rb +490 -0
- data/lib/sproutcore/deprecated/view_helper.rb +662 -0
- data/lib/sproutcore/helpers/capture_helper.rb +30 -0
- data/lib/sproutcore/helpers/cssmin.rb +202 -0
- data/lib/sproutcore/helpers/dom_id_helper.rb +21 -0
- data/lib/sproutcore/helpers/entry_sorter.rb +125 -0
- data/lib/sproutcore/helpers/html5_manifest.rb +88 -0
- data/lib/sproutcore/helpers/minifier.rb +106 -0
- data/lib/sproutcore/helpers/packed_optimizer.rb +102 -0
- data/lib/sproutcore/helpers/static_helper.rb +444 -0
- data/lib/sproutcore/helpers/tag_helper.rb +182 -0
- data/lib/sproutcore/helpers/text_helper.rb +303 -0
- data/lib/sproutcore/helpers.rb +11 -0
- data/lib/sproutcore/models/generator.rb +509 -0
- data/lib/sproutcore/models/hash_struct.rb +124 -0
- data/lib/sproutcore/models/manifest.rb +387 -0
- data/lib/sproutcore/models/manifest_entry.rb +362 -0
- data/lib/sproutcore/models/project.rb +267 -0
- data/lib/sproutcore/models/target.rb +870 -0
- data/lib/sproutcore/models.rb +8 -0
- data/lib/sproutcore/rack/builder.rb +344 -0
- data/lib/sproutcore/rack/dev.rb +92 -0
- data/lib/sproutcore/rack/docs.rb +24 -0
- data/lib/sproutcore/rack/filesystem.rb +324 -0
- data/lib/sproutcore/rack/proxy.rb +165 -0
- data/lib/sproutcore/rack/service.rb +153 -0
- data/lib/sproutcore/rack/test_runner.rb +24 -0
- data/lib/sproutcore/rack.rb +7 -0
- data/lib/sproutcore/render_engines/erubis.rb +55 -0
- data/lib/sproutcore/render_engines/haml.rb +39 -0
- data/lib/sproutcore/tools/build.rb +100 -0
- data/lib/sproutcore/tools/build_number.rb +23 -0
- data/lib/sproutcore/tools/docs.rb +53 -0
- data/lib/sproutcore/tools/gen.rb +101 -0
- data/lib/sproutcore/tools/init.rb +56 -0
- data/lib/sproutcore/tools/manifest.rb +85 -0
- data/lib/sproutcore/tools/server.rb +56 -0
- data/lib/sproutcore/tools.rb +419 -0
- data/lib/sproutcore/version.rb +12 -0
- data/lib/sproutcore.rb +169 -0
- data/spec/buildtasks/build/copy_spec.rb +60 -0
- data/spec/buildtasks/build/spec_helper.rb +36 -0
- data/spec/buildtasks/manifest/catalog_spec.rb +48 -0
- data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +126 -0
- data/spec/buildtasks/manifest/localize_spec.rb +97 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/chance_2x_spec.rb +100 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/chance_spec.rb +104 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +331 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +87 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/handlebars_spec.rb +39 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +175 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +65 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +70 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/module_info_spec.rb +96 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/module_spec.rb +83 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_2x_indirect_spec.rb +191 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_2x_spec.rb +185 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +187 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +98 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +64 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +163 -0
- data/spec/buildtasks/manifest/prepare_spec.rb +43 -0
- data/spec/buildtasks/manifest/spec_helper.rb +39 -0
- data/spec/buildtasks/target_spec.rb +270 -0
- data/spec/fixtures/builder_tests/Buildfile +22 -0
- data/spec/fixtures/builder_tests/apps/chance_test/Buildfile +14 -0
- data/spec/fixtures/builder_tests/apps/chance_test/core.js +27 -0
- data/spec/fixtures/builder_tests/apps/chance_test/main.js +30 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/demo.css +6 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/force@2x.png +0 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/last_file.css +7 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/loading.rhtml +9 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/main_page.js +24 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/z_first_file.css +6 -0
- data/spec/fixtures/builder_tests/apps/chance_test/theme.js +27 -0
- data/spec/fixtures/builder_tests/apps/combine_test/a.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/b.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/c.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +1 -0
- data/spec/fixtures/builder_tests/apps/handlebars_test/template.handlebars +5 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +2 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/icons/image.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/image.jpg +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/rhtml_sample.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/style.css +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/french-icons/fr.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +15 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +4 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +7 -0
- data/spec/fixtures/builder_tests/apps/less_test/sample.less +4 -0
- data/spec/fixtures/builder_tests/apps/module_test/module.js +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/english.lproj/req_style_2.css +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/javascript.js +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/lib/alt_layout.rhtml +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/req_js_2.js +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/dynamic_req_target_1/dynamic_req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/dynamic_req_target_1/english.lproj/dynamic_req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/inlined_module/README +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/english.lproj/req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/english.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +4 -0
- data/spec/fixtures/builder_tests/apps/sass_test/sample.scss +4 -0
- data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +8 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +9 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +12 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +3 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +4 -0
- data/spec/fixtures/builder_tests/frameworks/debug/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/debug/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/dynamic_req_target_1/dynamic_req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/dynamic_req_target_1/english.lproj/dynamic_req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/req_style_2.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/lib/alt_layout.rhtml +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/req_js_2.js +0 -0
- data/spec/fixtures/builder_tests/themes/sample_theme/Buildfile +1 -0
- data/spec/fixtures/buildfiles/basic/Buildfile +11 -0
- data/spec/fixtures/buildfiles/basic/task_module.rake +6 -0
- data/spec/fixtures/buildfiles/installed/Buildfile +5 -0
- data/spec/fixtures/buildfiles/installed/Buildfile2 +5 -0
- data/spec/fixtures/buildfiles/project_test/Buildfile +4 -0
- data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +2 -0
- data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/Buildfile +1 -0
- data/spec/fixtures/entry_for_project/apps/test_app/entry.txt +0 -0
- data/spec/fixtures/entry_for_project/apps/test_app/frameworks/nested/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/frameworks/unrelated/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/Buildfile +8 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/Buildfile +5 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/foos/not_foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/nested/Buildfile +8 -0
- data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +1 -0
- data/spec/fixtures/find_targets/nested/apps/app1/apps/nested_app/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/clients/client1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme2/PLACEHOLDER +0 -0
- data/spec/fixtures/helper_tests/apps/minifier_test/core.js +8 -0
- data/spec/fixtures/languages/apps/caps_long_names/English.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/FreNCH.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/UnknOWN.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/english.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/french.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/german.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/italian.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/japanese.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/spanish.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/unknown.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/no_names/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/de.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-CA.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-GB.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-US.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/es.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/foo.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/fr.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/it.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/ja.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/1.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/B.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/c.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/core.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/B.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/b.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/b/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/c.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/strings.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/main.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/resources/main_page.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/t.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +1 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/a.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/b.js +3 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/c.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +1 -0
- data/spec/fixtures/real_world/Buildfile +22 -0
- data/spec/fixtures/real_world/apps/account/README +1 -0
- data/spec/fixtures/real_world/apps/account/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/calendar/README +1 -0
- data/spec/fixtures/real_world/apps/calendar/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +1 -0
- data/spec/fixtures/real_world/apps/contacts/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/contacts/modules/printing/README +0 -0
- data/spec/fixtures/real_world/apps/files/README +1 -0
- data/spec/fixtures/real_world/apps/mail/README +1 -0
- data/spec/fixtures/real_world/apps/mail/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/mail/modules/printing/README +0 -0
- data/spec/fixtures/real_world/apps/mobile_photos/README +1 -0
- data/spec/fixtures/real_world/apps/photos/README +1 -0
- data/spec/fixtures/real_world/apps/photos/modules/email/README +0 -0
- data/spec/fixtures/real_world/apps/photos/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/uploader/README +1 -0
- data/spec/fixtures/real_world/frameworks/core_files/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/core_photos/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/no_2x/resources/test.css +1 -0
- data/spec/fixtures/real_world/frameworks/no_2x/resources/test.png +0 -0
- data/spec/fixtures/real_world/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +26 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/README +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/test_runner/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/debug-resource.html +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/sample_debug.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/demo2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/demo3.scss +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/debug/sample_debug-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.css +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo2.sass +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo3.scss +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo4.less +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.haml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.html.erb +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.rhtml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/fixtures/sample_fixtures-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/has_require.css +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/protocols/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.css +6 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +3 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/templates/demo.handlebars +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/tests/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample-json-fixture.json +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample_fixtures.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/application/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/costello/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/data_store/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/debug/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/desktop/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/empty_theme/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/foundation/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/mobile/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/qunit/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/uploader/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/french-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/strings.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/german-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/strings.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/has_require.js +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/resources/boo.png +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/resources/force@2x.png +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +6 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample1.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.rhtml +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +1 -0
- data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
- data/spec/fixtures/real_world/generators/sample_custom/templates/{filename}.js +1 -0
- data/spec/fixtures/recursive_project/Buildfile +8 -0
- data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
- data/spec/lib/builders/chance_file_spec.rb +44 -0
- data/spec/lib/builders/combine_spec.rb +67 -0
- data/spec/lib/builders/handlebars_spec.rb +29 -0
- data/spec/lib/builders/html_spec.rb +580 -0
- data/spec/lib/builders/javascript_spec.rb +82 -0
- data/spec/lib/builders/less_spec.rb +51 -0
- data/spec/lib/builders/module_spec.rb +133 -0
- data/spec/lib/builders/sass_spec.rb +72 -0
- data/spec/lib/builders/spec_helper.rb +30 -0
- data/spec/lib/builders/strings_spec.rb +56 -0
- data/spec/lib/builders/stylesheet_spec.rb +64 -0
- data/spec/lib/builders/test_index_spec.rb +45 -0
- data/spec/lib/builders/test_spec.rb +137 -0
- data/spec/lib/buildfile/config_for_spec.rb +81 -0
- data/spec/lib/buildfile/define_spec.rb +59 -0
- data/spec/lib/buildfile/dup_spec.rb +65 -0
- data/spec/lib/buildfile/invoke_spec.rb +135 -0
- data/spec/lib/buildfile/load_spec.rb +51 -0
- data/spec/lib/buildfile/task/dup_spec.rb +55 -0
- data/spec/lib/buildfile/task_defined_spec.rb +17 -0
- data/spec/lib/buildfile_commands/build_task_spec.rb +19 -0
- data/spec/lib/buildfile_commands/config_spec.rb +97 -0
- data/spec/lib/buildfile_commands/import_spec.rb +17 -0
- data/spec/lib/buildfile_commands/namespace_spec.rb +18 -0
- data/spec/lib/buildfile_commands/proxies_spec.rb +38 -0
- data/spec/lib/buildfile_commands/replace_task_spec.rb +29 -0
- data/spec/lib/buildfile_commands/task_spec.rb +36 -0
- data/spec/lib/helpers/minifier.rb +31 -0
- data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +26 -0
- data/spec/lib/models/hash_struct/deep_clone_spec.rb +27 -0
- data/spec/lib/models/hash_struct/has_options_spec.rb +32 -0
- data/spec/lib/models/hash_struct/hash_spec.rb +29 -0
- data/spec/lib/models/hash_struct/merge_spec.rb +19 -0
- data/spec/lib/models/hash_struct/method_missing.rb +41 -0
- data/spec/lib/models/manifest/add_entry_spec.rb +36 -0
- data/spec/lib/models/manifest/add_transform_spec.rb +93 -0
- data/spec/lib/models/manifest/build_spec.rb +78 -0
- data/spec/lib/models/manifest/entry_for_spec.rb +94 -0
- data/spec/lib/models/manifest/find_entry.rb +119 -0
- data/spec/lib/models/manifest/prepare_spec.rb +62 -0
- data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +31 -0
- data/spec/lib/models/manifest_entry/hyperdomain_prefix.rb +34 -0
- data/spec/lib/models/manifest_entry/prepare_spec.rb +54 -0
- data/spec/lib/models/project/add_target_spec.rb +44 -0
- data/spec/lib/models/project/buildfile_spec.rb +35 -0
- data/spec/lib/models/project/find_targets_for_spec.rb +78 -0
- data/spec/lib/models/project/load_nearest_project_spec.rb +23 -0
- data/spec/lib/models/project/target_for_spec.rb +33 -0
- data/spec/lib/models/project/targets_spec.rb +62 -0
- data/spec/lib/models/target/compute_build_number_spec.rb +126 -0
- data/spec/lib/models/target/config_spec.rb +30 -0
- data/spec/lib/models/target/expand_required_targets_spec.rb +48 -0
- data/spec/lib/models/target/installed_languages_spec.rb +47 -0
- data/spec/lib/models/target/lproj_for_spec.rb +38 -0
- data/spec/lib/models/target/manifest_for_spec.rb +42 -0
- data/spec/lib/models/target/parent_target_spec.rb +21 -0
- data/spec/lib/models/target/prepare_spec.rb +53 -0
- data/spec/lib/models/target/required_targets_spec.rb +129 -0
- data/spec/lib/models/target/target_for_spec.rb +56 -0
- data/spec/lib/tools/build_number_spec.rb +35 -0
- data/spec/lib/tools/gen_spec.rb +209 -0
- data/spec/lib/tools/tools_spec.rb +96 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +138 -0
- data/sproutcore.gemspec +65 -0
- data/vendor/chance/.gitignore +5 -0
- data/vendor/chance/Gemfile +4 -0
- data/vendor/chance/Rakefile +2 -0
- data/vendor/chance/bin/chance +46 -0
- data/vendor/chance/chance.gemspec +28 -0
- data/vendor/chance/lib/chance/instance/data_url.rb +85 -0
- data/vendor/chance/lib/chance/instance/javascript.rb +19 -0
- data/vendor/chance/lib/chance/instance/slicing.rb +181 -0
- data/vendor/chance/lib/chance/instance/spriting.rb +311 -0
- data/vendor/chance/lib/chance/instance.rb +330 -0
- data/vendor/chance/lib/chance/parser.rb +835 -0
- data/vendor/chance/lib/chance/perf.rb +17 -0
- data/vendor/chance/lib/chance/version.rb +3 -0
- data/vendor/chance/lib/chance.rb +158 -0
- data/vendor/chance/lib/tester/test.rb +108 -0
- data/vendor/chance/lib/tester/test_runner.rb +27 -0
- data/vendor/chance/test/case/abc.png +0 -0
- data/vendor/chance/test/case/more/abc.png +0 -0
- data/vendor/chance/test/case/more/another.css +4 -0
- data/vendor/chance/test/case/test1.css +22 -0
- data/vendor/chance/test/case/test2.css +6 -0
- data/vendor/chance/tests/parser/basic/input/test.css +4 -0
- data/vendor/chance/tests/parser/basic/output/test.parsed.css +5 -0
- data/vendor/jsdoc/README.txt +151 -0
- data/vendor/jsdoc/app/frame/Chain.js +102 -0
- data/vendor/jsdoc/app/frame/Dumper.js +144 -0
- data/vendor/jsdoc/app/frame/Hash.js +47 -0
- data/vendor/jsdoc/app/frame/Link.js +142 -0
- data/vendor/jsdoc/app/frame/Namespace.js +10 -0
- data/vendor/jsdoc/app/frame/Opt.js +134 -0
- data/vendor/jsdoc/app/frame/Reflection.js +26 -0
- data/vendor/jsdoc/app/frame/String.js +93 -0
- data/vendor/jsdoc/app/frame/Testrun.js +129 -0
- data/vendor/jsdoc/app/frame.js +33 -0
- data/vendor/jsdoc/app/handlers/FOODOC.js +26 -0
- data/vendor/jsdoc/app/handlers/XMLDOC/DomReader.js +159 -0
- data/vendor/jsdoc/app/handlers/XMLDOC/XMLDoc.js +16 -0
- data/vendor/jsdoc/app/handlers/XMLDOC/XMLParse.js +292 -0
- data/vendor/jsdoc/app/handlers/XMLDOC.js +26 -0
- data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +200 -0
- data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +294 -0
- data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +162 -0
- data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +100 -0
- data/vendor/jsdoc/app/lib/JSDOC/Lang.js +144 -0
- data/vendor/jsdoc/app/lib/JSDOC/Parser.js +109 -0
- data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +33 -0
- data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +681 -0
- data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +226 -0
- data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +41 -0
- data/vendor/jsdoc/app/lib/JSDOC/Token.js +18 -0
- data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +332 -0
- data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +133 -0
- data/vendor/jsdoc/app/lib/JSDOC/Util.js +32 -0
- data/vendor/jsdoc/app/lib/JSDOC/Walker.js +453 -0
- data/vendor/jsdoc/app/lib/JSDOC.js +98 -0
- data/vendor/jsdoc/app/main.js +74 -0
- data/vendor/jsdoc/app/plugins/commentSrcJson.js +19 -0
- data/vendor/jsdoc/app/plugins/frameworkPrototype.js +16 -0
- data/vendor/jsdoc/app/plugins/functionCall.js +10 -0
- data/vendor/jsdoc/app/plugins/publishSrcHilite.js +62 -0
- data/vendor/jsdoc/app/plugins/sproutcoreTags.js +26 -0
- data/vendor/jsdoc/app/plugins/symbolLink.js +9 -0
- data/vendor/jsdoc/app/plugins/tagParamConfig.js +31 -0
- data/vendor/jsdoc/app/plugins/tagSynonyms.js +43 -0
- data/vendor/jsdoc/app/run.js +346 -0
- data/vendor/jsdoc/app/t/TestDoc.js +144 -0
- data/vendor/jsdoc/app/t/runner.js +13 -0
- data/vendor/jsdoc/app/test/addon.js +24 -0
- data/vendor/jsdoc/app/test/anon_inner.js +14 -0
- data/vendor/jsdoc/app/test/augments.js +31 -0
- data/vendor/jsdoc/app/test/augments2.js +26 -0
- data/vendor/jsdoc/app/test/borrows.js +41 -0
- data/vendor/jsdoc/app/test/borrows2.js +23 -0
- data/vendor/jsdoc/app/test/config.js +22 -0
- data/vendor/jsdoc/app/test/constructs.js +18 -0
- data/vendor/jsdoc/app/test/encoding.js +10 -0
- data/vendor/jsdoc/app/test/encoding_other.js +12 -0
- data/vendor/jsdoc/app/test/functions_anon.js +39 -0
- data/vendor/jsdoc/app/test/functions_nested.js +33 -0
- data/vendor/jsdoc/app/test/global.js +13 -0
- data/vendor/jsdoc/app/test/globals.js +25 -0
- data/vendor/jsdoc/app/test/ignore.js +10 -0
- data/vendor/jsdoc/app/test/inner.js +16 -0
- data/vendor/jsdoc/app/test/jsdoc_test.js +477 -0
- data/vendor/jsdoc/app/test/lend.js +33 -0
- data/vendor/jsdoc/app/test/memberof.js +20 -0
- data/vendor/jsdoc/app/test/memberof_constructor.js +15 -0
- data/vendor/jsdoc/app/test/name.js +19 -0
- data/vendor/jsdoc/app/test/namespace_nested.js +23 -0
- data/vendor/jsdoc/app/test/nocode.js +13 -0
- data/vendor/jsdoc/app/test/oblit_anon.js +20 -0
- data/vendor/jsdoc/app/test/overview.js +20 -0
- data/vendor/jsdoc/app/test/param_inline.js +37 -0
- data/vendor/jsdoc/app/test/params_optional.js +8 -0
- data/vendor/jsdoc/app/test/prototype.js +17 -0
- data/vendor/jsdoc/app/test/prototype_nested.js +9 -0
- data/vendor/jsdoc/app/test/prototype_oblit.js +13 -0
- data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +24 -0
- data/vendor/jsdoc/app/test/public.js +10 -0
- data/vendor/jsdoc/app/test/shared.js +42 -0
- data/vendor/jsdoc/app/test/shared2.js +2 -0
- data/vendor/jsdoc/app/test/shortcuts.js +22 -0
- data/vendor/jsdoc/app/test/static_this.js +13 -0
- data/vendor/jsdoc/app/test/synonyms.js +23 -0
- data/vendor/jsdoc/app/test/tosource.js +23 -0
- data/vendor/jsdoc/app/test/variable_redefine.js +14 -0
- data/vendor/jsdoc/app/test.js +304 -0
- data/vendor/jsdoc/changes.txt +47 -0
- data/vendor/jsdoc/conf/sample.conf +31 -0
- data/vendor/jsdoc/java/build.xml +36 -0
- data/vendor/jsdoc/java/build_1.4.xml +36 -0
- data/vendor/jsdoc/java/classes/js.jar +0 -0
- data/vendor/jsdoc/java/src/JsDebugRun.java +21 -0
- data/vendor/jsdoc/java/src/JsRun.java +21 -0
- data/vendor/jsdoc/jsdebug.jar +0 -0
- data/vendor/jsdoc/jsrun.jar +0 -0
- data/vendor/jsdoc/t/TestDoc.js +144 -0
- data/vendor/jsdoc/t/runner.js +13 -0
- data/vendor/jsdoc/test/addon.js +24 -0
- data/vendor/jsdoc/test/anon_inner.js +14 -0
- data/vendor/jsdoc/test/augments.js +31 -0
- data/vendor/jsdoc/test/augments2.js +26 -0
- data/vendor/jsdoc/test/borrows.js +41 -0
- data/vendor/jsdoc/test/borrows2.js +23 -0
- data/vendor/jsdoc/test/config.js +22 -0
- data/vendor/jsdoc/test/constructs.js +18 -0
- data/vendor/jsdoc/test/encoding.js +10 -0
- data/vendor/jsdoc/test/encoding_other.js +12 -0
- data/vendor/jsdoc/test/functions_anon.js +39 -0
- data/vendor/jsdoc/test/functions_nested.js +33 -0
- data/vendor/jsdoc/test/global.js +13 -0
- data/vendor/jsdoc/test/globals.js +25 -0
- data/vendor/jsdoc/test/ignore.js +10 -0
- data/vendor/jsdoc/test/inner.js +16 -0
- data/vendor/jsdoc/test/jsdoc_test.js +477 -0
- data/vendor/jsdoc/test/lend.js +33 -0
- data/vendor/jsdoc/test/memberof.js +20 -0
- data/vendor/jsdoc/test/memberof_constructor.js +15 -0
- data/vendor/jsdoc/test/name.js +19 -0
- data/vendor/jsdoc/test/namespace_nested.js +23 -0
- data/vendor/jsdoc/test/nocode.js +13 -0
- data/vendor/jsdoc/test/oblit_anon.js +20 -0
- data/vendor/jsdoc/test/overview.js +20 -0
- data/vendor/jsdoc/test/param_inline.js +37 -0
- data/vendor/jsdoc/test/params_optional.js +8 -0
- data/vendor/jsdoc/test/prototype.js +17 -0
- data/vendor/jsdoc/test/prototype_nested.js +9 -0
- data/vendor/jsdoc/test/prototype_oblit.js +13 -0
- data/vendor/jsdoc/test/prototype_oblit_constructor.js +24 -0
- data/vendor/jsdoc/test/public.js +10 -0
- data/vendor/jsdoc/test/shared.js +42 -0
- data/vendor/jsdoc/test/shared2.js +2 -0
- data/vendor/jsdoc/test/shortcuts.js +22 -0
- data/vendor/jsdoc/test/static_this.js +13 -0
- data/vendor/jsdoc/test/synonyms.js +23 -0
- data/vendor/jsdoc/test/tosource.js +23 -0
- data/vendor/jsdoc/test/variable_redefine.js +14 -0
- data/vendor/jsdoc/test.js +304 -0
- data/vendor/sproutcore/lib/htmlcompressor-0.9.3.jar +0 -0
- data/vendor/sproutcore/lib/yuicompressor-2.4.6.jar +0 -0
- metadata +2339 -0
@@ -0,0 +1,2860 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore - JavaScript Application Framework
|
3
|
+
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
4
|
+
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
sc_require('models/record');
|
9
|
+
|
10
|
+
/**
|
11
|
+
@class
|
12
|
+
|
13
|
+
|
14
|
+
The Store is where you can find all of your dataHashes. Stores can be
|
15
|
+
chained for editing purposes and committed back one chain level at a time
|
16
|
+
all the way back to a persistent data source.
|
17
|
+
|
18
|
+
Every application you create should generally have its own store objects.
|
19
|
+
Once you create the store, you will rarely need to work with the store
|
20
|
+
directly except to retrieve records and collections.
|
21
|
+
|
22
|
+
Internally, the store will keep track of changes to your json data hashes
|
23
|
+
and manage syncing those changes with your data source. A data source may
|
24
|
+
be a server, local storage, or any other persistent code.
|
25
|
+
|
26
|
+
@extends SC.Object
|
27
|
+
@since SproutCore 1.0
|
28
|
+
*/
|
29
|
+
SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
|
30
|
+
|
31
|
+
/**
|
32
|
+
An (optional) name of the store, which can be useful during debugging,
|
33
|
+
especially if you have multiple nested stores.
|
34
|
+
|
35
|
+
@type String
|
36
|
+
*/
|
37
|
+
name: null,
|
38
|
+
|
39
|
+
/**
|
40
|
+
An array of all the chained stores that current rely on the receiver
|
41
|
+
store.
|
42
|
+
|
43
|
+
@type Array
|
44
|
+
*/
|
45
|
+
nestedStores: null,
|
46
|
+
|
47
|
+
/**
|
48
|
+
The data source is the persistent storage that will provide data to the
|
49
|
+
store and save changes. You normally will set your data source when you
|
50
|
+
first create your store in your application.
|
51
|
+
|
52
|
+
@type SC.DataSource
|
53
|
+
*/
|
54
|
+
dataSource: null,
|
55
|
+
|
56
|
+
/**
|
57
|
+
This type of store is not nested.
|
58
|
+
|
59
|
+
@default NO
|
60
|
+
@type Boolean
|
61
|
+
*/
|
62
|
+
isNested: NO,
|
63
|
+
|
64
|
+
/**
|
65
|
+
This type of store is not nested.
|
66
|
+
|
67
|
+
@default NO
|
68
|
+
@type Boolean
|
69
|
+
*/
|
70
|
+
commitRecordsAutomatically: NO,
|
71
|
+
|
72
|
+
// ..........................................................
|
73
|
+
// DATA SOURCE SUPPORT
|
74
|
+
//
|
75
|
+
|
76
|
+
/**
|
77
|
+
Convenience method. Sets the current data source to the passed property.
|
78
|
+
This will also set the store property on the dataSource to the receiver.
|
79
|
+
|
80
|
+
If you are using this from the `core.js` method of your app, you may need to
|
81
|
+
just pass a string naming your data source class. If this is the case,
|
82
|
+
then your data source will be instantiated the first time it is requested.
|
83
|
+
|
84
|
+
@param {SC.DataSource|String} dataSource the data source
|
85
|
+
@returns {SC.Store} receiver
|
86
|
+
*/
|
87
|
+
from: function(dataSource) {
|
88
|
+
this.set('dataSource', dataSource);
|
89
|
+
return this ;
|
90
|
+
},
|
91
|
+
|
92
|
+
// lazily convert data source to real object
|
93
|
+
_getDataSource: function() {
|
94
|
+
var ret = this.get('dataSource');
|
95
|
+
if (typeof ret === SC.T_STRING) {
|
96
|
+
ret = SC.objectForPropertyPath(ret);
|
97
|
+
if (ret && ret.isClass) ret = ret.create();
|
98
|
+
if (ret) this.set('dataSource', ret);
|
99
|
+
}
|
100
|
+
return ret;
|
101
|
+
},
|
102
|
+
|
103
|
+
/**
|
104
|
+
Convenience method. Creates a `CascadeDataSource` with the passed
|
105
|
+
data source arguments and sets the `CascadeDataSource` as the data source
|
106
|
+
for the receiver.
|
107
|
+
|
108
|
+
@param {SC.DataSource...} dataSource one or more data source arguments
|
109
|
+
@returns {SC.Store} reciever
|
110
|
+
*/
|
111
|
+
cascade: function(dataSource) {
|
112
|
+
var dataSources = SC.A(arguments) ;
|
113
|
+
dataSource = SC.CascadeDataSource.create({
|
114
|
+
dataSources: dataSources
|
115
|
+
});
|
116
|
+
return this.from(dataSource);
|
117
|
+
},
|
118
|
+
|
119
|
+
// ..........................................................
|
120
|
+
// STORE CHAINING
|
121
|
+
//
|
122
|
+
|
123
|
+
/**
|
124
|
+
Returns a new nested store instance that can be used to buffer changes
|
125
|
+
until you are ready to commit them. When you are ready to commit your
|
126
|
+
changes, call `commitChanges()` or `destroyChanges()` and then `destroy()`
|
127
|
+
when you are finished with the chained store altogether.
|
128
|
+
|
129
|
+
store = MyApp.store.chain();
|
130
|
+
.. edit edit edit
|
131
|
+
store.commitChanges().destroy();
|
132
|
+
|
133
|
+
@param {Hash} attrs optional attributes to set on new store
|
134
|
+
@param {Class} newStoreClass optional the class of the newly-created nested store (defaults to SC.NestedStore)
|
135
|
+
@returns {SC.NestedStore} new nested store chained to receiver
|
136
|
+
*/
|
137
|
+
chain: function(attrs, newStoreClass) {
|
138
|
+
if (!attrs) attrs = {};
|
139
|
+
attrs.parentStore = this;
|
140
|
+
|
141
|
+
if (newStoreClass) {
|
142
|
+
// Ensure the passed-in class is a type of nested store.
|
143
|
+
if (SC.typeOf(newStoreClass) !== 'class') throw new Error("%@ is not a valid class".fmt(newStoreClass));
|
144
|
+
if (!SC.kindOf(newStoreClass, SC.NestedStore)) throw new Error("%@ is not a type of SC.NestedStore".fmt(newStoreClass));
|
145
|
+
}
|
146
|
+
else {
|
147
|
+
newStoreClass = SC.NestedStore;
|
148
|
+
}
|
149
|
+
|
150
|
+
// Replicate parent records references
|
151
|
+
attrs.childRecords = this.childRecords ? SC.clone(this.childRecords) : {};
|
152
|
+
attrs.parentRecords = this.parentRecords ? SC.clone(this.parentRecords) : {};
|
153
|
+
|
154
|
+
var ret = newStoreClass.create(attrs),
|
155
|
+
nested = this.nestedStores;
|
156
|
+
|
157
|
+
if (!nested) nested = this.nestedStores = [];
|
158
|
+
nested.push(ret);
|
159
|
+
return ret ;
|
160
|
+
},
|
161
|
+
|
162
|
+
/** @private
|
163
|
+
|
164
|
+
Called by a nested store just before it is destroyed so that the parent
|
165
|
+
can remove the store from its list of nested stores.
|
166
|
+
|
167
|
+
@returns {SC.Store} receiver
|
168
|
+
*/
|
169
|
+
willDestroyNestedStore: function(nestedStore) {
|
170
|
+
if (this.nestedStores) {
|
171
|
+
this.nestedStores.removeObject(nestedStore);
|
172
|
+
}
|
173
|
+
return this ;
|
174
|
+
},
|
175
|
+
|
176
|
+
/**
|
177
|
+
Used to determine if a nested store belongs directly or indirectly to the
|
178
|
+
receiver.
|
179
|
+
|
180
|
+
@param {SC.Store} store store instance
|
181
|
+
@returns {Boolean} YES if belongs
|
182
|
+
*/
|
183
|
+
hasNestedStore: function(store) {
|
184
|
+
while(store && (store !== this)) store = store.get('parentStore');
|
185
|
+
return store === this ;
|
186
|
+
},
|
187
|
+
|
188
|
+
// ..........................................................
|
189
|
+
// SHARED DATA STRUCTURES
|
190
|
+
//
|
191
|
+
|
192
|
+
/** @private
|
193
|
+
JSON data hashes indexed by store key.
|
194
|
+
|
195
|
+
*IMPORTANT: Property is not observable*
|
196
|
+
|
197
|
+
Shared by a store and its child stores until you make edits to it.
|
198
|
+
|
199
|
+
@type Hash
|
200
|
+
*/
|
201
|
+
dataHashes: null,
|
202
|
+
|
203
|
+
/** @private
|
204
|
+
The current status of a data hash indexed by store key.
|
205
|
+
|
206
|
+
*IMPORTANT: Property is not observable*
|
207
|
+
|
208
|
+
Shared by a store and its child stores until you make edits to it.
|
209
|
+
|
210
|
+
@type Hash
|
211
|
+
*/
|
212
|
+
statuses: null,
|
213
|
+
|
214
|
+
/** @private
|
215
|
+
This array contains the revisions for the attributes indexed by the
|
216
|
+
storeKey.
|
217
|
+
|
218
|
+
*IMPORTANT: Property is not observable*
|
219
|
+
|
220
|
+
Revisions are used to keep track of when an attribute hash has been
|
221
|
+
changed. A store shares the revisions data with its parent until it
|
222
|
+
starts to make changes to it.
|
223
|
+
|
224
|
+
@type Hash
|
225
|
+
*/
|
226
|
+
revisions: null,
|
227
|
+
|
228
|
+
/**
|
229
|
+
Array indicates whether a data hash is possibly in use by an external
|
230
|
+
record for editing. If a data hash is editable then it may be modified
|
231
|
+
at any time and therefore chained stores may need to clone the
|
232
|
+
attributes before keeping a copy of them.
|
233
|
+
|
234
|
+
Note that this is kept as an array because it will be stored as a dense
|
235
|
+
array on some browsers, making it faster.
|
236
|
+
|
237
|
+
@type Array
|
238
|
+
*/
|
239
|
+
editables: null,
|
240
|
+
|
241
|
+
/**
|
242
|
+
A set of storeKeys that need to be committed back to the data source. If
|
243
|
+
you call `commitRecords()` without passing any other parameters, the keys
|
244
|
+
in this set will be committed instead.
|
245
|
+
|
246
|
+
@type SC.Set
|
247
|
+
*/
|
248
|
+
changelog: null,
|
249
|
+
|
250
|
+
/**
|
251
|
+
An array of `SC.Error` objects associated with individual records in the
|
252
|
+
store (indexed by store keys).
|
253
|
+
|
254
|
+
Errors passed form the data source in the call to dataSourceDidError() are
|
255
|
+
stored here.
|
256
|
+
|
257
|
+
@type Array
|
258
|
+
*/
|
259
|
+
recordErrors: null,
|
260
|
+
|
261
|
+
/**
|
262
|
+
A hash of `SC.Error` objects associated with queries (indexed by the GUID
|
263
|
+
of the query).
|
264
|
+
|
265
|
+
Errors passed from the data source in the call to
|
266
|
+
`dataSourceDidErrorQuery()` are stored here.
|
267
|
+
|
268
|
+
@type Hash
|
269
|
+
*/
|
270
|
+
queryErrors: null,
|
271
|
+
|
272
|
+
/**
|
273
|
+
A hash of child Records and there immediate parents
|
274
|
+
*/
|
275
|
+
childRecords: null,
|
276
|
+
|
277
|
+
/**
|
278
|
+
A hash of parent records with registered children
|
279
|
+
*/
|
280
|
+
parentRecords: null,
|
281
|
+
|
282
|
+
// ..........................................................
|
283
|
+
// CORE ATTRIBUTE API
|
284
|
+
//
|
285
|
+
// The methods in this layer work on data hashes in the store. They do not
|
286
|
+
// perform any changes that can impact records. Usually you will not need
|
287
|
+
// to use these methods.
|
288
|
+
|
289
|
+
/**
|
290
|
+
Returns the current edit status of a storekey. May be one of
|
291
|
+
`EDITABLE` or `LOCKED`. Used mostly for unit testing.
|
292
|
+
|
293
|
+
@param {Number} storeKey the store key
|
294
|
+
@returns {Number} edit status
|
295
|
+
*/
|
296
|
+
storeKeyEditState: function(storeKey) {
|
297
|
+
var editables = this.editables, locks = this.locks;
|
298
|
+
return (editables && editables[storeKey]) ? SC.Store.EDITABLE : SC.Store.LOCKED ;
|
299
|
+
},
|
300
|
+
|
301
|
+
/**
|
302
|
+
Returns the data hash for the given `storeKey`. This will also 'lock'
|
303
|
+
the hash so that further edits to the parent store will no
|
304
|
+
longer be reflected in this store until you reset.
|
305
|
+
|
306
|
+
@param {Number} storeKey key to retrieve
|
307
|
+
@returns {Hash} data hash or null
|
308
|
+
*/
|
309
|
+
readDataHash: function(storeKey) {
|
310
|
+
return this.dataHashes[storeKey];
|
311
|
+
},
|
312
|
+
|
313
|
+
/**
|
314
|
+
Returns the data hash for the `storeKey`, cloned so that you can edit
|
315
|
+
the contents of the attributes if you like. This will do the extra work
|
316
|
+
to make sure that you only clone the attributes one time.
|
317
|
+
|
318
|
+
If you use this method to modify data hash, be sure to call
|
319
|
+
`dataHashDidChange()` when you make edits to record the change.
|
320
|
+
|
321
|
+
@param {Number} storeKey the store key to retrieve
|
322
|
+
@returns {Hash} the attributes hash
|
323
|
+
*/
|
324
|
+
readEditableDataHash: function(storeKey) {
|
325
|
+
// read the value - if there is no hash just return; nothing to do
|
326
|
+
var ret = this.dataHashes[storeKey];
|
327
|
+
if (!ret) return ret ; // nothing to do.
|
328
|
+
|
329
|
+
// clone data hash if not editable
|
330
|
+
var editables = this.editables;
|
331
|
+
if (!editables) editables = this.editables = [];
|
332
|
+
if (!editables[storeKey]) {
|
333
|
+
editables[storeKey] = 1 ; // use number to store as dense array
|
334
|
+
ret = this.dataHashes[storeKey] = SC.clone(ret, YES);
|
335
|
+
}
|
336
|
+
return ret;
|
337
|
+
},
|
338
|
+
|
339
|
+
/**
|
340
|
+
Reads a property from the hash - cloning it if needed so you can modify
|
341
|
+
it independently of any parent store. This method is really only well
|
342
|
+
tested for use with toMany relationships. Although it is public you
|
343
|
+
generally should not call it directly.
|
344
|
+
|
345
|
+
@param {Number} storeKey storeKey of data hash
|
346
|
+
@param {String} propertyName property to read
|
347
|
+
@returns {Object} editable property value
|
348
|
+
*/
|
349
|
+
readEditableProperty: function(storeKey, propertyName) {
|
350
|
+
var hash = this.readEditableDataHash(storeKey),
|
351
|
+
editables = this.editables[storeKey], // get editable info...
|
352
|
+
ret = hash[propertyName];
|
353
|
+
|
354
|
+
// editables must be made into a hash so that we can keep track of which
|
355
|
+
// properties have already been made editable
|
356
|
+
if (editables === 1) editables = this.editables[storeKey] = {};
|
357
|
+
|
358
|
+
// clone if needed
|
359
|
+
if (!editables[propertyName]) {
|
360
|
+
ret = hash[propertyName];
|
361
|
+
if (ret && ret.isCopyable) ret = hash[propertyName] = ret.copy(YES);
|
362
|
+
editables[propertyName] = YES ;
|
363
|
+
}
|
364
|
+
|
365
|
+
return ret ;
|
366
|
+
},
|
367
|
+
|
368
|
+
/**
|
369
|
+
Replaces the data hash for the `storeKey`. This will lock the data hash
|
370
|
+
and mark them as cloned. This will also call `dataHashDidChange()` for
|
371
|
+
you.
|
372
|
+
|
373
|
+
Note that the hash you set here must be a different object from the
|
374
|
+
original data hash. Once you make a change here, you must also call
|
375
|
+
`dataHashDidChange()` to register the changes.
|
376
|
+
|
377
|
+
If the data hash does not yet exist in the store, this method will add it.
|
378
|
+
Pass the optional status to edit the status as well.
|
379
|
+
|
380
|
+
@param {Number} storeKey the store key to write
|
381
|
+
@param {Hash} hash the new hash
|
382
|
+
@param {String} status the new hash status
|
383
|
+
@returns {SC.Store} receiver
|
384
|
+
*/
|
385
|
+
writeDataHash: function(storeKey, hash, status) {
|
386
|
+
|
387
|
+
// update dataHashes and optionally status.
|
388
|
+
if (hash) this.dataHashes[storeKey] = hash;
|
389
|
+
if (status) this.statuses[storeKey] = status ;
|
390
|
+
|
391
|
+
// also note that this hash is now editable
|
392
|
+
var editables = this.editables;
|
393
|
+
if (!editables) editables = this.editables = [];
|
394
|
+
editables[storeKey] = 1 ; // use number for dense array support
|
395
|
+
|
396
|
+
var that = this;
|
397
|
+
this._propagateToChildren(storeKey, function(storeKey){
|
398
|
+
that.writeDataHash(storeKey, null, status);
|
399
|
+
});
|
400
|
+
|
401
|
+
return this ;
|
402
|
+
},
|
403
|
+
|
404
|
+
/**
|
405
|
+
Removes the data hash from the store. This does not imply a deletion of
|
406
|
+
the record. You could be simply unloading the record. Either way,
|
407
|
+
removing the dataHash will be synced back to the parent store but not to
|
408
|
+
the server.
|
409
|
+
|
410
|
+
Note that you can optionally pass a new status to go along with this. If
|
411
|
+
you do not pass a status, it will change the status to `SC.RECORD_EMPTY`
|
412
|
+
(assuming you just unloaded the record). If you are deleting the record
|
413
|
+
you may set it to `SC.Record.DESTROYED_CLEAN`.
|
414
|
+
|
415
|
+
Be sure to also call `dataHashDidChange()` to register this change.
|
416
|
+
|
417
|
+
@param {Number} storeKey
|
418
|
+
@param {String} status optional new status
|
419
|
+
@returns {SC.Store} reciever
|
420
|
+
*/
|
421
|
+
removeDataHash: function(storeKey, status) {
|
422
|
+
// don't use delete -- that will allow parent dataHash to come through
|
423
|
+
this.dataHashes[storeKey] = null;
|
424
|
+
this.statuses[storeKey] = status || SC.Record.EMPTY;
|
425
|
+
|
426
|
+
// hash is gone and therefore no longer editable
|
427
|
+
var editables = this.editables;
|
428
|
+
if (editables) editables[storeKey] = 0 ;
|
429
|
+
|
430
|
+
return this ;
|
431
|
+
},
|
432
|
+
|
433
|
+
/**
|
434
|
+
Reads the current status for a storeKey. This will also lock the data
|
435
|
+
hash. If no status is found, returns `SC.RECORD_EMPTY`.
|
436
|
+
|
437
|
+
@param {Number} storeKey the store key
|
438
|
+
@returns {Number} status
|
439
|
+
*/
|
440
|
+
readStatus: function(storeKey) {
|
441
|
+
// use readDataHash to handle optimistic locking. this could be inlined
|
442
|
+
// but for now this minimized copy-and-paste code.
|
443
|
+
this.readDataHash(storeKey);
|
444
|
+
return this.statuses[storeKey] || SC.Record.EMPTY;
|
445
|
+
},
|
446
|
+
|
447
|
+
/**
|
448
|
+
Reads the current status for the storeKey without actually locking the
|
449
|
+
record. Usually you won't need to use this method. It is mostly used
|
450
|
+
internally.
|
451
|
+
|
452
|
+
@param {Number} storeKey the store key
|
453
|
+
@returns {Number} status
|
454
|
+
*/
|
455
|
+
peekStatus: function(storeKey) {
|
456
|
+
return this.statuses[storeKey] || SC.Record.EMPTY;
|
457
|
+
},
|
458
|
+
|
459
|
+
/**
|
460
|
+
Writes the current status for a storeKey. If the new status is
|
461
|
+
`SC.Record.ERROR`, you may also pass an optional error object. Otherwise
|
462
|
+
this param is ignored.
|
463
|
+
|
464
|
+
@param {Number} storeKey the store key
|
465
|
+
@param {String} newStatus the new status
|
466
|
+
@param {SC.Error} error optional error object
|
467
|
+
@returns {SC.Store} receiver
|
468
|
+
*/
|
469
|
+
writeStatus: function(storeKey, newStatus) {
|
470
|
+
// use writeDataHash for now to handle optimistic lock. maximize code
|
471
|
+
// reuse.
|
472
|
+
return this.writeDataHash(storeKey, null, newStatus);
|
473
|
+
},
|
474
|
+
|
475
|
+
/**
|
476
|
+
Call this method whenever you modify some editable data hash to register
|
477
|
+
with the Store that the attribute values have actually changed. This will
|
478
|
+
do the book-keeping necessary to track the change across stores including
|
479
|
+
managing locks.
|
480
|
+
|
481
|
+
@param {Number|Array} storeKeys one or more store keys that changed
|
482
|
+
@param {Number} rev optional new revision number. normally leave null
|
483
|
+
@param {Boolean} statusOnly (optional) YES if only status changed
|
484
|
+
@param {String} key that changed (optional)
|
485
|
+
@returns {SC.Store} receiver
|
486
|
+
*/
|
487
|
+
dataHashDidChange: function(storeKeys, rev, statusOnly, key) {
|
488
|
+
|
489
|
+
// update the revision for storeKey. Use generateStoreKey() because that
|
490
|
+
// gaurantees a universally (to this store hierarchy anyway) unique
|
491
|
+
// key value.
|
492
|
+
if (!rev) rev = SC.Store.generateStoreKey();
|
493
|
+
var isArray, len, idx, storeKey;
|
494
|
+
|
495
|
+
isArray = SC.typeOf(storeKeys) === SC.T_ARRAY;
|
496
|
+
if (isArray) {
|
497
|
+
len = storeKeys.length;
|
498
|
+
} else {
|
499
|
+
len = 1;
|
500
|
+
storeKey = storeKeys;
|
501
|
+
}
|
502
|
+
|
503
|
+
var that = this;
|
504
|
+
for(idx=0;idx<len;idx++) {
|
505
|
+
if (isArray) storeKey = storeKeys[idx];
|
506
|
+
this.revisions[storeKey] = rev;
|
507
|
+
this._notifyRecordPropertyChange(storeKey, statusOnly, key);
|
508
|
+
|
509
|
+
this._propagateToChildren(storeKey, function(storeKey){
|
510
|
+
that.dataHashDidChange(storeKey, null, statusOnly, key);
|
511
|
+
});
|
512
|
+
}
|
513
|
+
|
514
|
+
return this ;
|
515
|
+
},
|
516
|
+
|
517
|
+
/** @private
|
518
|
+
Will push all changes to a the recordPropertyChanges property
|
519
|
+
and execute `flush()` once at the end of the runloop.
|
520
|
+
*/
|
521
|
+
_notifyRecordPropertyChange: function(storeKey, statusOnly, key) {
|
522
|
+
|
523
|
+
var records = this.records,
|
524
|
+
nestedStores = this.get('nestedStores'),
|
525
|
+
K = SC.Store,
|
526
|
+
rec, editState, len, idx, store, status, keys;
|
527
|
+
|
528
|
+
// pass along to nested stores
|
529
|
+
len = nestedStores ? nestedStores.length : 0 ;
|
530
|
+
for(idx=0;idx<len;idx++) {
|
531
|
+
store = nestedStores[idx];
|
532
|
+
status = store.peekStatus(storeKey); // important: peek avoids read-lock
|
533
|
+
editState = store.storeKeyEditState(storeKey);
|
534
|
+
|
535
|
+
// when store needs to propagate out changes in the parent store
|
536
|
+
// to nested stores
|
537
|
+
if (editState === K.INHERITED) {
|
538
|
+
store._notifyRecordPropertyChange(storeKey, statusOnly, key);
|
539
|
+
|
540
|
+
} else if (status & SC.Record.BUSY) {
|
541
|
+
// make sure nested store does not have any changes before resetting
|
542
|
+
if(store.get('hasChanges')) throw K.CHAIN_CONFLICT_ERROR;
|
543
|
+
store.reset();
|
544
|
+
}
|
545
|
+
}
|
546
|
+
|
547
|
+
// store info in changes hash and schedule notification if needed.
|
548
|
+
var changes = this.recordPropertyChanges;
|
549
|
+
if (!changes) {
|
550
|
+
changes = this.recordPropertyChanges =
|
551
|
+
{ storeKeys: SC.CoreSet.create(),
|
552
|
+
records: SC.CoreSet.create(),
|
553
|
+
hasDataChanges: SC.CoreSet.create(),
|
554
|
+
propertyForStoreKeys: {} };
|
555
|
+
}
|
556
|
+
|
557
|
+
changes.storeKeys.add(storeKey);
|
558
|
+
|
559
|
+
if (records && (rec=records[storeKey])) {
|
560
|
+
changes.records.push(storeKey);
|
561
|
+
|
562
|
+
// If there are changes other than just the status we need to record
|
563
|
+
// that information so we do the right thing during the next flush.
|
564
|
+
// Note that if we're called multiple times before flush and one call
|
565
|
+
// has `statusOnly=true` and another has `statusOnly=false`, the flush
|
566
|
+
// will (correctly) operate in `statusOnly=false` mode.
|
567
|
+
if (!statusOnly) changes.hasDataChanges.push(storeKey);
|
568
|
+
|
569
|
+
// If this is a key specific change, make sure that only those
|
570
|
+
// properties/keys are notified. However, if a previous invocation of
|
571
|
+
// `_notifyRecordPropertyChange` specified that all keys have changed, we
|
572
|
+
// need to respect that.
|
573
|
+
if (key) {
|
574
|
+
if (!(keys = changes.propertyForStoreKeys[storeKey])) {
|
575
|
+
keys = changes.propertyForStoreKeys[storeKey] = SC.CoreSet.create();
|
576
|
+
}
|
577
|
+
|
578
|
+
// If it's '*' instead of a set, then that means there was a previous
|
579
|
+
// invocation that said all keys have changed.
|
580
|
+
if (keys !== '*') {
|
581
|
+
keys.add(key);
|
582
|
+
}
|
583
|
+
}
|
584
|
+
else {
|
585
|
+
// Mark that all properties have changed.
|
586
|
+
changes.propertyForStoreKeys[storeKey] = '*';
|
587
|
+
}
|
588
|
+
}
|
589
|
+
|
590
|
+
this.invokeOnce(this.flush);
|
591
|
+
return this;
|
592
|
+
},
|
593
|
+
|
594
|
+
/**
|
595
|
+
Delivers any pending changes to materialized records. Normally this
|
596
|
+
happens once, automatically, at the end of the RunLoop. If you have
|
597
|
+
updated some records and need to update records immediately, however,
|
598
|
+
you may call this manually.
|
599
|
+
|
600
|
+
@returns {SC.Store} receiver
|
601
|
+
*/
|
602
|
+
flush: function() {
|
603
|
+
if (!this.recordPropertyChanges) return this;
|
604
|
+
|
605
|
+
var changes = this.recordPropertyChanges,
|
606
|
+
storeKeys = changes.storeKeys,
|
607
|
+
hasDataChanges = changes.hasDataChanges,
|
608
|
+
records = changes.records,
|
609
|
+
propertyForStoreKeys = changes.propertyForStoreKeys,
|
610
|
+
recordTypes = SC.CoreSet.create(),
|
611
|
+
rec, recordType, statusOnly, idx, len, storeKey, keys;
|
612
|
+
|
613
|
+
storeKeys.forEach(function(storeKey) {
|
614
|
+
if (records.contains(storeKey)) {
|
615
|
+
statusOnly = hasDataChanges.contains(storeKey) ? NO : YES;
|
616
|
+
rec = this.records[storeKey];
|
617
|
+
keys = propertyForStoreKeys ? propertyForStoreKeys[storeKey] : null;
|
618
|
+
|
619
|
+
// Are we invalidating all keys? If so, don't pass any to
|
620
|
+
// storeDidChangeProperties.
|
621
|
+
if (keys === '*') keys = null;
|
622
|
+
|
623
|
+
// remove it so we don't trigger this twice
|
624
|
+
records.remove(storeKey);
|
625
|
+
|
626
|
+
if (rec) rec.storeDidChangeProperties(statusOnly, keys);
|
627
|
+
}
|
628
|
+
|
629
|
+
recordType = SC.Store.recordTypeFor(storeKey);
|
630
|
+
recordTypes.add(recordType);
|
631
|
+
|
632
|
+
}, this);
|
633
|
+
|
634
|
+
if (storeKeys.get('length') > 0) this._notifyRecordArrays(storeKeys, recordTypes);
|
635
|
+
|
636
|
+
storeKeys.clear();
|
637
|
+
hasDataChanges.clear();
|
638
|
+
records.clear();
|
639
|
+
// Provide full reference to overwrite
|
640
|
+
this.recordPropertyChanges.propertyForStoreKeys = {};
|
641
|
+
|
642
|
+
return this;
|
643
|
+
},
|
644
|
+
|
645
|
+
/**
|
646
|
+
Resets the store content. This will clear all internal data for all
|
647
|
+
records, resetting them to an EMPTY state. You generally do not want
|
648
|
+
to call this method yourself, though you may override it.
|
649
|
+
|
650
|
+
@returns {SC.Store} receiver
|
651
|
+
*/
|
652
|
+
reset: function() {
|
653
|
+
|
654
|
+
// create a new empty data store
|
655
|
+
this.dataHashes = {} ;
|
656
|
+
this.revisions = {} ;
|
657
|
+
this.statuses = {} ;
|
658
|
+
|
659
|
+
// also reset temporary objects and errors
|
660
|
+
this.chainedChanges = this.locks = this.editables = null;
|
661
|
+
this.changelog = null ;
|
662
|
+
this.recordErrors = null;
|
663
|
+
this.queryErrors = null;
|
664
|
+
|
665
|
+
var records = this.records, storeKey;
|
666
|
+
if (records) {
|
667
|
+
for(storeKey in records) {
|
668
|
+
if (!records.hasOwnProperty(storeKey)) continue ;
|
669
|
+
this._notifyRecordPropertyChange(parseInt(storeKey, 10), NO);
|
670
|
+
}
|
671
|
+
}
|
672
|
+
|
673
|
+
this.set('hasChanges', NO);
|
674
|
+
},
|
675
|
+
|
676
|
+
/** @private
|
677
|
+
Called by a nested store on a parent store to commit any changes from the
|
678
|
+
store. This will copy any changed dataHashes as well as any persistant
|
679
|
+
change logs.
|
680
|
+
|
681
|
+
If the parentStore detects a conflict with the optimistic locking, it will
|
682
|
+
raise an exception before it makes any changes. If you pass the
|
683
|
+
force flag then this detection phase will be skipped and the changes will
|
684
|
+
be applied even if another resource has modified the store in the mean
|
685
|
+
time.
|
686
|
+
|
687
|
+
@param {SC.Store} nestedStore the child store
|
688
|
+
@param {SC.Set} changes the set of changed store keys
|
689
|
+
@param {Boolean} force
|
690
|
+
@returns {SC.Store} receiver
|
691
|
+
*/
|
692
|
+
commitChangesFromNestedStore: function(nestedStore, changes, force) {
|
693
|
+
// first, check for optimistic locking problems
|
694
|
+
if (!force) this._verifyLockRevisions(changes, nestedStore.locks);
|
695
|
+
|
696
|
+
// OK, no locking issues. So let's just copy them changes.
|
697
|
+
// get local reference to values.
|
698
|
+
var len = changes.length, i, storeKey, myDataHashes, myStatuses,
|
699
|
+
myEditables, myRevisions, myParentRecords, myChildRecords,
|
700
|
+
chDataHashes, chStatuses, chRevisions, chParentRecords, chChildRecords;
|
701
|
+
|
702
|
+
myRevisions = this.revisions ;
|
703
|
+
myDataHashes = this.dataHashes;
|
704
|
+
myStatuses = this.statuses;
|
705
|
+
myEditables = this.editables ;
|
706
|
+
myParentRecords = this.parentRecords ? this.parentRecords : this.parentRecords ={} ;
|
707
|
+
myChildRecords = this.childRecords ? this.childRecords : this.childRecords = {} ;
|
708
|
+
|
709
|
+
// setup some arrays if needed
|
710
|
+
if (!myEditables) myEditables = this.editables = [] ;
|
711
|
+
chDataHashes = nestedStore.dataHashes;
|
712
|
+
chRevisions = nestedStore.revisions ;
|
713
|
+
chStatuses = nestedStore.statuses;
|
714
|
+
chParentRecords = nestedStore.parentRecords || {};
|
715
|
+
chChildRecords = nestedStore.childRecords || {};
|
716
|
+
|
717
|
+
for(i=0;i<len;i++) {
|
718
|
+
storeKey = changes[i];
|
719
|
+
|
720
|
+
// now copy changes
|
721
|
+
myDataHashes[storeKey] = chDataHashes[storeKey];
|
722
|
+
myStatuses[storeKey] = chStatuses[storeKey];
|
723
|
+
myRevisions[storeKey] = chRevisions[storeKey];
|
724
|
+
myParentRecords[storeKey] = chParentRecords[storeKey];
|
725
|
+
myChildRecords[storeKey] = chChildRecords[storeKey];
|
726
|
+
|
727
|
+
myEditables[storeKey] = 0 ; // always make dataHash no longer editable
|
728
|
+
|
729
|
+
this._notifyRecordPropertyChange(storeKey, NO);
|
730
|
+
}
|
731
|
+
|
732
|
+
// add any records to the changelog for commit handling
|
733
|
+
var myChangelog = this.changelog, chChangelog = nestedStore.changelog;
|
734
|
+
if (chChangelog) {
|
735
|
+
if (!myChangelog) myChangelog = this.changelog = SC.CoreSet.create();
|
736
|
+
myChangelog.addEach(chChangelog);
|
737
|
+
}
|
738
|
+
this.changelog = myChangelog;
|
739
|
+
|
740
|
+
// immediately flush changes to notify records - nested stores will flush
|
741
|
+
// later on.
|
742
|
+
if (!this.get('parentStore')) this.flush();
|
743
|
+
|
744
|
+
return this ;
|
745
|
+
},
|
746
|
+
|
747
|
+
/** @private
|
748
|
+
Verifies that the passed lock revisions match the current revisions
|
749
|
+
in the receiver store. If the lock revisions do not match, then the
|
750
|
+
store is in a conflict and an exception will be raised.
|
751
|
+
|
752
|
+
@param {Array} changes set of changes we are trying to apply
|
753
|
+
@param {SC.Set} locks the locks to verify
|
754
|
+
@returns {SC.Store} receiver
|
755
|
+
*/
|
756
|
+
_verifyLockRevisions: function(changes, locks) {
|
757
|
+
var len = changes.length, revs = this.revisions, i, storeKey, lock, rev ;
|
758
|
+
if (locks && revs) {
|
759
|
+
for(i=0;i<len;i++) {
|
760
|
+
storeKey = changes[i];
|
761
|
+
lock = locks[storeKey] || 1;
|
762
|
+
rev = revs[storeKey] || 1;
|
763
|
+
|
764
|
+
// if the save revision for the item does not match the current rev
|
765
|
+
// the someone has changed the data hash in this store and we have
|
766
|
+
// a conflict.
|
767
|
+
if (lock < rev) throw SC.Store.CHAIN_CONFLICT_ERROR;
|
768
|
+
}
|
769
|
+
}
|
770
|
+
return this ;
|
771
|
+
},
|
772
|
+
|
773
|
+
// ..........................................................
|
774
|
+
// HIGH-LEVEL RECORD API
|
775
|
+
//
|
776
|
+
|
777
|
+
/**
|
778
|
+
Finds a single record instance with the specified `recordType` and id or
|
779
|
+
an array of records matching some query conditions.
|
780
|
+
|
781
|
+
Finding a Single Record
|
782
|
+
---
|
783
|
+
|
784
|
+
If you pass a single `recordType` and id, this method will return an
|
785
|
+
actual record instance. If the record has not been loaded into the store
|
786
|
+
yet, this method will ask the data source to retrieve it. If no data
|
787
|
+
source indicates that it can retrieve the record, then this method will
|
788
|
+
return `null`.
|
789
|
+
|
790
|
+
Note that if the record needs to be retrieved from the server, then the
|
791
|
+
record instance returned from this method will not have any data yet.
|
792
|
+
Instead it will have a status of `SC.Record.READY_LOADING`. You can
|
793
|
+
monitor the status property to be notified when the record data is
|
794
|
+
available for you to use it.
|
795
|
+
|
796
|
+
Find a Collection of Records
|
797
|
+
---
|
798
|
+
|
799
|
+
If you pass only a record type or a query object, you can instead find
|
800
|
+
all records matching a specified set of conditions. When you call
|
801
|
+
`find()` in this way, it will create a query if needed and pass it to the
|
802
|
+
data source to fetch the results.
|
803
|
+
|
804
|
+
If this is the first time you have fetched the query, then the store will
|
805
|
+
automatically ask the data source to fetch any records related to it as
|
806
|
+
well. Otherwise you can refresh the query results at anytime by calling
|
807
|
+
`refresh()` on the returned `RecordArray`.
|
808
|
+
|
809
|
+
You can detect whether a RecordArray is fetching from the server by
|
810
|
+
checking its status.
|
811
|
+
|
812
|
+
Examples
|
813
|
+
---
|
814
|
+
|
815
|
+
Finding a single record:
|
816
|
+
|
817
|
+
MyApp.store.find(MyApp.Contact, "23"); // returns MyApp.Contact
|
818
|
+
|
819
|
+
Finding all records of a particular type:
|
820
|
+
|
821
|
+
MyApp.store.find(MyApp.Contact); // returns SC.RecordArray of contacts
|
822
|
+
|
823
|
+
|
824
|
+
Finding all contacts with first name John:
|
825
|
+
|
826
|
+
var query = SC.Query.local(MyApp.Contact, "firstName = %@", "John");
|
827
|
+
MyApp.store.find(query); // returns SC.RecordArray of contacts
|
828
|
+
|
829
|
+
Finding all contacts using a remote query:
|
830
|
+
|
831
|
+
var query = SC.Query.remote(MyApp.Contact);
|
832
|
+
MyApp.store.find(query); // returns SC.RecordArray filled by server
|
833
|
+
|
834
|
+
@param {SC.Record|String} recordType the expected record type
|
835
|
+
@param {String} id the id to load
|
836
|
+
@returns {SC.Record} record instance or null
|
837
|
+
*/
|
838
|
+
find: function(recordType, id) {
|
839
|
+
|
840
|
+
// if recordType is passed as string, find object
|
841
|
+
if (SC.typeOf(recordType)===SC.T_STRING) {
|
842
|
+
recordType = SC.objectForPropertyPath(recordType);
|
843
|
+
}
|
844
|
+
|
845
|
+
// handle passing a query...
|
846
|
+
if ((arguments.length === 1) && !(recordType && recordType.get && recordType.get('isRecord'))) {
|
847
|
+
if (!recordType) throw new Error("SC.Store#find() must pass recordType or query");
|
848
|
+
if (!recordType.isQuery) {
|
849
|
+
recordType = SC.Query.local(recordType);
|
850
|
+
}
|
851
|
+
return this._findQuery(recordType, YES, YES);
|
852
|
+
|
853
|
+
// handle finding a single record
|
854
|
+
} else {
|
855
|
+
return this._findRecord(recordType, id);
|
856
|
+
}
|
857
|
+
},
|
858
|
+
|
859
|
+
/** @private
|
860
|
+
DEPRECATED used find() instead.
|
861
|
+
|
862
|
+
This method will accept a record type or query and return a record array
|
863
|
+
matching the results. This method was commonly used prior to SproutCore
|
864
|
+
1.0. It has been deprecated in favor of a single `find()` method instead.
|
865
|
+
|
866
|
+
For compatibility, this method will continue to work in SproutCore 1.0 but
|
867
|
+
it will raise a warning. It will be removed in a future version of
|
868
|
+
SproutCore.
|
869
|
+
*/
|
870
|
+
findAll: function(recordType, conditions, params) {
|
871
|
+
SC.Logger.warn("SC.Store#findAll() will be removed in a future version of SproutCore. Use SC.Store#find() instead");
|
872
|
+
|
873
|
+
|
874
|
+
if (!recordType || !recordType.isQuery) {
|
875
|
+
recordType = SC.Query.local(recordType, conditions, params);
|
876
|
+
}
|
877
|
+
|
878
|
+
return this._findQuery(recordType, YES, YES);
|
879
|
+
},
|
880
|
+
|
881
|
+
|
882
|
+
_findQuery: function(query, createIfNeeded, refreshIfNew) {
|
883
|
+
|
884
|
+
// lookup the local RecordArray for this query.
|
885
|
+
var cache = this._scst_recordArraysByQuery,
|
886
|
+
key = SC.guidFor(query),
|
887
|
+
ret, ra ;
|
888
|
+
if (!cache) cache = this._scst_recordArraysByQuery = {};
|
889
|
+
ret = cache[key];
|
890
|
+
|
891
|
+
// if a RecordArray was not found, then create one and also add it to the
|
892
|
+
// list of record arrays to update.
|
893
|
+
if (!ret && createIfNeeded) {
|
894
|
+
cache[key] = ret = SC.RecordArray.create({ store: this, query: query });
|
895
|
+
|
896
|
+
ra = this.get('recordArrays');
|
897
|
+
if (!ra) this.set('recordArrays', ra = SC.Set.create());
|
898
|
+
ra.add(ret);
|
899
|
+
|
900
|
+
if (refreshIfNew) this.refreshQuery(query);
|
901
|
+
}
|
902
|
+
|
903
|
+
this.flush();
|
904
|
+
return ret ;
|
905
|
+
},
|
906
|
+
|
907
|
+
_findRecord: function(recordType, id) {
|
908
|
+
|
909
|
+
var storeKey ;
|
910
|
+
|
911
|
+
// if a record instance is passed, simply use the storeKey. This allows
|
912
|
+
// you to pass a record from a chained store to get the same record in the
|
913
|
+
// current store.
|
914
|
+
if (recordType && recordType.get && recordType.get('isRecord')) {
|
915
|
+
storeKey = recordType.get('storeKey');
|
916
|
+
|
917
|
+
// otherwise, lookup the storeKey for the passed id. look in subclasses
|
918
|
+
// as well.
|
919
|
+
} else storeKey = id ? recordType.storeKeyFor(id) : null;
|
920
|
+
|
921
|
+
if (storeKey && (this.readStatus(storeKey) === SC.Record.EMPTY)) {
|
922
|
+
storeKey = this.retrieveRecord(recordType, id);
|
923
|
+
}
|
924
|
+
|
925
|
+
// now we have the storeKey, materialize the record and return it.
|
926
|
+
return storeKey ? this.materializeRecord(storeKey) : null ;
|
927
|
+
},
|
928
|
+
|
929
|
+
// ..........................................................
|
930
|
+
// RECORD ARRAY OPERATIONS
|
931
|
+
//
|
932
|
+
|
933
|
+
/**
|
934
|
+
Called by the record array just before it is destroyed. This will
|
935
|
+
de-register it from receiving future notifications.
|
936
|
+
|
937
|
+
You should never call this method yourself. Instead call `destroy()` on
|
938
|
+
the `RecordArray` directly.
|
939
|
+
|
940
|
+
@param {SC.RecordArray} recordArray the record array
|
941
|
+
@returns {SC.Store} receiver
|
942
|
+
*/
|
943
|
+
recordArrayWillDestroy: function(recordArray) {
|
944
|
+
var cache = this._scst_recordArraysByQuery,
|
945
|
+
set = this.get('recordArrays');
|
946
|
+
|
947
|
+
if (cache) delete cache[SC.guidFor(recordArray.get('query'))];
|
948
|
+
if (set) set.remove(recordArray);
|
949
|
+
return this ;
|
950
|
+
},
|
951
|
+
|
952
|
+
/**
|
953
|
+
Called by the record array whenever it needs the data source to refresh
|
954
|
+
its contents. Nested stores will actually just pass this along to the
|
955
|
+
parent store. The parent store will call `fetch()` on the data source.
|
956
|
+
|
957
|
+
You should never call this method yourself. Instead call `refresh()` on
|
958
|
+
the `RecordArray` directly.
|
959
|
+
|
960
|
+
@param {SC.Query} query the record array query to refresh
|
961
|
+
@returns {SC.Store} receiver
|
962
|
+
*/
|
963
|
+
refreshQuery: function(query) {
|
964
|
+
if (!query) throw new Error("refreshQuery() requires a query");
|
965
|
+
|
966
|
+
var cache = this._scst_recordArraysByQuery,
|
967
|
+
recArray = cache ? cache[SC.guidFor(query)] : null,
|
968
|
+
source = this._getDataSource();
|
969
|
+
|
970
|
+
if (source && source.fetch) {
|
971
|
+
if (recArray) recArray.storeWillFetchQuery(query);
|
972
|
+
source.fetch.call(source, this, query);
|
973
|
+
}
|
974
|
+
|
975
|
+
return this ;
|
976
|
+
},
|
977
|
+
|
978
|
+
/** @private
|
979
|
+
Will ask all record arrays that have been returned from `findAll`
|
980
|
+
with an `SC.Query` to check their arrays with the new `storeKey`s
|
981
|
+
|
982
|
+
@param {SC.IndexSet} storeKeys set of storeKeys that changed
|
983
|
+
@param {SC.Set} recordTypes
|
984
|
+
@returns {SC.Store} receiver
|
985
|
+
*/
|
986
|
+
_notifyRecordArrays: function(storeKeys, recordTypes) {
|
987
|
+
var recordArrays = this.get('recordArrays');
|
988
|
+
if (!recordArrays) return this;
|
989
|
+
|
990
|
+
recordArrays.forEach(function(recArray) {
|
991
|
+
if (recArray) recArray.storeDidChangeStoreKeys(storeKeys, recordTypes);
|
992
|
+
}, this);
|
993
|
+
|
994
|
+
return this ;
|
995
|
+
},
|
996
|
+
|
997
|
+
|
998
|
+
// ..........................................................
|
999
|
+
// LOW-LEVEL HELPERS
|
1000
|
+
//
|
1001
|
+
|
1002
|
+
/**
|
1003
|
+
Array of all records currently in the store with the specified
|
1004
|
+
type. This method only reflects the actual records loaded into memory and
|
1005
|
+
therefore is not usually needed at runtime. However you will often use
|
1006
|
+
this method for testing.
|
1007
|
+
|
1008
|
+
@param {SC.Record} recordType the record type
|
1009
|
+
@returns {SC.Array} array instance - usually SC.RecordArray
|
1010
|
+
*/
|
1011
|
+
recordsFor: function(recordType) {
|
1012
|
+
var storeKeys = [],
|
1013
|
+
storeKeysById = recordType.storeKeysById(),
|
1014
|
+
id, storeKey, ret;
|
1015
|
+
|
1016
|
+
// collect all non-empty store keys
|
1017
|
+
for(id in storeKeysById) {
|
1018
|
+
storeKey = storeKeysById[id]; // get the storeKey
|
1019
|
+
if (this.readStatus(storeKey) !== SC.RECORD_EMPTY) {
|
1020
|
+
storeKeys.push(storeKey);
|
1021
|
+
}
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
if (storeKeys.length>0) {
|
1025
|
+
ret = SC.RecordArray.create({ store: this, storeKeys: storeKeys });
|
1026
|
+
} else ret = storeKeys; // empty array
|
1027
|
+
return ret ;
|
1028
|
+
},
|
1029
|
+
|
1030
|
+
_TMP_REC_ATTRS: {},
|
1031
|
+
|
1032
|
+
/**
|
1033
|
+
Given a `storeKey`, return a materialized record. You will not usually
|
1034
|
+
call this method yourself. Instead it will used by other methods when
|
1035
|
+
you find records by id or perform other searches.
|
1036
|
+
|
1037
|
+
If a `recordType` has been mapped to the storeKey, then a record instance
|
1038
|
+
will be returned even if the data hash has not been requested yet.
|
1039
|
+
|
1040
|
+
Each Store instance returns unique record instances for each storeKey.
|
1041
|
+
|
1042
|
+
@param {Number} storeKey The storeKey for the dataHash.
|
1043
|
+
@returns {SC.Record} Returns a record instance.
|
1044
|
+
*/
|
1045
|
+
materializeRecord: function(storeKey) {
|
1046
|
+
var records = this.records, ret, recordType, attrs;
|
1047
|
+
|
1048
|
+
// look up in cached records
|
1049
|
+
if (!records) records = this.records = {}; // load cached records
|
1050
|
+
ret = records[storeKey];
|
1051
|
+
if (ret) return ret;
|
1052
|
+
|
1053
|
+
// not found -- OK, create one then.
|
1054
|
+
recordType = SC.Store.recordTypeFor(storeKey);
|
1055
|
+
if (!recordType) return null; // not recordType registered, nothing to do
|
1056
|
+
|
1057
|
+
attrs = this._TMP_REC_ATTRS ;
|
1058
|
+
attrs.storeKey = storeKey ;
|
1059
|
+
attrs.store = this ;
|
1060
|
+
ret = records[storeKey] = recordType.create(attrs);
|
1061
|
+
|
1062
|
+
return ret ;
|
1063
|
+
},
|
1064
|
+
|
1065
|
+
// ..........................................................
|
1066
|
+
// CORE RECORDS API
|
1067
|
+
//
|
1068
|
+
// The methods in this section can be used to manipulate records without
|
1069
|
+
// actually creating record instances.
|
1070
|
+
|
1071
|
+
/**
|
1072
|
+
Creates a new record instance with the passed `recordType` and `dataHash`.
|
1073
|
+
You can also optionally specify an id or else it will be pulled from the
|
1074
|
+
data hash.
|
1075
|
+
|
1076
|
+
Note that the record will not yet be saved back to the server. To save
|
1077
|
+
a record to the server, call `commitChanges()` on the store.
|
1078
|
+
|
1079
|
+
@param {SC.Record} recordType the record class to use on creation
|
1080
|
+
@param {Hash} dataHash the JSON attributes to assign to the hash.
|
1081
|
+
@param {String} id (optional) id to assign to record
|
1082
|
+
|
1083
|
+
@returns {SC.Record} Returns the created record
|
1084
|
+
*/
|
1085
|
+
createRecord: function(recordType, dataHash, id) {
|
1086
|
+
var primaryKey, storeKey, status, K = SC.Record, changelog, defaultVal,
|
1087
|
+
ret;
|
1088
|
+
|
1089
|
+
// First, try to get an id. If no id is passed, look it up in the
|
1090
|
+
// dataHash.
|
1091
|
+
if (!id && (primaryKey = recordType.prototype.primaryKey)) {
|
1092
|
+
id = dataHash[primaryKey];
|
1093
|
+
// if still no id, check if there is a defaultValue function for
|
1094
|
+
// the primaryKey attribute and assign that
|
1095
|
+
defaultVal = recordType.prototype[primaryKey] ? recordType.prototype[primaryKey].defaultValue : null;
|
1096
|
+
if(!id && SC.typeOf(defaultVal)===SC.T_FUNCTION) {
|
1097
|
+
id = dataHash[primaryKey] = defaultVal();
|
1098
|
+
}
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
// Next get the storeKey - base on id if available
|
1102
|
+
storeKey = id ? recordType.storeKeyFor(id) : SC.Store.generateStoreKey();
|
1103
|
+
|
1104
|
+
// now, check the state and do the right thing.
|
1105
|
+
status = this.readStatus(storeKey);
|
1106
|
+
|
1107
|
+
// check state
|
1108
|
+
// any busy or ready state or destroyed dirty state is not allowed
|
1109
|
+
if ((status & K.BUSY) ||
|
1110
|
+
(status & K.READY) ||
|
1111
|
+
(status === K.DESTROYED_DIRTY)) {
|
1112
|
+
throw id ? K.RECORD_EXISTS_ERROR : K.BAD_STATE_ERROR;
|
1113
|
+
|
1114
|
+
// allow error or destroyed state only with id
|
1115
|
+
} else if (!id && (status===SC.DESTROYED_CLEAN || status===SC.ERROR)) {
|
1116
|
+
throw K.BAD_STATE_ERROR;
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
// add dataHash and setup initial status -- also save recordType
|
1120
|
+
this.writeDataHash(storeKey, (dataHash ? dataHash : {}), K.READY_NEW);
|
1121
|
+
|
1122
|
+
SC.Store.replaceRecordTypeFor(storeKey, recordType);
|
1123
|
+
this.dataHashDidChange(storeKey);
|
1124
|
+
|
1125
|
+
// Record is now in a committable state -- add storeKey to changelog
|
1126
|
+
changelog = this.changelog;
|
1127
|
+
if (!changelog) changelog = SC.Set.create();
|
1128
|
+
changelog.add(storeKey);
|
1129
|
+
this.changelog = changelog;
|
1130
|
+
|
1131
|
+
// if commit records is enabled
|
1132
|
+
if(this.get('commitRecordsAutomatically')){
|
1133
|
+
this.invokeLast(this.commitRecords);
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
// Finally return materialized record, after we propagate the status to
|
1137
|
+
// any aggregrate records.
|
1138
|
+
ret = this.materializeRecord(storeKey);
|
1139
|
+
if (ret) ret.propagateToAggregates();
|
1140
|
+
return ret;
|
1141
|
+
},
|
1142
|
+
|
1143
|
+
/**
|
1144
|
+
Creates an array of new records. You must pass an array of `dataHash`es
|
1145
|
+
plus a `recordType` and, optionally, an array of ids. This will create an
|
1146
|
+
array of record instances with the same record type.
|
1147
|
+
|
1148
|
+
If you need to instead create a bunch of records with different data types
|
1149
|
+
you can instead pass an array of `recordType`s, one for each data hash.
|
1150
|
+
|
1151
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1152
|
+
@param {Array} dataHashes array of data hashes
|
1153
|
+
@param {Array} ids (optional) ids to assign to records
|
1154
|
+
@returns {Array} array of materialized record instances.
|
1155
|
+
*/
|
1156
|
+
createRecords: function(recordTypes, dataHashes, ids) {
|
1157
|
+
var ret = [], recordType, id, isArray, len = dataHashes.length, idx ;
|
1158
|
+
isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
|
1159
|
+
if (!isArray) recordType = recordTypes;
|
1160
|
+
for(idx=0;idx<len;idx++) {
|
1161
|
+
if (isArray) recordType = recordTypes[idx] || SC.Record;
|
1162
|
+
id = ids ? ids[idx] : undefined ;
|
1163
|
+
ret.push(this.createRecord(recordType, dataHashes[idx], id));
|
1164
|
+
}
|
1165
|
+
return ret ;
|
1166
|
+
},
|
1167
|
+
|
1168
|
+
|
1169
|
+
/**
|
1170
|
+
Unloads a record, removing the data hash from the store. If you try to
|
1171
|
+
unload a record that is already destroyed then this method will have no effect.
|
1172
|
+
If you unload a record that does not exist or an error then an exception
|
1173
|
+
will be raised.
|
1174
|
+
|
1175
|
+
@param {SC.Record} recordType the recordType
|
1176
|
+
@param {String} id the record id
|
1177
|
+
@param {Number} storeKey (optional) if passed, ignores recordType and id
|
1178
|
+
@returns {SC.Store} receiver
|
1179
|
+
*/
|
1180
|
+
unloadRecord: function(recordType, id, storeKey, newStatus) {
|
1181
|
+
if (storeKey === undefined) storeKey = recordType.storeKeyFor(id);
|
1182
|
+
var status = this.readStatus(storeKey), K = SC.Record;
|
1183
|
+
newStatus = newStatus || K.EMPTY;
|
1184
|
+
// handle status - ignore if destroying or destroyed
|
1185
|
+
if ((status === K.BUSY_DESTROYING) || (status & K.DESTROYED)) {
|
1186
|
+
return this; // nothing to do
|
1187
|
+
|
1188
|
+
// error out if empty
|
1189
|
+
} else if (status & K.BUSY) {
|
1190
|
+
throw K.BUSY_ERROR ;
|
1191
|
+
|
1192
|
+
// otherwise, destroy in dirty state
|
1193
|
+
} else status = newStatus ;
|
1194
|
+
|
1195
|
+
// remove the data hash, set new status
|
1196
|
+
this.removeDataHash(storeKey, status);
|
1197
|
+
this.dataHashDidChange(storeKey);
|
1198
|
+
|
1199
|
+
// Handle all the child Records
|
1200
|
+
var that = this;
|
1201
|
+
this._propagateToChildren(storeKey, function(storeKey){
|
1202
|
+
that.unloadRecord(null, null, storeKey, newStatus);
|
1203
|
+
});
|
1204
|
+
|
1205
|
+
return this ;
|
1206
|
+
},
|
1207
|
+
|
1208
|
+
/**
|
1209
|
+
Unloads a group of records. If you have a set of record ids, unloading
|
1210
|
+
them this way can be faster than retrieving each record and unloading
|
1211
|
+
it individually.
|
1212
|
+
|
1213
|
+
You can pass either a single `recordType` or an array of `recordType`s. If
|
1214
|
+
you pass a single `recordType`, then the record type will be used for each
|
1215
|
+
record. If you pass an array, then each id must have a matching record
|
1216
|
+
type in the array.
|
1217
|
+
|
1218
|
+
You can optionally pass an array of `storeKey`s instead of the `recordType`
|
1219
|
+
and ids. In this case the first two parameters will be ignored. This
|
1220
|
+
is usually only used by low-level internal methods. You will not usually
|
1221
|
+
unload records this way.
|
1222
|
+
|
1223
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1224
|
+
@param {Array} ids (optional) ids to unload
|
1225
|
+
@param {Array} storeKeys (optional) store keys to unload
|
1226
|
+
@returns {SC.Store} receiver
|
1227
|
+
*/
|
1228
|
+
unloadRecords: function(recordTypes, ids, storeKeys, newStatus) {
|
1229
|
+
var len, isArray, idx, id, recordType, storeKey;
|
1230
|
+
|
1231
|
+
if (storeKeys === undefined) {
|
1232
|
+
isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
|
1233
|
+
if (!isArray) recordType = recordTypes;
|
1234
|
+
if (ids === undefined) {
|
1235
|
+
len = isArray ? recordTypes.length : 1;
|
1236
|
+
for (idx = 0; idx < len; idx++) {
|
1237
|
+
if (isArray) recordType = recordTypes[idx];
|
1238
|
+
storeKeys = this.storeKeysFor(recordType);
|
1239
|
+
this.unloadRecords(undefined, undefined, storeKeys, newStatus);
|
1240
|
+
}
|
1241
|
+
} else {
|
1242
|
+
len = ids.length;
|
1243
|
+
for (idx = 0; idx < len; idx++) {
|
1244
|
+
if (isArray) recordType = recordTypes[idx] || SC.Record;
|
1245
|
+
id = ids ? ids[idx] : undefined;
|
1246
|
+
this.unloadRecord(recordType, id, undefined, newStatus);
|
1247
|
+
}
|
1248
|
+
}
|
1249
|
+
} else {
|
1250
|
+
len = storeKeys.length;
|
1251
|
+
for (idx = 0; idx < len; idx++) {
|
1252
|
+
storeKey = storeKeys ? storeKeys[idx] : undefined;
|
1253
|
+
this.unloadRecord(undefined, undefined, storeKey, newStatus);
|
1254
|
+
}
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
return this;
|
1258
|
+
},
|
1259
|
+
|
1260
|
+
/**
|
1261
|
+
Destroys a record, removing the data hash from the store and adding the
|
1262
|
+
record to the destroyed changelog. If you try to destroy a record that is
|
1263
|
+
already destroyed then this method will have no effect. If you destroy a
|
1264
|
+
record that does not exist or an error then an exception will be raised.
|
1265
|
+
|
1266
|
+
@param {SC.Record} recordType the recordType
|
1267
|
+
@param {String} id the record id
|
1268
|
+
@param {Number} storeKey (optional) if passed, ignores recordType and id
|
1269
|
+
@returns {SC.Store} receiver
|
1270
|
+
*/
|
1271
|
+
destroyRecord: function(recordType, id, storeKey) {
|
1272
|
+
if (storeKey === undefined) storeKey = recordType.storeKeyFor(id);
|
1273
|
+
var status = this.readStatus(storeKey), changelog, K = SC.Record;
|
1274
|
+
|
1275
|
+
// handle status - ignore if destroying or destroyed
|
1276
|
+
if ((status === K.BUSY_DESTROYING) || (status & K.DESTROYED)) {
|
1277
|
+
return this; // nothing to do
|
1278
|
+
|
1279
|
+
// error out if empty
|
1280
|
+
} else if (status === K.EMPTY) {
|
1281
|
+
throw K.NOT_FOUND_ERROR ;
|
1282
|
+
|
1283
|
+
// error out if busy
|
1284
|
+
} else if (status & K.BUSY) {
|
1285
|
+
throw K.BUSY_ERROR ;
|
1286
|
+
|
1287
|
+
// if new status, destroy but leave in clean state
|
1288
|
+
} else if (status === K.READY_NEW) {
|
1289
|
+
status = K.DESTROYED_CLEAN ;
|
1290
|
+
|
1291
|
+
// otherwise, destroy in dirty state
|
1292
|
+
} else status = K.DESTROYED_DIRTY ;
|
1293
|
+
|
1294
|
+
// remove the data hash, set new status
|
1295
|
+
this.writeStatus(storeKey, status);
|
1296
|
+
this.dataHashDidChange(storeKey);
|
1297
|
+
|
1298
|
+
// add/remove change log
|
1299
|
+
changelog = this.changelog;
|
1300
|
+
if (!changelog) changelog = this.changelog = SC.Set.create();
|
1301
|
+
|
1302
|
+
((status & K.DIRTY) ? changelog.add(storeKey) : changelog.remove(storeKey));
|
1303
|
+
this.changelog=changelog;
|
1304
|
+
|
1305
|
+
// if commit records is enabled
|
1306
|
+
if(this.get('commitRecordsAutomatically')){
|
1307
|
+
this.invokeLast(this.commitRecords);
|
1308
|
+
}
|
1309
|
+
|
1310
|
+
var that = this;
|
1311
|
+
this._propagateToChildren(storeKey, function(storeKey){
|
1312
|
+
that.destroyRecord(null, null, storeKey);
|
1313
|
+
});
|
1314
|
+
|
1315
|
+
return this ;
|
1316
|
+
},
|
1317
|
+
|
1318
|
+
/**
|
1319
|
+
Destroys a group of records. If you have a set of record ids, destroying
|
1320
|
+
them this way can be faster than retrieving each record and destroying
|
1321
|
+
it individually.
|
1322
|
+
|
1323
|
+
You can pass either a single `recordType` or an array of `recordType`s. If
|
1324
|
+
you pass a single `recordType`, then the record type will be used for each
|
1325
|
+
record. If you pass an array, then each id must have a matching record
|
1326
|
+
type in the array.
|
1327
|
+
|
1328
|
+
You can optionally pass an array of `storeKey`s instead of the `recordType`
|
1329
|
+
and ids. In this case the first two parameters will be ignored. This
|
1330
|
+
is usually only used by low-level internal methods. You will not usually
|
1331
|
+
destroy records this way.
|
1332
|
+
|
1333
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1334
|
+
@param {Array} ids ids to destroy
|
1335
|
+
@param {Array} storeKeys (optional) store keys to destroy
|
1336
|
+
@returns {SC.Store} receiver
|
1337
|
+
*/
|
1338
|
+
destroyRecords: function(recordTypes, ids, storeKeys) {
|
1339
|
+
var len, isArray, idx, id, recordType, storeKey;
|
1340
|
+
if(storeKeys===undefined){
|
1341
|
+
len = ids.length;
|
1342
|
+
isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
|
1343
|
+
if (!isArray) recordType = recordTypes;
|
1344
|
+
for(idx=0;idx<len;idx++) {
|
1345
|
+
if (isArray) recordType = recordTypes[idx] || SC.Record;
|
1346
|
+
id = ids ? ids[idx] : undefined ;
|
1347
|
+
this.destroyRecord(recordType, id, undefined);
|
1348
|
+
}
|
1349
|
+
}else{
|
1350
|
+
len = storeKeys.length;
|
1351
|
+
for(idx=0;idx<len;idx++) {
|
1352
|
+
storeKey = storeKeys ? storeKeys[idx] : undefined ;
|
1353
|
+
this.destroyRecord(undefined, undefined, storeKey);
|
1354
|
+
}
|
1355
|
+
}
|
1356
|
+
return this ;
|
1357
|
+
},
|
1358
|
+
|
1359
|
+
/**
|
1360
|
+
register a Child Record to the parent
|
1361
|
+
*/
|
1362
|
+
registerChildToParent: function(parentStoreKey, childStoreKey, path){
|
1363
|
+
var prs, crs, oldPk, oldChildren, pkRef;
|
1364
|
+
// Check the child to see if it has a parent
|
1365
|
+
crs = this.childRecords || {};
|
1366
|
+
prs = this.parentRecords || {};
|
1367
|
+
// first rid of the old parent
|
1368
|
+
oldPk = crs[childStoreKey];
|
1369
|
+
if (oldPk){
|
1370
|
+
oldChildren = prs[oldPk];
|
1371
|
+
delete oldChildren[childStoreKey];
|
1372
|
+
// this.recordDidChange(null, null, oldPk, key);
|
1373
|
+
}
|
1374
|
+
pkRef = prs[parentStoreKey] || {};
|
1375
|
+
pkRef[childStoreKey] = path || YES;
|
1376
|
+
prs[parentStoreKey] = pkRef;
|
1377
|
+
crs[childStoreKey] = parentStoreKey;
|
1378
|
+
// sync the status of the child
|
1379
|
+
this.writeStatus(childStoreKey, this.statuses[parentStoreKey]);
|
1380
|
+
this.childRecords = crs;
|
1381
|
+
this.parentRecords = prs;
|
1382
|
+
},
|
1383
|
+
|
1384
|
+
/**
|
1385
|
+
materialize the parent when passing in a store key for the child
|
1386
|
+
*/
|
1387
|
+
materializeParentRecord: function(childStoreKey){
|
1388
|
+
var pk, crs;
|
1389
|
+
if (SC.none(childStoreKey)) return null;
|
1390
|
+
crs = this.childRecords;
|
1391
|
+
pk = crs ? this.childRecords[childStoreKey] : null ;
|
1392
|
+
if (SC.none(pk)) return null;
|
1393
|
+
|
1394
|
+
return this.materializeRecord(pk);
|
1395
|
+
},
|
1396
|
+
|
1397
|
+
/**
|
1398
|
+
function for retrieving a parent record key
|
1399
|
+
|
1400
|
+
@param {Number} storeKey The store key of the parent
|
1401
|
+
*/
|
1402
|
+
parentStoreKeyExists: function(storeKey){
|
1403
|
+
if (SC.none(storeKey)) return ;
|
1404
|
+
var crs = this.childRecords || {};
|
1405
|
+
return crs[storeKey];
|
1406
|
+
},
|
1407
|
+
|
1408
|
+
/**
|
1409
|
+
function that propagates a function call to all children
|
1410
|
+
*/
|
1411
|
+
_propagateToChildren: function(storeKey, func){
|
1412
|
+
// Handle all the child Records
|
1413
|
+
if ( SC.none(this.parentRecords) ) return;
|
1414
|
+
var children = this.parentRecords[storeKey] || {};
|
1415
|
+
if (SC.none(func)) return;
|
1416
|
+
for (var key in children) {
|
1417
|
+
if (children.hasOwnProperty(key)) func(key);
|
1418
|
+
}
|
1419
|
+
},
|
1420
|
+
|
1421
|
+
/**
|
1422
|
+
Notes that the data for the given record id has changed. The record will
|
1423
|
+
be committed to the server the next time you commit the root store. Only
|
1424
|
+
call this method on a record in a READY state of some type.
|
1425
|
+
|
1426
|
+
@param {SC.Record} recordType the recordType
|
1427
|
+
@param {String} id the record id
|
1428
|
+
@param {Number} storeKey (optional) if passed, ignores recordType and id
|
1429
|
+
@param {String} key that changed (optional)
|
1430
|
+
@param {Boolean} if the change is to statusOnly (optional)
|
1431
|
+
@returns {SC.Store} receiver
|
1432
|
+
*/
|
1433
|
+
recordDidChange: function(recordType, id, storeKey, key, statusOnly) {
|
1434
|
+
if (storeKey === undefined) storeKey = recordType.storeKeyFor(id);
|
1435
|
+
var status = this.readStatus(storeKey), changelog, K = SC.Record;
|
1436
|
+
|
1437
|
+
// BUSY_LOADING, BUSY_CREATING, BUSY_COMMITTING, BUSY_REFRESH_CLEAN
|
1438
|
+
// BUSY_REFRESH_DIRTY, BUSY_DESTROYING
|
1439
|
+
if (status & K.BUSY) {
|
1440
|
+
throw K.BUSY_ERROR ;
|
1441
|
+
|
1442
|
+
// if record is not in ready state, then it is not found.
|
1443
|
+
// ERROR, EMPTY, DESTROYED_CLEAN, DESTROYED_DIRTY
|
1444
|
+
} else if (!(status & K.READY)) {
|
1445
|
+
throw K.NOT_FOUND_ERROR ;
|
1446
|
+
|
1447
|
+
// otherwise, make new status READY_DIRTY unless new.
|
1448
|
+
// K.READY_CLEAN, K.READY_DIRTY, ignore K.READY_NEW
|
1449
|
+
} else {
|
1450
|
+
if (status != K.READY_NEW) this.writeStatus(storeKey, K.READY_DIRTY);
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
// record data hash change
|
1454
|
+
this.dataHashDidChange(storeKey, null, statusOnly, key);
|
1455
|
+
|
1456
|
+
// record in changelog
|
1457
|
+
changelog = this.changelog ;
|
1458
|
+
if (!changelog) changelog = this.changelog = SC.Set.create() ;
|
1459
|
+
changelog.add(storeKey);
|
1460
|
+
this.changelog = changelog;
|
1461
|
+
|
1462
|
+
// if commit records is enabled
|
1463
|
+
if(this.get('commitRecordsAutomatically')){
|
1464
|
+
this.invokeLast(this.commitRecords);
|
1465
|
+
}
|
1466
|
+
|
1467
|
+
return this ;
|
1468
|
+
},
|
1469
|
+
|
1470
|
+
/**
|
1471
|
+
Mark a group of records as dirty. The records will be committed to the
|
1472
|
+
server the next time you commit changes on the root store. If you have a
|
1473
|
+
set of record ids, marking them dirty this way can be faster than
|
1474
|
+
retrieving each record and destroying it individually.
|
1475
|
+
|
1476
|
+
You can pass either a single `recordType` or an array of `recordType`s. If
|
1477
|
+
you pass a single `recordType`, then the record type will be used for each
|
1478
|
+
record. If you pass an array, then each id must have a matching record
|
1479
|
+
type in the array.
|
1480
|
+
|
1481
|
+
You can optionally pass an array of `storeKey`s instead of the `recordType`
|
1482
|
+
and ids. In this case the first two parameters will be ignored. This
|
1483
|
+
is usually only used by low-level internal methods.
|
1484
|
+
|
1485
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1486
|
+
@param {Array} ids ids to destroy
|
1487
|
+
@param {Array} storeKeys (optional) store keys to destroy
|
1488
|
+
@returns {SC.Store} receiver
|
1489
|
+
*/
|
1490
|
+
recordsDidChange: function(recordTypes, ids, storeKeys) {
|
1491
|
+
var len, isArray, idx, id, recordType, storeKey;
|
1492
|
+
if(storeKeys===undefined){
|
1493
|
+
len = ids.length;
|
1494
|
+
isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
|
1495
|
+
if (!isArray) recordType = recordTypes;
|
1496
|
+
for(idx=0;idx<len;idx++) {
|
1497
|
+
if (isArray) recordType = recordTypes[idx] || SC.Record;
|
1498
|
+
id = ids ? ids[idx] : undefined ;
|
1499
|
+
storeKey = storeKeys ? storeKeys[idx] : undefined ;
|
1500
|
+
this.recordDidChange(recordType, id, storeKey);
|
1501
|
+
}
|
1502
|
+
}else{
|
1503
|
+
len = storeKeys.length;
|
1504
|
+
for(idx=0;idx<len;idx++) {
|
1505
|
+
storeKey = storeKeys ? storeKeys[idx] : undefined ;
|
1506
|
+
this.recordDidChange(undefined, undefined, storeKey);
|
1507
|
+
}
|
1508
|
+
}
|
1509
|
+
return this ;
|
1510
|
+
},
|
1511
|
+
|
1512
|
+
/**
|
1513
|
+
Retrieves a set of records from the server. If the records has
|
1514
|
+
already been loaded in the store, then this method will simply return.
|
1515
|
+
Otherwise if your store has a `dataSource`, this will call the
|
1516
|
+
`dataSource` to retrieve the record. Generally you will not need to
|
1517
|
+
call this method yourself. Instead you can just use `find()`.
|
1518
|
+
|
1519
|
+
This will not actually create a record instance but it will initiate a
|
1520
|
+
load of the record from the server. You can subsequently get a record
|
1521
|
+
instance itself using `materializeRecord()`.
|
1522
|
+
|
1523
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1524
|
+
@param {Array} ids ids to retrieve
|
1525
|
+
@param {Array} storeKeys (optional) store keys to retrieve
|
1526
|
+
@param {Boolean} isRefresh
|
1527
|
+
@param {Function|Array} callback function or array of functions
|
1528
|
+
@returns {Array} storeKeys to be retrieved
|
1529
|
+
*/
|
1530
|
+
retrieveRecords: function(recordTypes, ids, storeKeys, isRefresh, callbacks) {
|
1531
|
+
|
1532
|
+
var source = this._getDataSource(),
|
1533
|
+
isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
|
1534
|
+
hasCallbackArray = SC.typeOf(callbacks) === SC.T_ARRAY,
|
1535
|
+
len = (!storeKeys) ? ids.length : storeKeys.length,
|
1536
|
+
ret = [],
|
1537
|
+
rev = SC.Store.generateStoreKey(),
|
1538
|
+
K = SC.Record,
|
1539
|
+
recordType, idx, storeKey, status, ok, callback;
|
1540
|
+
|
1541
|
+
if (!isArray) recordType = recordTypes;
|
1542
|
+
|
1543
|
+
// if no storeKeys were passed, map recordTypes + ids
|
1544
|
+
for(idx=0;idx<len;idx++) {
|
1545
|
+
|
1546
|
+
// collect store key
|
1547
|
+
if (storeKeys) {
|
1548
|
+
storeKey = storeKeys[idx];
|
1549
|
+
} else {
|
1550
|
+
if (isArray) recordType = recordTypes[idx];
|
1551
|
+
storeKey = recordType.storeKeyFor(ids[idx]);
|
1552
|
+
}
|
1553
|
+
//collect the callback
|
1554
|
+
callback = hasCallbackArray ? callbacks[idx] : callbacks;
|
1555
|
+
|
1556
|
+
// collect status and process
|
1557
|
+
status = this.readStatus(storeKey);
|
1558
|
+
|
1559
|
+
// K.EMPTY, K.ERROR, K.DESTROYED_CLEAN - initial retrieval
|
1560
|
+
if ((status == K.EMPTY) || (status == K.ERROR) || (status == K.DESTROYED_CLEAN)) {
|
1561
|
+
this.writeStatus(storeKey, K.BUSY_LOADING);
|
1562
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1563
|
+
ret.push(storeKey);
|
1564
|
+
this._setCallbackForStoreKey(storeKey, callback, hasCallbackArray, storeKeys);
|
1565
|
+
// otherwise, ignore record unless isRefresh is YES.
|
1566
|
+
} else if (isRefresh) {
|
1567
|
+
// K.READY_CLEAN, K.READY_DIRTY, ignore K.READY_NEW
|
1568
|
+
if (status & K.READY) {
|
1569
|
+
this.writeStatus(storeKey, K.BUSY_REFRESH | (status & 0x03)) ;
|
1570
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1571
|
+
ret.push(storeKey);
|
1572
|
+
this._setCallbackForStoreKey(storeKey, callback, hasCallbackArray, storeKeys);
|
1573
|
+
// K.BUSY_DESTROYING, K.BUSY_COMMITTING, K.BUSY_CREATING
|
1574
|
+
} else if ((status == K.BUSY_DESTROYING) || (status == K.BUSY_CREATING) || (status == K.BUSY_COMMITTING)) {
|
1575
|
+
throw K.BUSY_ERROR ;
|
1576
|
+
|
1577
|
+
// K.DESTROY_DIRTY, bad state...
|
1578
|
+
} else if (status == K.DESTROYED_DIRTY) {
|
1579
|
+
throw K.BAD_STATE_ERROR ;
|
1580
|
+
|
1581
|
+
// ignore K.BUSY_LOADING, K.BUSY_REFRESH_CLEAN, K.BUSY_REFRESH_DIRTY
|
1582
|
+
}
|
1583
|
+
}
|
1584
|
+
}
|
1585
|
+
|
1586
|
+
// now retrieve storekeys from dataSource. if there is no dataSource,
|
1587
|
+
// then act as if we couldn't retrieve.
|
1588
|
+
ok = NO;
|
1589
|
+
if (source) ok = source.retrieveRecords.call(source, this, ret, ids);
|
1590
|
+
|
1591
|
+
// if the data source could not retrieve or if there is no source, then
|
1592
|
+
// simulate the data source calling dataSourceDidError on those we are
|
1593
|
+
// loading for the first time or dataSourceDidComplete on refreshes.
|
1594
|
+
if (!ok) {
|
1595
|
+
len = ret.length;
|
1596
|
+
rev = SC.Store.generateStoreKey();
|
1597
|
+
for(idx=0;idx<len;idx++) {
|
1598
|
+
storeKey = ret[idx];
|
1599
|
+
status = this.readStatus(storeKey);
|
1600
|
+
if (status === K.BUSY_LOADING) {
|
1601
|
+
this.writeStatus(storeKey, K.ERROR);
|
1602
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1603
|
+
|
1604
|
+
} else if (status & K.BUSY_REFRESH) {
|
1605
|
+
this.writeStatus(storeKey, K.READY | (status & 0x03));
|
1606
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1607
|
+
}
|
1608
|
+
}
|
1609
|
+
ret.length = 0 ; // truncate to indicate that none could refresh
|
1610
|
+
}
|
1611
|
+
return ret ;
|
1612
|
+
},
|
1613
|
+
|
1614
|
+
_TMP_RETRIEVE_ARRAY: [],
|
1615
|
+
|
1616
|
+
_callback_queue: {},
|
1617
|
+
|
1618
|
+
/**
|
1619
|
+
@private
|
1620
|
+
stores the callbacks for the storeKeys that are inflight
|
1621
|
+
**/
|
1622
|
+
_setCallbackForStoreKey: function(storeKey, callback, hasCallbackArray, storeKeys){
|
1623
|
+
var queue = this._callback_queue;
|
1624
|
+
if(hasCallbackArray) queue[storeKey] = {callback: callback, otherKeys: storeKeys};
|
1625
|
+
else queue[storeKey] = callback;
|
1626
|
+
},
|
1627
|
+
/**
|
1628
|
+
@private
|
1629
|
+
retreives and calls callback for `storkey` if exists
|
1630
|
+
also handles if a single callback is need for one key
|
1631
|
+
**/
|
1632
|
+
_retreiveCallbackForStoreKey: function(storeKey){
|
1633
|
+
var queue = this._callback_queue,
|
1634
|
+
callback = queue[storeKey],
|
1635
|
+
allFinished, keys;
|
1636
|
+
if(callback){
|
1637
|
+
if(SC.typeOf(callback) === SC.T_FUNCTION){
|
1638
|
+
callback.call(); //args?
|
1639
|
+
delete queue[storeKey]; //cleanup
|
1640
|
+
}
|
1641
|
+
else if(SC.typeOf(callback) == SC.T_HASH){
|
1642
|
+
callback.completed = YES;
|
1643
|
+
keys = callback.storeKeys;
|
1644
|
+
keys.forEach(function(key){
|
1645
|
+
if(!queue[key].completed) allFinished = YES;
|
1646
|
+
});
|
1647
|
+
if(allFinished){
|
1648
|
+
callback.callback.call(); // args?
|
1649
|
+
//cleanup
|
1650
|
+
keys.forEach(function(key){
|
1651
|
+
delete queue[key];
|
1652
|
+
});
|
1653
|
+
}
|
1654
|
+
|
1655
|
+
}
|
1656
|
+
}
|
1657
|
+
},
|
1658
|
+
|
1659
|
+
/*
|
1660
|
+
@private
|
1661
|
+
|
1662
|
+
*/
|
1663
|
+
_cancelCallback: function(storeKey){
|
1664
|
+
var queue = this._callback_queue;
|
1665
|
+
if(queue[storeKey]){
|
1666
|
+
delete queue[storeKey];
|
1667
|
+
}
|
1668
|
+
},
|
1669
|
+
|
1670
|
+
|
1671
|
+
/**
|
1672
|
+
Retrieves a record from the server. If the record has already been loaded
|
1673
|
+
in the store, then this method will simply return. Otherwise if your
|
1674
|
+
store has a `dataSource`, this will call the `dataSource` to retrieve the
|
1675
|
+
record. Generally you will not need to call this method yourself.
|
1676
|
+
Instead you can just use `find()`.
|
1677
|
+
|
1678
|
+
This will not actually create a record instance but it will initiate a
|
1679
|
+
load of the record from the server. You can subsequently get a record
|
1680
|
+
instance itself using `materializeRecord()`.
|
1681
|
+
|
1682
|
+
@param {SC.Record} recordType class
|
1683
|
+
@param {String} id id to retrieve
|
1684
|
+
@param {Number} storeKey (optional) store key
|
1685
|
+
@param {Boolean} isRefresh
|
1686
|
+
@param {Function} callback (optional)
|
1687
|
+
@returns {Number} storeKey that was retrieved
|
1688
|
+
*/
|
1689
|
+
retrieveRecord: function(recordType, id, storeKey, isRefresh, callback) {
|
1690
|
+
var array = this._TMP_RETRIEVE_ARRAY,
|
1691
|
+
ret;
|
1692
|
+
|
1693
|
+
if (storeKey) {
|
1694
|
+
array[0] = storeKey;
|
1695
|
+
storeKey = array;
|
1696
|
+
id = null ;
|
1697
|
+
} else {
|
1698
|
+
array[0] = id;
|
1699
|
+
id = array;
|
1700
|
+
}
|
1701
|
+
|
1702
|
+
ret = this.retrieveRecords(recordType, id, storeKey, isRefresh, callback);
|
1703
|
+
array.length = 0 ;
|
1704
|
+
return ret[0];
|
1705
|
+
},
|
1706
|
+
|
1707
|
+
/**
|
1708
|
+
Refreshes a record from the server. If the record has already been loaded
|
1709
|
+
in the store, then this method will request a refresh from the
|
1710
|
+
`dataSource`. Otherwise it will attempt to retrieve the record.
|
1711
|
+
|
1712
|
+
@param {String} id to id of the record to load
|
1713
|
+
@param {SC.Record} recordType the expected record type
|
1714
|
+
@param {Number} storeKey (optional) optional store key
|
1715
|
+
@param {Function} callback (optional) when refresh complets
|
1716
|
+
@returns {Boolean} YES if the retrieval was a success.
|
1717
|
+
*/
|
1718
|
+
refreshRecord: function(recordType, id, storeKey, callback) {
|
1719
|
+
return !!this.retrieveRecord(recordType, id, storeKey, YES, callback);
|
1720
|
+
},
|
1721
|
+
|
1722
|
+
/**
|
1723
|
+
Refreshes a set of records from the server. If the records has already been loaded
|
1724
|
+
in the store, then this method will request a refresh from the
|
1725
|
+
`dataSource`. Otherwise it will attempt to retrieve them.
|
1726
|
+
|
1727
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1728
|
+
@param {Array} ids ids to destroy
|
1729
|
+
@param {Array} storeKeys (optional) store keys to destroy
|
1730
|
+
@param {Function} callback (optional) when refresh complets
|
1731
|
+
@returns {Boolean} YES if the retrieval was a success.
|
1732
|
+
*/
|
1733
|
+
refreshRecords: function(recordTypes, ids, storeKeys, callback) {
|
1734
|
+
var ret = this.retrieveRecords(recordTypes, ids, storeKeys, YES, callback);
|
1735
|
+
return ret && ret.length>0;
|
1736
|
+
},
|
1737
|
+
|
1738
|
+
/**
|
1739
|
+
Commits the passed store keys or ids. If no `storeKey`s are given,
|
1740
|
+
it will commit any records in the changelog.
|
1741
|
+
|
1742
|
+
Based on the current state of the record, this will ask the data
|
1743
|
+
source to perform the appropriate actions
|
1744
|
+
on the store keys.
|
1745
|
+
|
1746
|
+
@param {Array} recordTypes the expected record types (SC.Record)
|
1747
|
+
@param {Array} ids to commit
|
1748
|
+
@param {SC.Set} storeKeys to commit
|
1749
|
+
@param {Hash} params optional additional parameters to pass along to the
|
1750
|
+
data source
|
1751
|
+
@param {Function|Array} callback function or array of callbacks
|
1752
|
+
|
1753
|
+
@returns {Boolean} if the action was succesful.
|
1754
|
+
*/
|
1755
|
+
commitRecords: function(recordTypes, ids, storeKeys, params, callbacks) {
|
1756
|
+
var source = this._getDataSource(),
|
1757
|
+
isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
|
1758
|
+
hasCallbackArray = SC.typeOf(callbacks) === SC.T_ARRAY,
|
1759
|
+
retCreate= [], retUpdate= [], retDestroy = [],
|
1760
|
+
rev = SC.Store.generateStoreKey(),
|
1761
|
+
K = SC.Record,
|
1762
|
+
recordType, idx, storeKey, status, key, ret, len, callback;
|
1763
|
+
|
1764
|
+
// If no params are passed, look up storeKeys in the changelog property.
|
1765
|
+
// Remove any committed records from changelog property.
|
1766
|
+
|
1767
|
+
if(!recordTypes && !ids && !storeKeys){
|
1768
|
+
storeKeys = this.changelog;
|
1769
|
+
}
|
1770
|
+
|
1771
|
+
len = storeKeys ? storeKeys.get('length') : (ids ? ids.get('length') : 0);
|
1772
|
+
|
1773
|
+
for(idx=0;idx<len;idx++) {
|
1774
|
+
|
1775
|
+
// collect store key
|
1776
|
+
if (storeKeys) {
|
1777
|
+
storeKey = storeKeys[idx];
|
1778
|
+
} else {
|
1779
|
+
if (isArray) recordType = recordTypes[idx] || SC.Record;
|
1780
|
+
else recordType = recordTypes;
|
1781
|
+
storeKey = recordType.storeKeyFor(ids[idx]);
|
1782
|
+
}
|
1783
|
+
|
1784
|
+
//collect the callback
|
1785
|
+
callback = hasCallbackArray ? callbacks[idx] : callbacks;
|
1786
|
+
|
1787
|
+
// collect status and process
|
1788
|
+
status = this.readStatus(storeKey);
|
1789
|
+
|
1790
|
+
if ((status == K.EMPTY) || (status == K.ERROR)) {
|
1791
|
+
throw K.NOT_FOUND_ERROR ;
|
1792
|
+
}
|
1793
|
+
else {
|
1794
|
+
if(status==K.READY_NEW) {
|
1795
|
+
this.writeStatus(storeKey, K.BUSY_CREATING);
|
1796
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1797
|
+
retCreate.push(storeKey);
|
1798
|
+
this._setCallbackForStoreKey(storeKey, callback, hasCallbackArray, storeKeys);
|
1799
|
+
} else if (status==K.READY_DIRTY) {
|
1800
|
+
this.writeStatus(storeKey, K.BUSY_COMMITTING);
|
1801
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1802
|
+
retUpdate.push(storeKey);
|
1803
|
+
this._setCallbackForStoreKey(storeKey, callback, hasCallbackArray, storeKeys);
|
1804
|
+
} else if (status==K.DESTROYED_DIRTY) {
|
1805
|
+
this.writeStatus(storeKey, K.BUSY_DESTROYING);
|
1806
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1807
|
+
retDestroy.push(storeKey);
|
1808
|
+
this._setCallbackForStoreKey(storeKey, callback, hasCallbackArray, storeKeys);
|
1809
|
+
} else if (status==K.DESTROYED_CLEAN) {
|
1810
|
+
this.dataHashDidChange(storeKey, rev, YES);
|
1811
|
+
}
|
1812
|
+
// ignore K.READY_CLEAN, K.BUSY_LOADING, K.BUSY_CREATING, K.BUSY_COMMITTING,
|
1813
|
+
// K.BUSY_REFRESH_CLEAN, K_BUSY_REFRESH_DIRTY, KBUSY_DESTROYING
|
1814
|
+
}
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
// now commit storekeys to dataSource
|
1818
|
+
if (source && (len>0 || params)) {
|
1819
|
+
ret = source.commitRecords.call(source, this, retCreate, retUpdate, retDestroy, params);
|
1820
|
+
}
|
1821
|
+
|
1822
|
+
//remove all commited changes from changelog
|
1823
|
+
if (ret && !recordTypes && !ids) {
|
1824
|
+
if (storeKeys === this.changelog) {
|
1825
|
+
this.changelog = null;
|
1826
|
+
}
|
1827
|
+
else {
|
1828
|
+
this.changelog.removeEach(storeKeys);
|
1829
|
+
}
|
1830
|
+
}
|
1831
|
+
return ret ;
|
1832
|
+
},
|
1833
|
+
|
1834
|
+
/**
|
1835
|
+
Commits the passed store key or id. Based on the current state of the
|
1836
|
+
record, this will ask the data source to perform the appropriate action
|
1837
|
+
on the store key.
|
1838
|
+
|
1839
|
+
You have to pass either the id or the storeKey otherwise it will return
|
1840
|
+
NO.
|
1841
|
+
|
1842
|
+
@param {SC.Record} recordType the expected record type
|
1843
|
+
@param {String} id the id of the record to commit
|
1844
|
+
@param {Number} storeKey the storeKey of the record to commit
|
1845
|
+
@param {Hash} params optional additonal params that will passed down
|
1846
|
+
to the data source
|
1847
|
+
@param {Function|Array} callback function or array of functions
|
1848
|
+
@returns {Boolean} if the action was successful.
|
1849
|
+
*/
|
1850
|
+
commitRecord: function(recordType, id, storeKey, params, callback) {
|
1851
|
+
var array = this._TMP_RETRIEVE_ARRAY,
|
1852
|
+
ret ;
|
1853
|
+
if (id === undefined && storeKey === undefined ) return NO;
|
1854
|
+
if (storeKey !== undefined) {
|
1855
|
+
array[0] = storeKey;
|
1856
|
+
storeKey = array;
|
1857
|
+
id = null ;
|
1858
|
+
} else {
|
1859
|
+
array[0] = id;
|
1860
|
+
id = array;
|
1861
|
+
}
|
1862
|
+
|
1863
|
+
ret = this.commitRecords(recordType, id, storeKey, params, callback);
|
1864
|
+
array.length = 0 ;
|
1865
|
+
return ret;
|
1866
|
+
},
|
1867
|
+
|
1868
|
+
/**
|
1869
|
+
Cancels an inflight request for the passed records. Depending on the
|
1870
|
+
server implementation, this could cancel an entire request, causing
|
1871
|
+
other records to also transition their current state.
|
1872
|
+
|
1873
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1874
|
+
@param {Array} ids ids to destroy
|
1875
|
+
@param {Array} storeKeys (optional) store keys to destroy
|
1876
|
+
@returns {SC.Store} the store.
|
1877
|
+
*/
|
1878
|
+
cancelRecords: function(recordTypes, ids, storeKeys) {
|
1879
|
+
var source = this._getDataSource(),
|
1880
|
+
isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
|
1881
|
+
K = SC.Record,
|
1882
|
+
ret = [],
|
1883
|
+
status, len, idx, id, recordType, storeKey;
|
1884
|
+
|
1885
|
+
len = (storeKeys === undefined) ? ids.length : storeKeys.length;
|
1886
|
+
for(idx=0;idx<len;idx++) {
|
1887
|
+
if (isArray) recordType = recordTypes[idx] || SC.Record;
|
1888
|
+
else recordType = recordTypes || SC.Record;
|
1889
|
+
|
1890
|
+
id = ids ? ids[idx] : undefined ;
|
1891
|
+
|
1892
|
+
if(storeKeys===undefined){
|
1893
|
+
storeKey = recordType.storeKeyFor(id);
|
1894
|
+
}else{
|
1895
|
+
storeKey = storeKeys ? storeKeys[idx] : undefined ;
|
1896
|
+
}
|
1897
|
+
if(storeKey) {
|
1898
|
+
status = this.readStatus(storeKey);
|
1899
|
+
|
1900
|
+
if ((status == K.EMPTY) || (status == K.ERROR)) {
|
1901
|
+
throw K.NOT_FOUND_ERROR ;
|
1902
|
+
}
|
1903
|
+
ret.push(storeKey);
|
1904
|
+
this._cancelCallback(storeKey);
|
1905
|
+
}
|
1906
|
+
}
|
1907
|
+
|
1908
|
+
if (source) source.cancel.call(source, this, ret);
|
1909
|
+
|
1910
|
+
return this ;
|
1911
|
+
},
|
1912
|
+
|
1913
|
+
/**
|
1914
|
+
Cancels an inflight request for the passed record. Depending on the
|
1915
|
+
server implementation, this could cancel an entire request, causing
|
1916
|
+
other records to also transition their current state.
|
1917
|
+
|
1918
|
+
@param {SC.Record|Array} recordTypes class or array of classes
|
1919
|
+
@param {Array} ids ids to destroy
|
1920
|
+
@param {Array} storeKeys (optional) store keys to destroy
|
1921
|
+
@returns {SC.Store} the store.
|
1922
|
+
*/
|
1923
|
+
cancelRecord: function(recordType, id, storeKey) {
|
1924
|
+
var array = this._TMP_RETRIEVE_ARRAY,
|
1925
|
+
ret ;
|
1926
|
+
|
1927
|
+
if (storeKey !== undefined) {
|
1928
|
+
array[0] = storeKey;
|
1929
|
+
storeKey = array;
|
1930
|
+
id = null ;
|
1931
|
+
} else {
|
1932
|
+
array[0] = id;
|
1933
|
+
id = array;
|
1934
|
+
}
|
1935
|
+
|
1936
|
+
ret = this.cancelRecords(recordType, id, storeKey);
|
1937
|
+
array.length = 0 ;
|
1938
|
+
return this;
|
1939
|
+
},
|
1940
|
+
|
1941
|
+
/**
|
1942
|
+
Convenience method can be called by the store or other parts of your
|
1943
|
+
application to load a record into the store. This method will take a
|
1944
|
+
recordType and a data hashes and either add or update the
|
1945
|
+
record in the store.
|
1946
|
+
|
1947
|
+
The loaded records will be in an `SC.Record.READY_CLEAN` state, indicating
|
1948
|
+
they were loaded from the data source and do not need to be committed
|
1949
|
+
back before changing.
|
1950
|
+
|
1951
|
+
This method will check the state of the storeKey and call either
|
1952
|
+
`pushRetrieve()` or `dataSourceDidComplete()`. The standard state constraints
|
1953
|
+
for these methods apply here.
|
1954
|
+
|
1955
|
+
The return value will be the `storeKey` used for the push. This is often
|
1956
|
+
convenient to pass into `loadQuery()`, if you are fetching a remote query.
|
1957
|
+
|
1958
|
+
If you are upgrading from a pre SproutCore 1.0 application, this method
|
1959
|
+
is the closest to the old `updateRecord()`.
|
1960
|
+
|
1961
|
+
@param {SC.Record} recordType the record type
|
1962
|
+
@param {Array} dataHash to update
|
1963
|
+
@param {Array} id optional. if not passed lookup on the hash
|
1964
|
+
@returns {String} store keys assigned to these id
|
1965
|
+
*/
|
1966
|
+
loadRecord: function(recordType, dataHash, id) {
|
1967
|
+
var K = SC.Record,
|
1968
|
+
ret, primaryKey, storeKey;
|
1969
|
+
|
1970
|
+
// save lookup info
|
1971
|
+
recordType = recordType || SC.Record;
|
1972
|
+
primaryKey = recordType.prototype.primaryKey;
|
1973
|
+
|
1974
|
+
|
1975
|
+
// push each record
|
1976
|
+
id = id || dataHash[primaryKey];
|
1977
|
+
ret = storeKey = recordType.storeKeyFor(id); // needed to cache
|
1978
|
+
|
1979
|
+
if (this.readStatus(storeKey) & K.BUSY) {
|
1980
|
+
this.dataSourceDidComplete(storeKey, dataHash, id);
|
1981
|
+
} else this.pushRetrieve(recordType, id, dataHash, storeKey);
|
1982
|
+
|
1983
|
+
// return storeKey
|
1984
|
+
return ret ;
|
1985
|
+
},
|
1986
|
+
|
1987
|
+
/**
|
1988
|
+
Convenience method can be called by the store or other parts of your
|
1989
|
+
application to load records into the store. This method will take a
|
1990
|
+
recordType and an array of data hashes and either add or update the
|
1991
|
+
record in the store.
|
1992
|
+
|
1993
|
+
The loaded records will be in an `SC.Record.READY_CLEAN` state, indicating
|
1994
|
+
they were loaded from the data source and do not need to be committed
|
1995
|
+
back before changing.
|
1996
|
+
|
1997
|
+
This method will check the state of each storeKey and call either
|
1998
|
+
`pushRetrieve()` or `dataSourceDidComplete()`. The standard state
|
1999
|
+
constraints for these methods apply here.
|
2000
|
+
|
2001
|
+
The return value will be the storeKeys used for each push. This is often
|
2002
|
+
convenient to pass into `loadQuery()`, if you are fetching a remote query.
|
2003
|
+
|
2004
|
+
If you are upgrading from a pre SproutCore 1.0 application, this method
|
2005
|
+
is the closest to the old `updateRecords()`.
|
2006
|
+
|
2007
|
+
@param {SC.Record} recordTypes the record type or array of record types
|
2008
|
+
@param {Array} dataHashes array of data hashes to update
|
2009
|
+
@param {Array} ids optional array of ids. if not passed lookup on hashes
|
2010
|
+
@returns {Array} store keys assigned to these ids
|
2011
|
+
*/
|
2012
|
+
loadRecords: function(recordTypes, dataHashes, ids) {
|
2013
|
+
var isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
|
2014
|
+
len = dataHashes.get('length'),
|
2015
|
+
ret = [],
|
2016
|
+
K = SC.Record,
|
2017
|
+
recordType, id, primaryKey, idx, dataHash, storeKey;
|
2018
|
+
|
2019
|
+
// save lookup info
|
2020
|
+
if (!isArray) {
|
2021
|
+
recordType = recordTypes || SC.Record;
|
2022
|
+
primaryKey = recordType.prototype.primaryKey ;
|
2023
|
+
}
|
2024
|
+
|
2025
|
+
// push each record
|
2026
|
+
for(idx=0;idx<len;idx++) {
|
2027
|
+
dataHash = dataHashes.objectAt(idx);
|
2028
|
+
if (isArray) {
|
2029
|
+
recordType = recordTypes.objectAt(idx) || SC.Record;
|
2030
|
+
primaryKey = recordType.prototype.primaryKey ;
|
2031
|
+
}
|
2032
|
+
id = (ids) ? ids.objectAt(idx) : dataHash[primaryKey];
|
2033
|
+
ret[idx] = this.loadRecord(recordType, dataHash, id);
|
2034
|
+
|
2035
|
+
}
|
2036
|
+
|
2037
|
+
// return storeKeys
|
2038
|
+
return ret ;
|
2039
|
+
},
|
2040
|
+
|
2041
|
+
/**
|
2042
|
+
Returns the `SC.Error` object associated with a specific record.
|
2043
|
+
|
2044
|
+
@param {Number} storeKey The store key of the record.
|
2045
|
+
|
2046
|
+
@returns {SC.Error} SC.Error or undefined if no error associated with the record.
|
2047
|
+
*/
|
2048
|
+
readError: function(storeKey) {
|
2049
|
+
var errors = this.recordErrors ;
|
2050
|
+
return errors ? errors[storeKey] : undefined ;
|
2051
|
+
},
|
2052
|
+
|
2053
|
+
/**
|
2054
|
+
Returns the `SC.Error` object associated with a specific query.
|
2055
|
+
|
2056
|
+
@param {SC.Query} query The SC.Query with which the error is associated.
|
2057
|
+
|
2058
|
+
@returns {SC.Error} SC.Error or undefined if no error associated with the query.
|
2059
|
+
*/
|
2060
|
+
readQueryError: function(query) {
|
2061
|
+
var errors = this.queryErrors ;
|
2062
|
+
return errors ? errors[SC.guidFor(query)] : undefined ;
|
2063
|
+
},
|
2064
|
+
|
2065
|
+
// ..........................................................
|
2066
|
+
// DATA SOURCE CALLBACKS
|
2067
|
+
//
|
2068
|
+
// Mathods called by the data source on the store
|
2069
|
+
|
2070
|
+
/**
|
2071
|
+
Called by a `dataSource` when it cancels an inflight operation on a
|
2072
|
+
record. This will transition the record back to it non-inflight state.
|
2073
|
+
|
2074
|
+
@param {Number} storeKey record store key to cancel
|
2075
|
+
@returns {SC.Store} reciever
|
2076
|
+
*/
|
2077
|
+
dataSourceDidCancel: function(storeKey) {
|
2078
|
+
var status = this.readStatus(storeKey),
|
2079
|
+
K = SC.Record;
|
2080
|
+
|
2081
|
+
// EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
|
2082
|
+
// DESTROYED_DIRTY
|
2083
|
+
if (!(status & K.BUSY)) {
|
2084
|
+
throw K.BAD_STATE_ERROR; // should never be called in this state
|
2085
|
+
}
|
2086
|
+
|
2087
|
+
// otherwise, determine proper state transition
|
2088
|
+
switch(status) {
|
2089
|
+
case K.BUSY_LOADING:
|
2090
|
+
status = K.EMPTY;
|
2091
|
+
break ;
|
2092
|
+
|
2093
|
+
case K.BUSY_CREATING:
|
2094
|
+
status = K.READY_NEW;
|
2095
|
+
break;
|
2096
|
+
|
2097
|
+
case K.BUSY_COMMITTING:
|
2098
|
+
status = K.READY_DIRTY ;
|
2099
|
+
break;
|
2100
|
+
|
2101
|
+
case K.BUSY_REFRESH_CLEAN:
|
2102
|
+
status = K.READY_CLEAN;
|
2103
|
+
break;
|
2104
|
+
|
2105
|
+
case K.BUSY_REFRESH_DIRTY:
|
2106
|
+
status = K.READY_DIRTY ;
|
2107
|
+
break ;
|
2108
|
+
|
2109
|
+
case K.BUSY_DESTROYING:
|
2110
|
+
status = K.DESTROYED_DIRTY ;
|
2111
|
+
break;
|
2112
|
+
|
2113
|
+
default:
|
2114
|
+
throw K.BAD_STATE_ERROR ;
|
2115
|
+
}
|
2116
|
+
this.writeStatus(storeKey, status) ;
|
2117
|
+
this.dataHashDidChange(storeKey, null, YES);
|
2118
|
+
this._cancelCallback(storeKey);
|
2119
|
+
|
2120
|
+
return this ;
|
2121
|
+
},
|
2122
|
+
|
2123
|
+
/**
|
2124
|
+
Called by a data source when it creates or commits a record. Passing an
|
2125
|
+
optional id will remap the `storeKey` to the new record id. This is
|
2126
|
+
required when you commit a record that does not have an id yet.
|
2127
|
+
|
2128
|
+
@param {Number} storeKey record store key to change to READY_CLEAN state
|
2129
|
+
@param {Hash} dataHash optional data hash to replace current hash
|
2130
|
+
@param {Object} newId optional new id to replace the old one
|
2131
|
+
@returns {SC.Store} reciever
|
2132
|
+
*/
|
2133
|
+
dataSourceDidComplete: function(storeKey, dataHash, newId) {
|
2134
|
+
var status = this.readStatus(storeKey), K = SC.Record, statusOnly;
|
2135
|
+
|
2136
|
+
// EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
|
2137
|
+
// DESTROYED_DIRTY
|
2138
|
+
if (!(status & K.BUSY)) {
|
2139
|
+
throw K.BAD_STATE_ERROR; // should never be called in this state
|
2140
|
+
}
|
2141
|
+
|
2142
|
+
// otherwise, determine proper state transition
|
2143
|
+
if(status===K.BUSY_DESTROYING) {
|
2144
|
+
throw K.BAD_STATE_ERROR ;
|
2145
|
+
} else status = K.READY_CLEAN ;
|
2146
|
+
|
2147
|
+
this.writeStatus(storeKey, status) ;
|
2148
|
+
if (dataHash) this.writeDataHash(storeKey, dataHash, status) ;
|
2149
|
+
if (newId) SC.Store.replaceIdFor(storeKey, newId);
|
2150
|
+
|
2151
|
+
statusOnly = dataHash || newId ? NO : YES;
|
2152
|
+
this.dataHashDidChange(storeKey, null, statusOnly);
|
2153
|
+
|
2154
|
+
// Force record to refresh its cached properties based on store key
|
2155
|
+
var record = this.materializeRecord(storeKey);
|
2156
|
+
if (record != null) {
|
2157
|
+
record.notifyPropertyChange('status');
|
2158
|
+
}
|
2159
|
+
//update callbacks
|
2160
|
+
this._retreiveCallbackForStoreKey(storeKey);
|
2161
|
+
|
2162
|
+
return this ;
|
2163
|
+
},
|
2164
|
+
|
2165
|
+
/**
|
2166
|
+
Called by a data source when it has destroyed a record. This will
|
2167
|
+
transition the record to the proper state.
|
2168
|
+
|
2169
|
+
@param {Number} storeKey record store key to cancel
|
2170
|
+
@returns {SC.Store} reciever
|
2171
|
+
*/
|
2172
|
+
dataSourceDidDestroy: function(storeKey) {
|
2173
|
+
var status = this.readStatus(storeKey), K = SC.Record;
|
2174
|
+
|
2175
|
+
// EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
|
2176
|
+
// DESTROYED_DIRTY
|
2177
|
+
if (!(status & K.BUSY)) {
|
2178
|
+
throw K.BAD_STATE_ERROR; // should never be called in this state
|
2179
|
+
}
|
2180
|
+
// otherwise, determine proper state transition
|
2181
|
+
else{
|
2182
|
+
status = K.DESTROYED_CLEAN ;
|
2183
|
+
}
|
2184
|
+
this.removeDataHash(storeKey, status) ;
|
2185
|
+
this.dataHashDidChange(storeKey);
|
2186
|
+
|
2187
|
+
// Force record to refresh its cached properties based on store key
|
2188
|
+
var record = this.materializeRecord(storeKey);
|
2189
|
+
if (record != null) {
|
2190
|
+
record.notifyPropertyChange('status');
|
2191
|
+
}
|
2192
|
+
|
2193
|
+
this._retreiveCallbackForStoreKey(storeKey);
|
2194
|
+
|
2195
|
+
return this ;
|
2196
|
+
},
|
2197
|
+
|
2198
|
+
/**
|
2199
|
+
Converts the passed record into an error object.
|
2200
|
+
|
2201
|
+
@param {Number} storeKey record store key to error
|
2202
|
+
@param {SC.Error} error [optional] an SC.Error instance to associate with storeKey
|
2203
|
+
@returns {SC.Store} reciever
|
2204
|
+
*/
|
2205
|
+
dataSourceDidError: function(storeKey, error) {
|
2206
|
+
var status = this.readStatus(storeKey), errors = this.recordErrors, K = SC.Record;
|
2207
|
+
|
2208
|
+
// EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
|
2209
|
+
// DESTROYED_DIRTY
|
2210
|
+
if (!(status & K.BUSY)) { throw K.BAD_STATE_ERROR; }
|
2211
|
+
|
2212
|
+
// otherwise, determine proper state transition
|
2213
|
+
else status = K.ERROR ;
|
2214
|
+
|
2215
|
+
// Add the error to the array of record errors (for lookup later on if necessary).
|
2216
|
+
if (error && error.isError) {
|
2217
|
+
if (!errors) errors = this.recordErrors = [];
|
2218
|
+
errors[storeKey] = error;
|
2219
|
+
}
|
2220
|
+
|
2221
|
+
this.writeStatus(storeKey, status) ;
|
2222
|
+
this.dataHashDidChange(storeKey, null, YES);
|
2223
|
+
|
2224
|
+
// Force record to refresh its cached properties based on store key
|
2225
|
+
var record = this.materializeRecord(storeKey);
|
2226
|
+
if (record != null) {
|
2227
|
+
record.notifyPropertyChange('status');
|
2228
|
+
}
|
2229
|
+
|
2230
|
+
this._retreiveCallbackForStoreKey(storeKey);
|
2231
|
+
return this ;
|
2232
|
+
},
|
2233
|
+
|
2234
|
+
// ..........................................................
|
2235
|
+
// PUSH CHANGES FROM DATA SOURCE
|
2236
|
+
//
|
2237
|
+
|
2238
|
+
/**
|
2239
|
+
Call by the data source whenever you want to push new data out of band
|
2240
|
+
into the store.
|
2241
|
+
|
2242
|
+
@param {Class} recordType the SC.Record subclass
|
2243
|
+
@param {Object} id the record id or null
|
2244
|
+
@param {Hash} dataHash data hash to load
|
2245
|
+
@param {Number} storeKey optional store key.
|
2246
|
+
@returns {Number|Boolean} storeKey if push was allowed, NO if not
|
2247
|
+
*/
|
2248
|
+
pushRetrieve: function(recordType, id, dataHash, storeKey) {
|
2249
|
+
var K = SC.Record, status;
|
2250
|
+
|
2251
|
+
if(storeKey===undefined) storeKey = recordType.storeKeyFor(id);
|
2252
|
+
status = this.readStatus(storeKey);
|
2253
|
+
if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROYED_CLEAN) {
|
2254
|
+
|
2255
|
+
status = K.READY_CLEAN;
|
2256
|
+
if(dataHash===undefined) this.writeStatus(storeKey, status) ;
|
2257
|
+
else this.writeDataHash(storeKey, dataHash, status) ;
|
2258
|
+
|
2259
|
+
this.dataHashDidChange(storeKey);
|
2260
|
+
|
2261
|
+
return storeKey;
|
2262
|
+
}
|
2263
|
+
//conflicted (ready)
|
2264
|
+
return NO;
|
2265
|
+
},
|
2266
|
+
|
2267
|
+
/**
|
2268
|
+
Call by the data source whenever you want to push a deletion into the
|
2269
|
+
store.
|
2270
|
+
|
2271
|
+
@param {Class} recordType the SC.Record subclass
|
2272
|
+
@param {Object} id the record id or null
|
2273
|
+
@param {Number} storeKey optional store key.
|
2274
|
+
@returns {Number|Boolean} storeKey if push was allowed, NO if not
|
2275
|
+
*/
|
2276
|
+
pushDestroy: function(recordType, id, storeKey) {
|
2277
|
+
var K = SC.Record, status;
|
2278
|
+
|
2279
|
+
if(storeKey===undefined){
|
2280
|
+
storeKey = recordType.storeKeyFor(id);
|
2281
|
+
}
|
2282
|
+
status = this.readStatus(storeKey);
|
2283
|
+
if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROYED_CLEAN){
|
2284
|
+
status = K.DESTROYED_CLEAN;
|
2285
|
+
this.removeDataHash(storeKey, status) ;
|
2286
|
+
this.dataHashDidChange(storeKey);
|
2287
|
+
return storeKey;
|
2288
|
+
}
|
2289
|
+
//conflicted (destroy)
|
2290
|
+
return NO;
|
2291
|
+
},
|
2292
|
+
|
2293
|
+
/**
|
2294
|
+
Call by the data source whenever you want to push an error into the
|
2295
|
+
store.
|
2296
|
+
|
2297
|
+
@param {Class} recordType the SC.Record subclass
|
2298
|
+
@param {Object} id the record id or null
|
2299
|
+
@param {SC.Error} error [optional] an SC.Error instance to associate with id or storeKey
|
2300
|
+
@param {Number} storeKey optional store key.
|
2301
|
+
@returns {Number|Boolean} storeKey if push was allowed, NO if not
|
2302
|
+
*/
|
2303
|
+
pushError: function(recordType, id, error, storeKey) {
|
2304
|
+
var K = SC.Record, status, errors = this.recordErrors;
|
2305
|
+
|
2306
|
+
if(storeKey===undefined) storeKey = recordType.storeKeyFor(id);
|
2307
|
+
status = this.readStatus(storeKey);
|
2308
|
+
|
2309
|
+
if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROYED_CLEAN){
|
2310
|
+
status = K.ERROR;
|
2311
|
+
|
2312
|
+
// Add the error to the array of record errors (for lookup later on if necessary).
|
2313
|
+
if (error && error.isError) {
|
2314
|
+
if (!errors) errors = this.recordErrors = [];
|
2315
|
+
errors[storeKey] = error;
|
2316
|
+
}
|
2317
|
+
|
2318
|
+
this.writeStatus(storeKey, status) ;
|
2319
|
+
this.dataHashDidChange(storeKey, null, YES);
|
2320
|
+
return storeKey;
|
2321
|
+
}
|
2322
|
+
//conflicted (error)
|
2323
|
+
return NO;
|
2324
|
+
},
|
2325
|
+
|
2326
|
+
// ..........................................................
|
2327
|
+
// FETCH CALLBACKS
|
2328
|
+
//
|
2329
|
+
|
2330
|
+
// **NOTE**: although these method works on RecordArray instances right now.
|
2331
|
+
// They could be optimized to actually share query results between nested
|
2332
|
+
// stores. This is why these methods are implemented here instead of
|
2333
|
+
// directly on `Query` or `RecordArray` objects.
|
2334
|
+
|
2335
|
+
/**
|
2336
|
+
Sets the passed array of storeKeys as the new data for the query. You
|
2337
|
+
can call this at any time for a remote query to update its content. If
|
2338
|
+
you want to use incremental loading, then pass a `SparseArray` object.
|
2339
|
+
|
2340
|
+
If the query you pass is not a REMOTE query, then this method will raise
|
2341
|
+
an exception. This will also implicitly transition the query state to
|
2342
|
+
`SC.Record.READY`.
|
2343
|
+
|
2344
|
+
If you called `loadRecords()` before to load the actual content, you can
|
2345
|
+
call this method with the return value of that method to actually set the
|
2346
|
+
storeKeys on the result.
|
2347
|
+
|
2348
|
+
@param {SC.Query} query the query you are loading. must be remote.
|
2349
|
+
@param {SC.Array} storeKeys array of store keys
|
2350
|
+
@returns {SC.Store} receiver
|
2351
|
+
*/
|
2352
|
+
loadQueryResults: function(query, storeKeys) {
|
2353
|
+
if (query.get('location') === SC.Query.LOCAL) {
|
2354
|
+
throw new Error("Cannot load query results for a local query");
|
2355
|
+
}
|
2356
|
+
|
2357
|
+
var recArray = this._findQuery(query, YES, NO);
|
2358
|
+
if (recArray) recArray.set('storeKeys', storeKeys);
|
2359
|
+
this.dataSourceDidFetchQuery(query);
|
2360
|
+
|
2361
|
+
return this ;
|
2362
|
+
},
|
2363
|
+
|
2364
|
+
/**
|
2365
|
+
Called by your data source whenever you finish fetching the results of a
|
2366
|
+
query. This will put the query into a READY state if it was loading.
|
2367
|
+
|
2368
|
+
Note that if the query is a REMOTE query, then you must separately load
|
2369
|
+
the results into the query using `loadQueryResults()`. If the query is
|
2370
|
+
LOCAL, then the query will update automatically with any new records you
|
2371
|
+
added to the store.
|
2372
|
+
|
2373
|
+
@param {SC.Query} query the query you fetched
|
2374
|
+
@returns {SC.Store} receiver
|
2375
|
+
*/
|
2376
|
+
dataSourceDidFetchQuery: function(query) {
|
2377
|
+
return this._scstore_dataSourceDidFetchQuery(query, YES);
|
2378
|
+
},
|
2379
|
+
|
2380
|
+
_scstore_dataSourceDidFetchQuery: function(query, createIfNeeded) {
|
2381
|
+
var recArray = this._findQuery(query, createIfNeeded, NO),
|
2382
|
+
nestedStores = this.get('nestedStores'),
|
2383
|
+
loc = nestedStores ? nestedStores.get('length') : 0;
|
2384
|
+
|
2385
|
+
// fix query if needed
|
2386
|
+
if (recArray) recArray.storeDidFetchQuery(query);
|
2387
|
+
|
2388
|
+
// notify nested stores
|
2389
|
+
while(--loc >= 0) {
|
2390
|
+
nestedStores[loc]._scstore_dataSourceDidFetchQuery(query, NO);
|
2391
|
+
}
|
2392
|
+
|
2393
|
+
return this ;
|
2394
|
+
},
|
2395
|
+
|
2396
|
+
/**
|
2397
|
+
Called by your data source if it cancels fetching the results of a query.
|
2398
|
+
This will put any RecordArray's back into its original state (READY or
|
2399
|
+
EMPTY).
|
2400
|
+
|
2401
|
+
@param {SC.Query} query the query you cancelled
|
2402
|
+
@returns {SC.Store} receiver
|
2403
|
+
*/
|
2404
|
+
dataSourceDidCancelQuery: function(query) {
|
2405
|
+
return this._scstore_dataSourceDidCancelQuery(query, YES);
|
2406
|
+
},
|
2407
|
+
|
2408
|
+
_scstore_dataSourceDidCancelQuery: function(query, createIfNeeded) {
|
2409
|
+
var recArray = this._findQuery(query, createIfNeeded, NO),
|
2410
|
+
nestedStores = this.get('nestedStores'),
|
2411
|
+
loc = nestedStores ? nestedStores.get('length') : 0;
|
2412
|
+
|
2413
|
+
// fix query if needed
|
2414
|
+
if (recArray) recArray.storeDidCancelQuery(query);
|
2415
|
+
|
2416
|
+
// notify nested stores
|
2417
|
+
while(--loc >= 0) {
|
2418
|
+
nestedStores[loc]._scstore_dataSourceDidCancelQuery(query, NO);
|
2419
|
+
}
|
2420
|
+
|
2421
|
+
return this ;
|
2422
|
+
},
|
2423
|
+
|
2424
|
+
/**
|
2425
|
+
Called by your data source if it encountered an error loading the query.
|
2426
|
+
This will put the query into an error state until you try to refresh it
|
2427
|
+
again.
|
2428
|
+
|
2429
|
+
@param {SC.Query} query the query with the error
|
2430
|
+
@param {SC.Error} error [optional] an SC.Error instance to associate with query
|
2431
|
+
@returns {SC.Store} receiver
|
2432
|
+
*/
|
2433
|
+
dataSourceDidErrorQuery: function(query, error) {
|
2434
|
+
var errors = this.queryErrors;
|
2435
|
+
|
2436
|
+
// Add the error to the array of query errors (for lookup later on if necessary).
|
2437
|
+
if (error && error.isError) {
|
2438
|
+
if (!errors) errors = this.queryErrors = {};
|
2439
|
+
errors[SC.guidFor(query)] = error;
|
2440
|
+
}
|
2441
|
+
|
2442
|
+
return this._scstore_dataSourceDidErrorQuery(query, YES);
|
2443
|
+
},
|
2444
|
+
|
2445
|
+
_scstore_dataSourceDidErrorQuery: function(query, createIfNeeded) {
|
2446
|
+
var recArray = this._findQuery(query, createIfNeeded, NO),
|
2447
|
+
nestedStores = this.get('nestedStores'),
|
2448
|
+
loc = nestedStores ? nestedStores.get('length') : 0;
|
2449
|
+
|
2450
|
+
// fix query if needed
|
2451
|
+
if (recArray) recArray.storeDidErrorQuery(query);
|
2452
|
+
|
2453
|
+
// notify nested stores
|
2454
|
+
while(--loc >= 0) {
|
2455
|
+
nestedStores[loc]._scstore_dataSourceDidErrorQuery(query, NO);
|
2456
|
+
}
|
2457
|
+
|
2458
|
+
return this ;
|
2459
|
+
},
|
2460
|
+
|
2461
|
+
// ..........................................................
|
2462
|
+
// INTERNAL SUPPORT
|
2463
|
+
//
|
2464
|
+
|
2465
|
+
/** @private */
|
2466
|
+
init: function() {
|
2467
|
+
sc_super();
|
2468
|
+
this.reset();
|
2469
|
+
},
|
2470
|
+
|
2471
|
+
|
2472
|
+
toString: function() {
|
2473
|
+
// Include the name if the client has specified one.
|
2474
|
+
var name = this.get('name');
|
2475
|
+
if (!name) {
|
2476
|
+
return sc_super();
|
2477
|
+
}
|
2478
|
+
else {
|
2479
|
+
var ret = sc_super();
|
2480
|
+
return "%@ (%@)".fmt(name, ret);
|
2481
|
+
}
|
2482
|
+
},
|
2483
|
+
|
2484
|
+
|
2485
|
+
// ..........................................................
|
2486
|
+
// PRIMARY KEY CONVENIENCE METHODS
|
2487
|
+
//
|
2488
|
+
|
2489
|
+
/**
|
2490
|
+
Given a `storeKey`, return the `primaryKey`.
|
2491
|
+
|
2492
|
+
@param {Number} storeKey the store key
|
2493
|
+
@returns {String} primaryKey value
|
2494
|
+
*/
|
2495
|
+
idFor: function(storeKey) {
|
2496
|
+
return SC.Store.idFor(storeKey);
|
2497
|
+
},
|
2498
|
+
|
2499
|
+
/**
|
2500
|
+
Given a storeKey, return the recordType.
|
2501
|
+
|
2502
|
+
@param {Number} storeKey the store key
|
2503
|
+
@returns {SC.Record} record instance
|
2504
|
+
*/
|
2505
|
+
recordTypeFor: function(storeKey) {
|
2506
|
+
return SC.Store.recordTypeFor(storeKey) ;
|
2507
|
+
},
|
2508
|
+
|
2509
|
+
/**
|
2510
|
+
Given a `recordType` and `primaryKey`, find the `storeKey`. If the
|
2511
|
+
`primaryKey` has not been assigned a `storeKey` yet, it will be added.
|
2512
|
+
|
2513
|
+
@param {SC.Record} recordType the record type
|
2514
|
+
@param {String} primaryKey the primary key
|
2515
|
+
@returns {Number} storeKey
|
2516
|
+
*/
|
2517
|
+
storeKeyFor: function(recordType, primaryKey) {
|
2518
|
+
return recordType.storeKeyFor(primaryKey);
|
2519
|
+
},
|
2520
|
+
|
2521
|
+
/**
|
2522
|
+
Given a `primaryKey` value for the record, returns the associated
|
2523
|
+
`storeKey`. As opposed to `storeKeyFor()` however, this method
|
2524
|
+
will **NOT** generate a new `storeKey` but returned `undefined`.
|
2525
|
+
|
2526
|
+
@param {SC.Record} recordType the record type
|
2527
|
+
@param {String} primaryKey the primary key
|
2528
|
+
@returns {Number} a storeKey.
|
2529
|
+
*/
|
2530
|
+
storeKeyExists: function(recordType, primaryKey) {
|
2531
|
+
return recordType.storeKeyExists(primaryKey);
|
2532
|
+
},
|
2533
|
+
|
2534
|
+
/**
|
2535
|
+
Finds all `storeKey`s of a certain record type in this store
|
2536
|
+
and returns an array.
|
2537
|
+
|
2538
|
+
@param {SC.Record} recordType
|
2539
|
+
@returns {Array} set of storeKeys
|
2540
|
+
*/
|
2541
|
+
storeKeysFor: function(recordType) {
|
2542
|
+
var ret = [],
|
2543
|
+
isEnum = recordType && recordType.isEnumerable,
|
2544
|
+
recType, storeKey, isMatch ;
|
2545
|
+
|
2546
|
+
if (!this.statuses) return ret;
|
2547
|
+
for(storeKey in SC.Store.recordTypesByStoreKey) {
|
2548
|
+
recType = SC.Store.recordTypesByStoreKey[storeKey];
|
2549
|
+
|
2550
|
+
// if same record type and this store has it
|
2551
|
+
if (isEnum) isMatch = recordType.contains(recType);
|
2552
|
+
else isMatch = recType === recordType;
|
2553
|
+
|
2554
|
+
if(isMatch && this.statuses[storeKey]) ret.push(parseInt(storeKey, 10));
|
2555
|
+
}
|
2556
|
+
|
2557
|
+
return ret;
|
2558
|
+
},
|
2559
|
+
|
2560
|
+
/**
|
2561
|
+
Finds all `storeKey`s in this store
|
2562
|
+
and returns an array.
|
2563
|
+
|
2564
|
+
@returns {Array} set of storeKeys
|
2565
|
+
*/
|
2566
|
+
storeKeys: function() {
|
2567
|
+
var ret = [], storeKey;
|
2568
|
+
if(!this.statuses) return ret;
|
2569
|
+
|
2570
|
+
for(storeKey in this.statuses) {
|
2571
|
+
// if status is not empty
|
2572
|
+
if(this.statuses[storeKey] != SC.Record.EMPTY) {
|
2573
|
+
ret.push(parseInt(storeKey, 10));
|
2574
|
+
}
|
2575
|
+
}
|
2576
|
+
|
2577
|
+
return ret;
|
2578
|
+
},
|
2579
|
+
|
2580
|
+
/**
|
2581
|
+
Returns string representation of a `storeKey`, with status.
|
2582
|
+
|
2583
|
+
@param {Number} storeKey
|
2584
|
+
@returns {String}
|
2585
|
+
*/
|
2586
|
+
statusString: function(storeKey) {
|
2587
|
+
var rec = this.materializeRecord(storeKey);
|
2588
|
+
return rec.statusString();
|
2589
|
+
}
|
2590
|
+
|
2591
|
+
}) ;
|
2592
|
+
|
2593
|
+
SC.Store.mixin(/** @scope SC.Store.prototype */{
|
2594
|
+
|
2595
|
+
/**
|
2596
|
+
Standard error raised if you try to commit changes from a nested store
|
2597
|
+
and there is a conflict.
|
2598
|
+
|
2599
|
+
@type Error
|
2600
|
+
*/
|
2601
|
+
CHAIN_CONFLICT_ERROR: new Error("Nested Store Conflict"),
|
2602
|
+
|
2603
|
+
/**
|
2604
|
+
Standard error if you try to perform an operation on a nested store
|
2605
|
+
without a parent.
|
2606
|
+
|
2607
|
+
@type Error
|
2608
|
+
*/
|
2609
|
+
NO_PARENT_STORE_ERROR: new Error("Parent Store Required"),
|
2610
|
+
|
2611
|
+
/**
|
2612
|
+
Standard error if you try to perform an operation on a nested store that
|
2613
|
+
is only supported in root stores.
|
2614
|
+
|
2615
|
+
@type Error
|
2616
|
+
*/
|
2617
|
+
NESTED_STORE_UNSUPPORTED_ERROR: new Error("Unsupported In Nested Store"),
|
2618
|
+
|
2619
|
+
/**
|
2620
|
+
Standard error if you try to retrieve a record in a nested store that is
|
2621
|
+
dirty. (This is allowed on the main store, but not in nested stores.)
|
2622
|
+
|
2623
|
+
@type Error
|
2624
|
+
*/
|
2625
|
+
NESTED_STORE_RETRIEVE_DIRTY_ERROR: new Error("Cannot Retrieve Dirty Record in Nested Store"),
|
2626
|
+
|
2627
|
+
/**
|
2628
|
+
Data hash state indicates the data hash is currently editable
|
2629
|
+
|
2630
|
+
@type String
|
2631
|
+
*/
|
2632
|
+
EDITABLE: 'editable',
|
2633
|
+
|
2634
|
+
/**
|
2635
|
+
Data hash state indicates the hash no longer tracks changes from a
|
2636
|
+
parent store, but it is not editable.
|
2637
|
+
|
2638
|
+
@type String
|
2639
|
+
*/
|
2640
|
+
LOCKED: 'locked',
|
2641
|
+
|
2642
|
+
/**
|
2643
|
+
Data hash state indicates the hash is tracking changes from the parent
|
2644
|
+
store and is not editable.
|
2645
|
+
|
2646
|
+
@type String
|
2647
|
+
*/
|
2648
|
+
INHERITED: 'inherited',
|
2649
|
+
|
2650
|
+
/** @private
|
2651
|
+
This array maps all storeKeys to primary keys. You will not normally
|
2652
|
+
access this method directly. Instead use the `idFor()` and
|
2653
|
+
`storeKeyFor()` methods on `SC.Record`.
|
2654
|
+
*/
|
2655
|
+
idsByStoreKey: [],
|
2656
|
+
|
2657
|
+
/** @private
|
2658
|
+
Maps all `storeKey`s to a `recordType`. Once a `storeKey` is associated
|
2659
|
+
with a `primaryKey` and `recordType` that remains constant throughout the
|
2660
|
+
lifetime of the application.
|
2661
|
+
*/
|
2662
|
+
recordTypesByStoreKey: {},
|
2663
|
+
|
2664
|
+
/** @private
|
2665
|
+
Maps some `storeKeys` to query instance. Once a `storeKey` is associated
|
2666
|
+
with a query instance, that remains constant through the lifetime of the
|
2667
|
+
application. If a `Query` is destroyed, it will remove itself from this
|
2668
|
+
list.
|
2669
|
+
|
2670
|
+
Don't access this directly. Use queryFor().
|
2671
|
+
*/
|
2672
|
+
queriesByStoreKey: [],
|
2673
|
+
|
2674
|
+
/** @private
|
2675
|
+
The next store key to allocate. A storeKey must always be greater than 0
|
2676
|
+
*/
|
2677
|
+
nextStoreKey: 1,
|
2678
|
+
|
2679
|
+
/**
|
2680
|
+
Generates a new store key for use.
|
2681
|
+
|
2682
|
+
@type Number
|
2683
|
+
*/
|
2684
|
+
generateStoreKey: function() { return this.nextStoreKey++; },
|
2685
|
+
|
2686
|
+
/**
|
2687
|
+
Given a `storeKey` returns the `primaryKey` associated with the key.
|
2688
|
+
If no `primaryKey` is associated with the `storeKey`, returns `null`.
|
2689
|
+
|
2690
|
+
@param {Number} storeKey the store key
|
2691
|
+
@returns {String} the primary key or null
|
2692
|
+
*/
|
2693
|
+
idFor: function(storeKey) {
|
2694
|
+
return this.idsByStoreKey[storeKey] ;
|
2695
|
+
},
|
2696
|
+
|
2697
|
+
/**
|
2698
|
+
Given a `storeKey`, returns the query object associated with the key. If
|
2699
|
+
no query is associated with the `storeKey`, returns `null`.
|
2700
|
+
|
2701
|
+
@param {Number} storeKey the store key
|
2702
|
+
@returns {SC.Query} query query object
|
2703
|
+
*/
|
2704
|
+
queryFor: function(storeKey) {
|
2705
|
+
return this.queriesByStoreKey[storeKey];
|
2706
|
+
},
|
2707
|
+
|
2708
|
+
/**
|
2709
|
+
Given a `storeKey` returns the `SC.Record` class associated with the key.
|
2710
|
+
If no record type is associated with the store key, returns `null`.
|
2711
|
+
|
2712
|
+
The SC.Record class will only be found if you have already called
|
2713
|
+
storeKeyFor() on the record.
|
2714
|
+
|
2715
|
+
@param {Number} storeKey the store key
|
2716
|
+
@returns {SC.Record} the record type
|
2717
|
+
*/
|
2718
|
+
recordTypeFor: function(storeKey) {
|
2719
|
+
return this.recordTypesByStoreKey[storeKey];
|
2720
|
+
},
|
2721
|
+
|
2722
|
+
/**
|
2723
|
+
Swaps the `primaryKey` mapped to the given storeKey with the new
|
2724
|
+
`primaryKey`. If the `storeKey` is not currently associated with a record
|
2725
|
+
this will raise an exception.
|
2726
|
+
|
2727
|
+
@param {Number} storeKey the existing store key
|
2728
|
+
@param {String} newPrimaryKey the new primary key
|
2729
|
+
@returns {SC.Store} receiver
|
2730
|
+
*/
|
2731
|
+
replaceIdFor: function(storeKey, newId) {
|
2732
|
+
var oldId = this.idsByStoreKey[storeKey],
|
2733
|
+
recordType, storeKeys;
|
2734
|
+
|
2735
|
+
if (oldId !== newId) { // skip if id isn't changing
|
2736
|
+
|
2737
|
+
recordType = this.recordTypeFor(storeKey);
|
2738
|
+
if (!recordType) {
|
2739
|
+
throw new Error("replaceIdFor: storeKey %@ does not exist".fmt(storeKey));
|
2740
|
+
}
|
2741
|
+
|
2742
|
+
// map one direction...
|
2743
|
+
this.idsByStoreKey[storeKey] = newId;
|
2744
|
+
|
2745
|
+
// then the other...
|
2746
|
+
storeKeys = recordType.storeKeysById() ;
|
2747
|
+
delete storeKeys[oldId];
|
2748
|
+
storeKeys[newId] = storeKey;
|
2749
|
+
}
|
2750
|
+
|
2751
|
+
return this ;
|
2752
|
+
},
|
2753
|
+
|
2754
|
+
/**
|
2755
|
+
Swaps the `recordType` recorded for a given `storeKey`. Normally you
|
2756
|
+
should not call this method directly as it can damage the store behavior.
|
2757
|
+
This method is used by other store methods to set the `recordType` for a
|
2758
|
+
`storeKey`.
|
2759
|
+
|
2760
|
+
@param {Integer} storeKey the store key
|
2761
|
+
@param {SC.Record} recordType a record class
|
2762
|
+
@returns {SC.Store} reciever
|
2763
|
+
*/
|
2764
|
+
replaceRecordTypeFor: function(storeKey, recordType) {
|
2765
|
+
this.recordTypesByStoreKey[storeKey] = recordType;
|
2766
|
+
return this ;
|
2767
|
+
}
|
2768
|
+
|
2769
|
+
});
|
2770
|
+
|
2771
|
+
|
2772
|
+
/** @private */
|
2773
|
+
SC.Store.prototype.nextStoreIndex = 1;
|
2774
|
+
|
2775
|
+
// ..........................................................
|
2776
|
+
// COMPATIBILITY
|
2777
|
+
//
|
2778
|
+
|
2779
|
+
/** @private
|
2780
|
+
global store is used only for deprecated compatibility methods. Don't use
|
2781
|
+
this in real code.
|
2782
|
+
*/
|
2783
|
+
SC.Store._getDefaultStore = function() {
|
2784
|
+
var store = this._store;
|
2785
|
+
if(!store) this._store = store = SC.Store.create();
|
2786
|
+
return store;
|
2787
|
+
};
|
2788
|
+
|
2789
|
+
/** @private
|
2790
|
+
|
2791
|
+
DEPRECATED
|
2792
|
+
|
2793
|
+
Included for compatibility, loads data hashes with the named `recordType`.
|
2794
|
+
If no `recordType` is passed, expects to find a `recordType` property in the
|
2795
|
+
data hashes. `dataSource` and `isLoaded` params are ignored.
|
2796
|
+
|
2797
|
+
Calls `SC.Store#loadRecords()` on the default store. Do not use this method in
|
2798
|
+
new code.
|
2799
|
+
|
2800
|
+
@param {Array} dataHashes data hashes to import
|
2801
|
+
@param {Object} dataSource ignored
|
2802
|
+
@param {SC.Record} recordType default record type
|
2803
|
+
@param {Boolean} isLoaded ignored
|
2804
|
+
@returns {Array} SC.Record instances for loaded data hashes
|
2805
|
+
*/
|
2806
|
+
SC.Store.updateRecords = function(dataHashes, dataSource, recordType, isLoaded) {
|
2807
|
+
|
2808
|
+
SC.Logger.warn("SC.Store.updateRecords() is deprecated. Use loadRecords() instead");
|
2809
|
+
|
2810
|
+
var store = this._getDefaultStore(),
|
2811
|
+
len = dataHashes.length,
|
2812
|
+
idx, ret;
|
2813
|
+
|
2814
|
+
// if no recordType was passed, build an array of recordTypes from hashes
|
2815
|
+
if (!recordType) {
|
2816
|
+
recordType = [];
|
2817
|
+
for(idx=0;idx<len;idx++) recordType[idx] = dataHashes[idx].recordType;
|
2818
|
+
}
|
2819
|
+
|
2820
|
+
// call new API. Returns storeKeys
|
2821
|
+
ret = store.loadRecords(recordType, dataHashes);
|
2822
|
+
|
2823
|
+
// map to SC.Record instances
|
2824
|
+
len = ret.length;
|
2825
|
+
for(idx=0;idx<len;idx++) ret[idx] = store.materializeRecord(ret[idx]);
|
2826
|
+
|
2827
|
+
return ret ;
|
2828
|
+
};
|
2829
|
+
|
2830
|
+
/** @private
|
2831
|
+
|
2832
|
+
DEPRECATED
|
2833
|
+
|
2834
|
+
Finds a record with the passed guid on the default store. This is included
|
2835
|
+
only for compatibility. You should use the newer `find()` method defined on
|
2836
|
+
`SC.Store` instead.
|
2837
|
+
|
2838
|
+
@param {String} guid the guid
|
2839
|
+
@param {SC.Record} recordType expected record type
|
2840
|
+
@returns {SC.Record} found record
|
2841
|
+
*/
|
2842
|
+
SC.Store.find = function(guid, recordType) {
|
2843
|
+
return this._getDefaultStore().find(recordType, guid);
|
2844
|
+
};
|
2845
|
+
|
2846
|
+
/** @private
|
2847
|
+
|
2848
|
+
DEPRECATED
|
2849
|
+
|
2850
|
+
Passes through to `findAll` on default store. This is included only for
|
2851
|
+
compatibility. You should use the newer `findAll()` defined on `SC.Store`
|
2852
|
+
instead.
|
2853
|
+
|
2854
|
+
@param {Hash} filter search parameters
|
2855
|
+
@param {SC.Record} recordType type of record to find
|
2856
|
+
@returns {SC.RecordArray} result set
|
2857
|
+
*/
|
2858
|
+
SC.Store.findAll = function(filter, recordType) {
|
2859
|
+
return this._getDefaultStore().findAll(filter, recordType);
|
2860
|
+
};
|