sproutit-sproutcore 1.0.203 → 1.0.20090721145236
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +54 -189
- data/VERSION +1 -0
- data/lib/sproutcore/tools/build.rb +1 -1
- data/lib/sproutcore.rb +1 -9
- 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 +125 -0
- data/spec/buildtasks/manifest/localize_spec.rb +97 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +246 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +87 -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/packed_spec.rb +152 -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 +35 -0
- data/spec/buildtasks/target_spec.rb +214 -0
- data/spec/fixtures/builder_tests/Buildfile +15 -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/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/sass_test/sample.sass +3 -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/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 +16 -0
- data/spec/fixtures/buildfiles/basic/task_module.rake +6 -0
- data/spec/fixtures/buildfiles/installed/Buildfile +7 -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/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/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/lproj/strings.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 +12 -0
- data/spec/fixtures/real_world/apps/account/README +1 -0
- data/spec/fixtures/real_world/apps/calendar/README +1 -0
- data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +1 -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/mobile_photos/README +1 -0
- data/spec/fixtures/real_world/apps/photos/README +1 -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/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/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/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/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/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/recursive_project/Buildfile +8 -0
- data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
- data/spec/lib/builders/combine_spec.rb +67 -0
- data/spec/lib/builders/html_spec.rb +577 -0
- data/spec/lib/builders/javascript_spec.rb +81 -0
- data/spec/lib/builders/sass_spec.rb +43 -0
- data/spec/lib/builders/spec_helper.rb +30 -0
- data/spec/lib/builders/strings_spec.rb +52 -0
- data/spec/lib/builders/stylesheet_spec.rb +63 -0
- data/spec/lib/builders/test_index_spec.rb +44 -0
- data/spec/lib/builders/test_spec.rb +135 -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 +130 -0
- data/spec/lib/buildfile/load_spec.rb +49 -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/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 +64 -0
- data/spec/lib/models/hash_struct/merge_spec.rb +26 -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 +90 -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 +84 -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/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 +77 -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 +125 -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 +119 -0
- data/spec/lib/models/target/target_for_spec.rb +56 -0
- data/spec/lib/tools/build_number_spec.rb +28 -0
- data/spec/lib/tools/gen_spec.rb +207 -0
- data/spec/lib/tools/tools_spec.rb +78 -0
- data/spec/spec_helper.rb +138 -0
- data/sproutcore-abbot.gemspec +640 -0
- data/vendor/jsdoc/templates/jsdoc/allclasses.tmpl +17 -0
- data/vendor/jsdoc/templates/jsdoc/allfiles.tmpl +56 -0
- data/vendor/jsdoc/templates/jsdoc/class.tmpl +487 -0
- data/vendor/jsdoc/templates/jsdoc/index.tmpl +38 -0
- data/vendor/jsdoc/templates/jsdoc/symbol.tmpl +35 -0
- data/vendor/jsdoc/templates/sproutcore/allclasses.tmpl +0 -0
- data/vendor/jsdoc/templates/sproutcore/allfiles.tmpl +56 -0
- data/vendor/jsdoc/templates/sproutcore/class.tmpl +674 -0
- data/vendor/jsdoc/templates/sproutcore/index.tmpl +55 -0
- data/vendor/jsdoc/templates/sproutcore/symbol.tmpl +35 -0
- metadata +351 -664
- data/VERSION.yml +0 -5
- data/frameworks/sproutcore/Buildfile +0 -64
- data/frameworks/sproutcore/HISTORY +0 -682
- data/frameworks/sproutcore/README +0 -23
- data/frameworks/sproutcore/apps/docs/core.js +0 -27
- data/frameworks/sproutcore/apps/docs/english.lproj/loading.rhtml +0 -9
- data/frameworks/sproutcore/apps/docs/english.lproj/main_page.js +0 -22
- data/frameworks/sproutcore/apps/docs/english.lproj/strings.js +0 -15
- data/frameworks/sproutcore/apps/docs/main.js +0 -30
- data/frameworks/sproutcore/apps/tests/controllers/detail.js +0 -16
- data/frameworks/sproutcore/apps/tests/controllers/source.js +0 -29
- data/frameworks/sproutcore/apps/tests/controllers/target.js +0 -26
- data/frameworks/sproutcore/apps/tests/controllers/targets.js +0 -86
- data/frameworks/sproutcore/apps/tests/controllers/tests.js +0 -33
- data/frameworks/sproutcore/apps/tests/core.js +0 -133
- data/frameworks/sproutcore/apps/tests/data_source.js +0 -96
- data/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +0 -9
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +0 -39
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +0 -232
- data/frameworks/sproutcore/apps/tests/english.lproj/strings.js +0 -26
- data/frameworks/sproutcore/apps/tests/fixtures/target.js +0 -87
- data/frameworks/sproutcore/apps/tests/fixtures/test.js +0 -44
- data/frameworks/sproutcore/apps/tests/main.js +0 -28
- data/frameworks/sproutcore/apps/tests/models/target.js +0 -92
- data/frameworks/sproutcore/apps/tests/models/test.js +0 -48
- data/frameworks/sproutcore/apps/tests/states/no_targets.js +0 -26
- data/frameworks/sproutcore/apps/tests/states/ready.js +0 -56
- data/frameworks/sproutcore/apps/tests/states/ready_detail.js +0 -41
- data/frameworks/sproutcore/apps/tests/states/ready_empty.js +0 -48
- data/frameworks/sproutcore/apps/tests/states/ready_list.js +0 -41
- data/frameworks/sproutcore/apps/tests/states/ready_loading.js +0 -44
- data/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +0 -31
- data/frameworks/sproutcore/apps/tests/states/start.js +0 -39
- data/frameworks/sproutcore/apps/tests/tests/controllers/detail.js +0 -15
- data/frameworks/sproutcore/apps/tests/tests/controllers/source.js +0 -15
- data/frameworks/sproutcore/apps/tests/tests/controllers/target.js +0 -15
- data/frameworks/sproutcore/apps/tests/tests/controllers/targets.js +0 -15
- data/frameworks/sproutcore/apps/tests/tests/controllers/tests.js +0 -15
- data/frameworks/sproutcore/apps/tests/tests/models/target.js +0 -15
- data/frameworks/sproutcore/apps/tests/tests/models/test.js +0 -15
- data/frameworks/sproutcore/apps/tests/tests/views/offset_checkbox.js +0 -15
- data/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +0 -26
- data/frameworks/sproutcore/apps/welcome/core.js +0 -23
- data/frameworks/sproutcore/apps/welcome/english.lproj/loading.rhtml +0 -8
- data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +0 -43
- data/frameworks/sproutcore/apps/welcome/english.lproj/strings.js +0 -15
- data/frameworks/sproutcore/apps/welcome/main.js +0 -36
- data/frameworks/sproutcore/design/Record State Table.numbers +0 -0
- data/frameworks/sproutcore/frameworks/datastore/core.js +0 -14
- data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +0 -113
- data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +0 -273
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +0 -311
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures_with_queries.js +0 -238
- data/frameworks/sproutcore/frameworks/datastore/debug/json.js +0 -71
- data/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +0 -96
- data/frameworks/sproutcore/frameworks/datastore/fixtures/author_fixtures.js +0 -2503
- data/frameworks/sproutcore/frameworks/datastore/fixtures/sample.js +0 -17
- data/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +0 -92
- data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +0 -54
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +0 -561
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +0 -423
- data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +0 -158
- data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +0 -488
- data/frameworks/sproutcore/frameworks/datastore/system/query.js +0 -979
- data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +0 -287
- data/frameworks/sproutcore/frameworks/datastore/system/store.js +0 -2007
- data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +0 -121
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +0 -114
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +0 -91
- data/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +0 -56
- data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +0 -94
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +0 -30
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +0 -73
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +0 -238
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +0 -48
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +0 -42
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +0 -138
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +0 -46
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +0 -71
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +0 -204
- data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +0 -178
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +0 -40
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +0 -117
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +0 -135
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +0 -110
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +0 -99
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +0 -180
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +0 -126
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +0 -163
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +0 -166
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare_records.js +0 -126
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +0 -165
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +0 -82
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/find_all.js +0 -362
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parsing.js +0 -170
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +0 -43
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +0 -60
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +0 -67
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +0 -164
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +0 -54
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +0 -126
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +0 -126
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +0 -73
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +0 -72
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +0 -78
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +0 -249
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +0 -106
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +0 -21
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +0 -61
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +0 -74
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +0 -74
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +0 -74
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +0 -144
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +0 -137
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +0 -130
- data/frameworks/sproutcore/frameworks/debug/core.js +0 -61
- data/frameworks/sproutcore/frameworks/deprecated/core.js +0 -59
- data/frameworks/sproutcore/frameworks/deprecated/lib/button_views.rb +0 -330
- data/frameworks/sproutcore/frameworks/deprecated/lib/collection_view.rb +0 -83
- data/frameworks/sproutcore/frameworks/deprecated/lib/core_views.rb +0 -326
- data/frameworks/sproutcore/frameworks/deprecated/lib/form_views.rb +0 -253
- data/frameworks/sproutcore/frameworks/deprecated/lib/index.rhtml +0 -75
- data/frameworks/sproutcore/frameworks/deprecated/lib/menu_views.rb +0 -93
- data/frameworks/sproutcore/frameworks/deprecated/server/rails_server.js +0 -80
- data/frameworks/sproutcore/frameworks/deprecated/server/rest_server.js +0 -178
- data/frameworks/sproutcore/frameworks/deprecated/server/server.js +0 -673
- data/frameworks/sproutcore/frameworks/deprecated/system/animator.js +0 -679
- data/frameworks/sproutcore/frameworks/deprecated/system/binding.js +0 -36
- data/frameworks/sproutcore/frameworks/deprecated/system/browser.js +0 -75
- data/frameworks/sproutcore/frameworks/deprecated/system/classic_responder.js +0 -312
- data/frameworks/sproutcore/frameworks/deprecated/system/event.js +0 -58
- data/frameworks/sproutcore/frameworks/deprecated/system/globals.js +0 -20
- data/frameworks/sproutcore/frameworks/deprecated/system/misc.js +0 -58
- data/frameworks/sproutcore/frameworks/deprecated/system/node_descriptor.js +0 -72
- data/frameworks/sproutcore/frameworks/deprecated/system/object.js +0 -122
- data/frameworks/sproutcore/frameworks/deprecated/system/path_module.js +0 -432
- data/frameworks/sproutcore/frameworks/deprecated/system/string.js +0 -107
- data/frameworks/sproutcore/frameworks/deprecated/tests/application/application.rhtml +0 -125
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/clippingFrame.rhtml +0 -401
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/frame.rhtml +0 -357
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/isVisibleInWindow.rhtml +0 -147
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/base.rhtml +0 -298
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/incremental_rendering.rhtml +0 -260
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/source_list_rendering.rhtml +0 -143
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/popup_button.rhtml +0 -128
- data/frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml +0 -37
- data/frameworks/sproutcore/frameworks/deprecated/views/collection.js +0 -24
- data/frameworks/sproutcore/frameworks/designer/coders/design.js +0 -29
- data/frameworks/sproutcore/frameworks/designer/coders/localization.js +0 -27
- data/frameworks/sproutcore/frameworks/designer/coders/object.js +0 -347
- data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +0 -102
- data/frameworks/sproutcore/frameworks/designer/css/css_rule.js +0 -22
- data/frameworks/sproutcore/frameworks/designer/css/css_style.js +0 -29
- data/frameworks/sproutcore/frameworks/designer/css/css_style_sheet.js +0 -201
- data/frameworks/sproutcore/frameworks/designer/ext/page.js +0 -86
- data/frameworks/sproutcore/frameworks/designer/ext/view.js +0 -38
- data/frameworks/sproutcore/frameworks/designer/views/controls/button.js +0 -17
- data/frameworks/sproutcore/frameworks/designer/views/designer.js +0 -569
- data/frameworks/sproutcore/frameworks/designer/views/label.js +0 -16
- data/frameworks/sproutcore/frameworks/designer/views/mixins/button.js +0 -11
- data/frameworks/sproutcore/frameworks/designer/views/tab.js +0 -16
- data/frameworks/sproutcore/frameworks/desktop/core.js +0 -6
- data/frameworks/sproutcore/frameworks/desktop/debug/drag.js +0 -41
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +0 -56
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/a_sample_image.jpg +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/apple-logo1.jpeg +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/iframe.html +0 -23
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +0 -71
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +0 -6
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +0 -943
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_222222.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_454545.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_888888.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_ffffff.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/indicator.gif +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-x.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-y.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/000000.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/ffffff.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sticky-note.png +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +0 -209
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +0 -100
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +0 -5
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +0 -95
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +0 -39
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +0 -31
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +0 -10
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/scroller.css +0 -26
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +0 -141
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +0 -19
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +0 -62
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +0 -70
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +0 -9
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +0 -14
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +0 -12
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/toolbar.css +0 -6
- data/frameworks/sproutcore/frameworks/desktop/mixins/border.js +0 -53
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +0 -22
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +0 -61
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +0 -283
- data/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +0 -247
- data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +0 -408
- data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +0 -651
- data/frameworks/sproutcore/frameworks/desktop/panes/modal.js +0 -68
- data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +0 -63
- data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +0 -184
- data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +0 -400
- data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +0 -46
- data/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +0 -39
- data/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +0 -81
- data/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +0 -175
- data/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +0 -280
- data/frameworks/sproutcore/frameworks/desktop/system/drag.js +0 -827
- data/frameworks/sproutcore/frameworks/desktop/system/key_bindings.js +0 -40
- data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +0 -641
- data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +0 -187
- data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +0 -43
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +0 -152
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +0 -55
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +0 -59
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +0 -35
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +0 -40
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +0 -84
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +0 -38
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +0 -45
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +0 -159
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +0 -144
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +0 -99
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +0 -249
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +0 -82
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +0 -199
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +0 -288
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +0 -65
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +0 -88
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +0 -165
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +0 -121
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +0 -177
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +0 -240
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +0 -191
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +0 -197
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +0 -141
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +0 -182
- data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +0 -64
- data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +0 -183
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +0 -133
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +0 -132
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +0 -56
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +0 -167
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +0 -127
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +0 -284
- data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +0 -44
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +0 -128
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +0 -240
- data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +0 -113
- data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +0 -202
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +0 -139
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +0 -111
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +0 -102
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +0 -70
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +0 -95
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +0 -222
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +0 -81
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +0 -100
- data/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +0 -37
- data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +0 -50
- data/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +0 -52
- data/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +0 -231
- data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +0 -54
- data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +0 -88
- data/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +0 -110
- data/frameworks/sproutcore/frameworks/desktop/views/button.js +0 -331
- data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +0 -105
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +0 -2757
- data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +0 -44
- data/frameworks/sproutcore/frameworks/desktop/views/form.js +0 -594
- data/frameworks/sproutcore/frameworks/desktop/views/grid.js +0 -201
- data/frameworks/sproutcore/frameworks/desktop/views/list.js +0 -540
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +0 -660
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +0 -587
- data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +0 -68
- data/frameworks/sproutcore/frameworks/desktop/views/progress.js +0 -207
- data/frameworks/sproutcore/frameworks/desktop/views/radio.js +0 -332
- data/frameworks/sproutcore/frameworks/desktop/views/scene.js +0 -204
- data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +0 -690
- data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +0 -226
- data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +0 -525
- data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +0 -331
- data/frameworks/sproutcore/frameworks/desktop/views/separator.js +0 -37
- data/frameworks/sproutcore/frameworks/desktop/views/slider.js +0 -180
- data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +0 -47
- data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +0 -169
- data/frameworks/sproutcore/frameworks/desktop/views/split.js +0 -677
- data/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +0 -55
- data/frameworks/sproutcore/frameworks/desktop/views/stacked.js +0 -101
- data/frameworks/sproutcore/frameworks/desktop/views/tab.js +0 -191
- data/frameworks/sproutcore/frameworks/desktop/views/thumb.js +0 -49
- data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +0 -49
- data/frameworks/sproutcore/frameworks/desktop/views/web.js +0 -86
- data/frameworks/sproutcore/frameworks/foundation/TESTING +0 -46
- data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +0 -509
- data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +0 -45
- data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +0 -323
- data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +0 -109
- data/frameworks/sproutcore/frameworks/foundation/core.js +0 -136
- data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +0 -194
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/blank.gif +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +0 -68
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +0 -55
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +0 -221
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +0 -9
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-logo.png +0 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +0 -30
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/static_layout.css +0 -5
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/strings.js +0 -15
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +0 -45
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +0 -45
- data/frameworks/sproutcore/frameworks/foundation/ext/object.js +0 -81
- data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +0 -158
- data/frameworks/sproutcore/frameworks/foundation/fixtures/file_exists.json +0 -1
- data/frameworks/sproutcore/frameworks/foundation/license.js +0 -19
- data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +0 -299
- data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +0 -171
- data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +0 -88
- data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +0 -352
- data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +0 -146
- data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +0 -462
- data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +0 -232
- data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +0 -132
- data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +0 -251
- data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +0 -159
- data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +0 -176
- data/frameworks/sproutcore/frameworks/foundation/panes/main.js +0 -47
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +0 -584
- data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +0 -887
- data/frameworks/sproutcore/frameworks/foundation/protocols/inline_editor_delegate.js +0 -84
- data/frameworks/sproutcore/frameworks/foundation/system/application.js +0 -36
- data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +0 -492
- data/frameworks/sproutcore/frameworks/foundation/system/browser.js +0 -64
- data/frameworks/sproutcore/frameworks/foundation/system/builder.js +0 -210
- data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +0 -2015
- data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +0 -129
- data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +0 -729
- data/frameworks/sproutcore/frameworks/foundation/system/error.js +0 -93
- data/frameworks/sproutcore/frameworks/foundation/system/event.js +0 -853
- data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +0 -433
- data/frameworks/sproutcore/frameworks/foundation/system/json.js +0 -440
- data/frameworks/sproutcore/frameworks/foundation/system/locale.js +0 -288
- data/frameworks/sproutcore/frameworks/foundation/system/page.js +0 -106
- data/frameworks/sproutcore/frameworks/foundation/system/ready.js +0 -195
- data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +0 -904
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +0 -380
- data/frameworks/sproutcore/frameworks/foundation/system/responder.js +0 -120
- data/frameworks/sproutcore/frameworks/foundation/system/responder_context.js +0 -243
- data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +0 -391
- data/frameworks/sproutcore/frameworks/foundation/system/routes.js +0 -487
- data/frameworks/sproutcore/frameworks/foundation/system/time.js +0 -478
- data/frameworks/sproutcore/frameworks/foundation/system/timer.js +0 -549
- data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +0 -165
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +0 -425
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +0 -182
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +0 -193
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +0 -64
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +0 -136
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/empty_case.js +0 -82
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/multiple_case.js +0 -111
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_case.js +0 -193
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_enumerable_case.js +0 -179
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +0 -108
- data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +0 -113
- data/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +0 -113
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/content.js +0 -195
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +0 -89
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +0 -35
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/content.js +0 -168
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +0 -89
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +0 -128
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +0 -17
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +0 -325
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +0 -718
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +0 -484
- data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +0 -42
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +0 -1323
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_dimensions.js +0 -387
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_selector.js +0 -405
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/setClass.js +0 -49
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/within.js +0 -66
- data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +0 -151
- data/frameworks/sproutcore/frameworks/foundation/tests/system/error.js +0 -41
- data/frameworks/sproutcore/frameworks/foundation/tests/system/json.js +0 -14
- data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +0 -128
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/begin.js +0 -47
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/element.js +0 -44
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/end.js +0 -119
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +0 -51
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +0 -50
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +0 -28
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +0 -179
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +0 -100
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/init.js +0 -55
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/join.js +0 -28
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/push_text.js +0 -74
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +0 -45
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +0 -205
- data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +0 -127
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeKeyPane.js +0 -124
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMainPane.js +0 -68
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/root_responder.js +0 -101
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +0 -238
- data/frameworks/sproutcore/frameworks/foundation/tests/system/routes.js +0 -33
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invalidate.js +0 -38
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invokeLater.js +0 -201
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +0 -71
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +0 -67
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/schedule.js +0 -170
- data/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js +0 -27
- data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/normalizeURL.js +0 -18
- data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/range.js +0 -62
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +0 -35
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +0 -23
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +0 -47
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js +0 -13
- data/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +0 -83
- data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +0 -39
- data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +0 -148
- data/frameworks/sproutcore/frameworks/foundation/tests/views/main_pane.js +0 -31
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +0 -89
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/firstResponder.js +0 -148
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/keyPane.js +0 -133
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendEvent.js +0 -165
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +0 -76
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +0 -250
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +0 -133
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +0 -246
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +0 -122
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createLayer.js +0 -97
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +0 -85
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +0 -52
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/init.js +0 -50
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +0 -200
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisible.js +0 -51
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisibleInWindow.js +0 -113
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layer.js +0 -150
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutChildViews.js +0 -162
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutDidChange.js +0 -127
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +0 -328
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/parentViewDidChange.js +0 -67
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +0 -166
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/removeChild.js +0 -189
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/render.js +0 -83
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/replaceChild.js +0 -29
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +0 -146
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayerLocation.js +0 -194
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/viewDidResize.js +0 -185
- data/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +0 -125
- data/frameworks/sproutcore/frameworks/foundation/validators/date.js +0 -52
- data/frameworks/sproutcore/frameworks/foundation/validators/email.js +0 -45
- data/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +0 -33
- data/frameworks/sproutcore/frameworks/foundation/validators/number.js +0 -82
- data/frameworks/sproutcore/frameworks/foundation/validators/password.js +0 -86
- data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +0 -311
- data/frameworks/sproutcore/frameworks/foundation/views/container.js +0 -136
- data/frameworks/sproutcore/frameworks/foundation/views/field.js +0 -287
- data/frameworks/sproutcore/frameworks/foundation/views/image.js +0 -161
- data/frameworks/sproutcore/frameworks/foundation/views/label.js +0 -271
- data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +0 -257
- data/frameworks/sproutcore/frameworks/foundation/views/view.js +0 -2405
- data/frameworks/sproutcore/frameworks/mobile/english.lproj/core.css +0 -12
- data/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml +0 -126
- data/frameworks/sproutcore/frameworks/mobile/system/root_responder.js +0 -109
- data/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js +0 -9
- data/frameworks/sproutcore/frameworks/mobile/views/button.js +0 -190
- data/frameworks/sproutcore/frameworks/runtime/README +0 -12
- data/frameworks/sproutcore/frameworks/runtime/core.js +0 -856
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +0 -238
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +0 -33
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +0 -121
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +0 -34
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +0 -50
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +0 -46
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +0 -371
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +0 -100
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +0 -49
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +0 -94
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +0 -50
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +0 -47
- data/frameworks/sproutcore/frameworks/runtime/license.js +0 -28
- data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +0 -613
- data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +0 -64
- data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +0 -108
- data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +0 -1258
- data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +0 -104
- data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +0 -1305
- data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +0 -141
- data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +0 -148
- data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +0 -152
- data/frameworks/sproutcore/frameworks/runtime/protocols/observable_protocol.js +0 -40
- data/frameworks/sproutcore/frameworks/runtime/protocols/sparse_array_delegate.js +0 -131
- data/frameworks/sproutcore/frameworks/runtime/system/binding.js +0 -915
- data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +0 -107
- data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +0 -1166
- data/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -801
- data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +0 -265
- data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +0 -241
- data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +0 -649
- data/frameworks/sproutcore/frameworks/runtime/system/set.js +0 -375
- data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +0 -295
- data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +0 -56
- data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +0 -23
- data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +0 -66
- data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +0 -44
- data/frameworks/sproutcore/frameworks/runtime/tests/core/console.js +0 -16
- data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +0 -147
- data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +0 -25
- data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +0 -38
- data/frameworks/sproutcore/frameworks/runtime/tests/core/keys.js +0 -20
- data/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +0 -30
- data/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +0 -19
- data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +0 -37
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +0 -57
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +0 -611
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +0 -587
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +0 -132
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +0 -79
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +0 -80
- data/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +0 -55
- data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +0 -265
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +0 -195
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +0 -43
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +0 -74
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +0 -42
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +0 -38
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +0 -38
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +0 -74
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +0 -40
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +0 -40
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +0 -36
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +0 -189
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +0 -89
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +0 -135
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +0 -339
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +0 -59
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +0 -75
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +0 -117
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +0 -110
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +0 -65
- data/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +0 -120
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/add.js +0 -92
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +0 -17
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +0 -85
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/isEqual.js +0 -60
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +0 -87
- data/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +0 -292
- data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +0 -122
- data/frameworks/sproutcore/frameworks/testing/core.js +0 -196
- data/frameworks/sproutcore/frameworks/testing/english.lproj/additions.css +0 -8
- data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +0 -126
- data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +0 -131
- data/frameworks/sproutcore/frameworks/testing/extras.js +0 -17
- data/frameworks/sproutcore/frameworks/testing/jquery.js +0 -3559
- data/frameworks/sproutcore/frameworks/testing/qunit.js +0 -827
- data/frameworks/sproutcore/frameworks/testing/system/dump.js +0 -205
- data/frameworks/sproutcore/frameworks/testing/system/equiv.js +0 -201
- data/frameworks/sproutcore/frameworks/testing/system/plan.js +0 -691
- data/frameworks/sproutcore/frameworks/testing/system/runner.js +0 -209
- data/frameworks/sproutcore/frameworks/testing/system/suite.js +0 -228
- data/frameworks/sproutcore/frameworks/testing/utils.js +0 -62
- data/frameworks/sproutcore/lib/index.rhtml +0 -121
- data/frameworks/sproutcore/license.js +0 -28
- data/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +0 -69
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/button.css +0 -41
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/core.css +0 -8
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/backButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/blueButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/cancel.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/grayButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/leftButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrow.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrowSel.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listGroup.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/loading.gif +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/pinstripes.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/rightButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/selection.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/thumb.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggle.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggleOn.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolbar.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/whiteButton.png +0 -0
- data/frameworks/sproutcore/themes/iphone_theme/english.lproj/strings.js +0 -15
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +0 -331
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +0 -91
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +0 -134
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/core.css +0 -60
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +0 -55
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-ysprite.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-toolbar-view.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/label.css +0 -11
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +0 -30
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/pane.css +0 -8
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/background-fat.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/background-thin.jpg +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-left-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-right-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/left-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/overlay.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/right-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-edge.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-left-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-right-corner.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +0 -26
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +0 -122
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +0 -279
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/slider.css +0 -94
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +0 -27
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +0 -18
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +0 -10
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/toolbar.css +0 -7
- data/lib/thor/CHANGELOG.rdoc +0 -52
- data/lib/thor/LICENSE +0 -20
- data/lib/thor/README.markdown +0 -76
- data/lib/thor/Rakefile +0 -6
- data/lib/thor/Thorfile +0 -45
- data/lib/thor/bin/rake2thor +0 -83
- data/lib/thor/bin/thor +0 -7
- data/lib/thor/lib/thor/error.rb +0 -3
- data/lib/thor/lib/thor/options.rb +0 -267
- data/lib/thor/lib/thor/ordered_hash.rb +0 -64
- data/lib/thor/lib/thor/runner.rb +0 -305
- data/lib/thor/lib/thor/task.rb +0 -83
- data/lib/thor/lib/thor/task_hash.rb +0 -22
- data/lib/thor/lib/thor/tasks/package.rb +0 -18
- data/lib/thor/lib/thor/tasks.rb +0 -77
- data/lib/thor/lib/thor/util.rb +0 -75
- data/lib/thor/lib/thor.rb +0 -170
- data/lib/thor/script/destroy +0 -14
- data/lib/thor/script/generate +0 -14
- data/lib/thor/task.thor +0 -15
@@ -1,2015 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: SproutCore - JavaScript Application Framework
|
3
|
-
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
-
// Portions ©2008-2009 Apple, Inc. All rights reserved.
|
5
|
-
// License: Licened under MIT license (see license.js)
|
6
|
-
// ==========================================================================
|
7
|
-
|
8
|
-
require('system/builder') ;
|
9
|
-
|
10
|
-
/**
|
11
|
-
CoreQuery is a simplified DOM manipulation library used internally by
|
12
|
-
SproutCore to find and edit DOM elements. Outside of SproutCore, you
|
13
|
-
should generally use a more full-featured DOM library such as Prototype
|
14
|
-
or jQuery.
|
15
|
-
|
16
|
-
CoreQuery itself is a subset of jQuery with some additional plugins. If
|
17
|
-
you have jQuery already loaded when SproutCore loads, in fact, it will
|
18
|
-
replace CoreQuery with the full jQuery library and install any CoreQuery
|
19
|
-
plugins, including support for the SC.Enumerable mixin.
|
20
|
-
|
21
|
-
Much of this code is adapted from jQuery 1.2.6, which is available under an
|
22
|
-
MIT license just like SproutCore.
|
23
|
-
|
24
|
-
h1. Using CoreQuery
|
25
|
-
|
26
|
-
You can work with CoreQuery much like you would work with jQuery. The core
|
27
|
-
manipulation object is exposed as SC.$. To find some elements on the page
|
28
|
-
you just pass in a selector like this:
|
29
|
-
|
30
|
-
{{{
|
31
|
-
var cq = SC.$('p');
|
32
|
-
}}}
|
33
|
-
|
34
|
-
The object returned from this call is a CoreQuery object that implements
|
35
|
-
SC.Enumerable as well as a number of other useful manipulation methods.
|
36
|
-
Often times we call this object the "matched set", because it usually an
|
37
|
-
array of elements matching the selector key you passed.
|
38
|
-
|
39
|
-
To work with the matched set, just call the various helper methods on it.
|
40
|
-
Here are some of the more useful ones:
|
41
|
-
|
42
|
-
{{{
|
43
|
-
// change all of the text red
|
44
|
-
cq.css('color','red');
|
45
|
-
|
46
|
-
// hide/show the set
|
47
|
-
cq.hide(); cq.show();
|
48
|
-
|
49
|
-
// set the text content of the set
|
50
|
-
cq.text("Hello World!");
|
51
|
-
|
52
|
-
}}}
|
53
|
-
|
54
|
-
Of course, you can also chain these methods, just like jQuery. Here is
|
55
|
-
how you might find all of the headings in your page, change their text and
|
56
|
-
color:
|
57
|
-
|
58
|
-
{{{
|
59
|
-
SC.$('h1').text('Hello World!').css('color','red');
|
60
|
-
}}}
|
61
|
-
|
62
|
-
h1. Using CoreQuery with Views
|
63
|
-
|
64
|
-
Usually you will not want to just blindly edit the HTML content in your
|
65
|
-
application. Instead, you will use CoreQuery to update the portion of the
|
66
|
-
page managed by your SC.View instances. Every SC.View instance has a $()
|
67
|
-
property just like SC.$(). The difference is that this function will start
|
68
|
-
searching from the root of the view. For example, you could use the
|
69
|
-
following code in your updateDisplay method to set your content and color:
|
70
|
-
|
71
|
-
{{{
|
72
|
-
updateDisplay: function() {
|
73
|
-
this.$().text(this.get('value')).css('color','red');
|
74
|
-
}
|
75
|
-
}}}
|
76
|
-
|
77
|
-
You could also work on content within your view, for example this will
|
78
|
-
change the title on your view held in the span.title element:
|
79
|
-
|
80
|
-
{{{
|
81
|
-
updateDisplay: function() {
|
82
|
-
this.$('span.title').text('Hello World');
|
83
|
-
this.$().setClassName('sc-enabled', YES) ;
|
84
|
-
}
|
85
|
-
}}}
|
86
|
-
|
87
|
-
@class
|
88
|
-
@extends SC.Builder.fn
|
89
|
-
*/
|
90
|
-
SC.CoreQuery = (function() {
|
91
|
-
// Define CoreQuery inside of its own scope to support some jQuery idioms.
|
92
|
-
|
93
|
-
// A simple way to check for HTML strings or ID strings
|
94
|
-
// (both of which we optimize for)
|
95
|
-
var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
|
96
|
-
// Is it a simple selector
|
97
|
-
isSimple = /^.[^:#\[\.]*$/,
|
98
|
-
undefined ;
|
99
|
-
|
100
|
-
var styleFloat = SC.browser.msie ? "styleFloat" : "cssFloat";
|
101
|
-
|
102
|
-
// used for the find() method.
|
103
|
-
var chars = (SC.browser.safari && parseInt(SC.browser.version,0) < 417) ?
|
104
|
-
"(?:[\\w*_-]|\\\\.)" :
|
105
|
-
"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)" ;
|
106
|
-
var quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)") ;
|
107
|
-
var singleClass = new RegExp("^([#.]?)(" + chars + "*)");
|
108
|
-
var quickSplit = new RegExp("([#.]?)(" + chars + "*)",'g');
|
109
|
-
|
110
|
-
// Constants used in CQ.css()
|
111
|
-
var LEFT_RIGHT = ["Left", "Right"];
|
112
|
-
var TOP_BOTTOM = ["Top", "Bottom"];
|
113
|
-
var CSS_DISPLAY_PROPS = {
|
114
|
-
position: "absolute", visibility: "hidden", display:"block"
|
115
|
-
} ;
|
116
|
-
|
117
|
-
var getWH = function getWH(elem, name, which) {
|
118
|
-
var val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
|
119
|
-
var padding = 0, border = 0, loc=which.length, dim;
|
120
|
-
while(--loc>=0) {
|
121
|
-
dim = which[loc];
|
122
|
-
padding += parseFloat(CQ.curCSS( elem, "padding" + dim, true)) || 0;
|
123
|
-
border += parseFloat(CQ.curCSS( elem, "border" + dim + "Width", true)) ||0;
|
124
|
-
}
|
125
|
-
val -= Math.round(padding + border);
|
126
|
-
return val;
|
127
|
-
} ;
|
128
|
-
|
129
|
-
var expando = SC.guidKey, uuid = 0, windowData = {},
|
130
|
-
// exclude the following css properties to add px
|
131
|
-
exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
|
132
|
-
// cache defaultView
|
133
|
-
defaultView = document.defaultView || {};
|
134
|
-
|
135
|
-
// A helper method for determining if an element's values are broken
|
136
|
-
var styleIsBorked = function styleIsBorked( elem ) {
|
137
|
-
if ( !SC.browser.safari ) return false;
|
138
|
-
|
139
|
-
// defaultView is cached
|
140
|
-
var ret = defaultView.getComputedStyle( elem, null );
|
141
|
-
return !ret || ret.getPropertyValue("color") == "";
|
142
|
-
} ;
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
// Helper function used by the dimensions and offset modules
|
147
|
-
function num(elem, prop) {
|
148
|
-
return elem[0] && parseInt( CQ.curCSS(elem[0], prop, true), 10 ) || 0;
|
149
|
-
} ;
|
150
|
-
|
151
|
-
var CoreQuery, CQ ;
|
152
|
-
|
153
|
-
// implement core methods here from jQuery that we want available all the
|
154
|
-
// time. Use this area to implement jQuery-compatible methods ONLY.
|
155
|
-
// New methods should be added at the bottom of the file, where they will
|
156
|
-
// be installed as plugins on CoreQuery or jQuery.
|
157
|
-
CQ = CoreQuery = SC.Builder.create( /** @scope SC.CoreQuery.fn */ {
|
158
|
-
|
159
|
-
/** Indicates that this is a jQuery-like object. */
|
160
|
-
jquery: 'SC.CoreQuery',
|
161
|
-
|
162
|
-
/**
|
163
|
-
Called on a new CoreQuery instance when it is first created. You
|
164
|
-
can pass a variety of options to the CoreQuery constructor function
|
165
|
-
including:
|
166
|
-
|
167
|
-
- a simple selector: this will find the element and return it
|
168
|
-
- element or array of elements - this will return a query with them
|
169
|
-
- html-string: this will convert to DOM.
|
170
|
-
|
171
|
-
@returns {CoreQuery} CoreQuery instance
|
172
|
-
*/
|
173
|
-
init: function( selector, context ) {
|
174
|
-
|
175
|
-
// Make sure that a selection was provided
|
176
|
-
selector = selector || document;
|
177
|
-
|
178
|
-
// Handle $(DOMElement)
|
179
|
-
if ( selector.nodeType ) {
|
180
|
-
this[0] = selector;
|
181
|
-
this.length = 1;
|
182
|
-
return this ;
|
183
|
-
|
184
|
-
// Handle HTML strings
|
185
|
-
} else if ( typeof selector == "string" ) {
|
186
|
-
// Are we dealing with HTML string or an ID?
|
187
|
-
var match = quickExpr.exec( selector );
|
188
|
-
|
189
|
-
// Verify a match, and that no context was specified for #id
|
190
|
-
if ( match && (match[1] || !context) ) {
|
191
|
-
|
192
|
-
// HANDLE: $(html) -> $(array)
|
193
|
-
if ( match[1] )
|
194
|
-
selector = CQ.clean( [ match[1] ], context );
|
195
|
-
|
196
|
-
// HANDLE: $("#id")
|
197
|
-
else {
|
198
|
-
var elem = document.getElementById( match[3] );
|
199
|
-
|
200
|
-
// Make sure an element was located
|
201
|
-
if ( elem ){
|
202
|
-
// Handle the case where IE and Opera return items
|
203
|
-
// by name instead of ID
|
204
|
-
if ( elem.id != match[3] ) return CQ().find( selector );
|
205
|
-
|
206
|
-
// Otherwise, we inject the element directly into the jQuery object
|
207
|
-
return CQ( elem );
|
208
|
-
}
|
209
|
-
selector = [];
|
210
|
-
}
|
211
|
-
|
212
|
-
// HANDLE: $(expr, [context])
|
213
|
-
// (which is just equivalent to: $(content).find(expr)
|
214
|
-
} else return CQ( context ).find( selector );
|
215
|
-
|
216
|
-
// HANDLE: $(function)
|
217
|
-
// Shortcut for document ready
|
218
|
-
} else if (SC.typeOf(selector) === SC.T_FUNCTION) {
|
219
|
-
return SC.ready(selector);
|
220
|
-
}
|
221
|
-
|
222
|
-
return this.setArray(CQ.makeArray(selector));
|
223
|
-
},
|
224
|
-
|
225
|
-
/** Return the number of elements in the matched set. */
|
226
|
-
size: function() { return this.length; },
|
227
|
-
|
228
|
-
/** Return the nth element of the working array OR return a clean array
|
229
|
-
with the result set, if no number is passed.
|
230
|
-
|
231
|
-
@param {Number} num (Optional)
|
232
|
-
@returns {Object|Array}
|
233
|
-
*/
|
234
|
-
get: function( num ) {
|
235
|
-
return num == undefined ? CQ.makeArray(this) : this[num];
|
236
|
-
},
|
237
|
-
|
238
|
-
/**
|
239
|
-
Find subelements matching the passed selector. Note that CoreQuery
|
240
|
-
supports only a very simplified selector search method. See
|
241
|
-
CoreQuery.find() for more information.
|
242
|
-
|
243
|
-
@param {String} selector
|
244
|
-
@returns {CoreQuery} new instance with match
|
245
|
-
*/
|
246
|
-
find: function( selector ) {
|
247
|
-
var elems = CQ.map(this, function(elem){
|
248
|
-
return CQ.find( selector, elem );
|
249
|
-
});
|
250
|
-
|
251
|
-
return this.pushStack(elems);
|
252
|
-
},
|
253
|
-
|
254
|
-
/**
|
255
|
-
Filters the matching set to include only those matching the passed
|
256
|
-
selector. Note that CoreQuery supports only a simplified selector
|
257
|
-
search method. See CoreQuery.find() for more information.
|
258
|
-
|
259
|
-
Also note that CoreQuery implements SC.Enumerable, which means you can
|
260
|
-
also call this method with a callback and target and the callback will
|
261
|
-
be executed on every element in the matching set to return a result.
|
262
|
-
|
263
|
-
@param {String} selector
|
264
|
-
@returns {CoreQuery}
|
265
|
-
*/
|
266
|
-
filter: function( selector ) {
|
267
|
-
return this.pushStack(
|
268
|
-
(SC.typeOf(selector) === SC.T_FUNCTION) &&
|
269
|
-
CQ.grep(this, function(elem, i){
|
270
|
-
return selector.call( elem, i );
|
271
|
-
}) || CQ.multiFilter( selector, this ) );
|
272
|
-
},
|
273
|
-
|
274
|
-
/**
|
275
|
-
Returns the results not matching the passed selector. This is the
|
276
|
-
opposite of filter.
|
277
|
-
|
278
|
-
|
279
|
-
@param {String} selector
|
280
|
-
@returns {CoreQuery}
|
281
|
-
*/
|
282
|
-
not: function( selector ) {
|
283
|
-
if ( selector.constructor == String ) {
|
284
|
-
// test special case where just one selector is passed in
|
285
|
-
if ( isSimple.test( selector ) )
|
286
|
-
return this.pushStack( CQ.multiFilter( selector, this, true ) );
|
287
|
-
else
|
288
|
-
selector = CQ.multiFilter( selector, this );
|
289
|
-
}
|
290
|
-
|
291
|
-
var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
|
292
|
-
return this.filter(function() {
|
293
|
-
return isArrayLike ? CQ.inArray( this, selector ) < 0 : this != selector;
|
294
|
-
});
|
295
|
-
},
|
296
|
-
|
297
|
-
/**
|
298
|
-
Force the current matched set of elements to become the specified array
|
299
|
-
of elements (destroying the stack in the process) You should use
|
300
|
-
pushStack() in order to do this, but maintain the stack.
|
301
|
-
|
302
|
-
This method is mostly used internally. You will not need to use it
|
303
|
-
yourself very often.
|
304
|
-
|
305
|
-
@param {Array} elems
|
306
|
-
@returns {CoreQuery} receiver
|
307
|
-
*/
|
308
|
-
setArray: function( elems ) {
|
309
|
-
// Resetting the length to 0, then using the native Array push
|
310
|
-
// is a super-fast way to populate an object with array-like properties
|
311
|
-
this.length = 0;
|
312
|
-
Array.prototype.push.apply( this, elems );
|
313
|
-
return this;
|
314
|
-
},
|
315
|
-
|
316
|
-
/**
|
317
|
-
Executes the passed function on every element in the CoreQuery object.
|
318
|
-
Returns an array with the return values. Note that null values will
|
319
|
-
be omitted from the resulting set. This differs from SC.Enumerable and
|
320
|
-
the JavaScript standard.
|
321
|
-
|
322
|
-
The callback must have the signature:
|
323
|
-
|
324
|
-
{{{
|
325
|
-
function(currentElement, currentIndex) { return mappedValue; }
|
326
|
-
}}}
|
327
|
-
|
328
|
-
Note that "this" on the function will also be the currentElement.
|
329
|
-
|
330
|
-
@param {Function} callback
|
331
|
-
@returns {CoreQuery} results
|
332
|
-
*/
|
333
|
-
map: function( callback ) {
|
334
|
-
return this.pushStack( CQ.map(this, function(elem, i){
|
335
|
-
return callback.call( elem, i, elem );
|
336
|
-
}));
|
337
|
-
},
|
338
|
-
|
339
|
-
/**
|
340
|
-
Execute a callback for every element in the matched set. (You can seed
|
341
|
-
the arguments with an array of args, but this is only used internally.)
|
342
|
-
|
343
|
-
@param {Function} callback
|
344
|
-
@param {Object} args
|
345
|
-
@returns {CoreQuery} receiver
|
346
|
-
*/
|
347
|
-
each: function( callback, args ) {
|
348
|
-
return CQ.each( this, callback, args );
|
349
|
-
},
|
350
|
-
|
351
|
-
/**
|
352
|
-
Determine the position of an element within a matched set of elements.
|
353
|
-
jQuery-compatible name for indexOf().
|
354
|
-
|
355
|
-
@param {Element} elem
|
356
|
-
@returns {Number} location
|
357
|
-
*/
|
358
|
-
index: function( elem ) {
|
359
|
-
if (elem && elem.jquery) elem = elem[0];
|
360
|
-
return Array.prototype.indexOf.call(this, elem);
|
361
|
-
},
|
362
|
-
|
363
|
-
/**
|
364
|
-
Returns a new CoreQuery object that contains just the matching item.
|
365
|
-
|
366
|
-
@param {Number} i
|
367
|
-
@returns {CoreQuery}
|
368
|
-
*/
|
369
|
-
eq: function( i ) {
|
370
|
-
return this.slice( i, +i + 1 );
|
371
|
-
},
|
372
|
-
|
373
|
-
/**
|
374
|
-
Slice the CoreQuery result set just like you might slice and array.
|
375
|
-
Returns a new CoreQuery object with the result set.
|
376
|
-
|
377
|
-
@returns {CoreQuery}
|
378
|
-
*/
|
379
|
-
slice: function() {
|
380
|
-
return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
|
381
|
-
},
|
382
|
-
|
383
|
-
/** Adds the relevant elements to the existing matching set. */
|
384
|
-
add: function( selector ) {
|
385
|
-
return this.pushStack( CQ.merge(
|
386
|
-
this.get(),
|
387
|
-
typeof selector == 'string' ?
|
388
|
-
CQ( selector ) :
|
389
|
-
CQ.makeArray( selector )
|
390
|
-
).uniq()) ;
|
391
|
-
},
|
392
|
-
|
393
|
-
/**
|
394
|
-
Get to set the named attribute value on the element. You can either
|
395
|
-
pass in the name of an attribute you would like to read from the first
|
396
|
-
matched element, a single attribute/value pair to set on all elements
|
397
|
-
or a hash of attribute/value pairs to set on all elements.
|
398
|
-
|
399
|
-
@param {String} name attribute name
|
400
|
-
@param {Object} value attribute value
|
401
|
-
@param {String} type ?
|
402
|
-
@returns {CoreQuery} receiver
|
403
|
-
*/
|
404
|
-
attr: function( name, value, type ) {
|
405
|
-
var options = name;
|
406
|
-
|
407
|
-
// Look for the case where we're accessing a style value
|
408
|
-
if ( name.constructor == String )
|
409
|
-
if ( value === undefined )
|
410
|
-
return this[0] && CQ[ type || "attr" ]( this[0], name );
|
411
|
-
|
412
|
-
else {
|
413
|
-
options = {};
|
414
|
-
options[ name ] = value;
|
415
|
-
}
|
416
|
-
|
417
|
-
// Check to see if we're setting style values
|
418
|
-
return this.each(function(i){
|
419
|
-
// Set all the styles
|
420
|
-
for ( name in options )
|
421
|
-
CQ.attr(
|
422
|
-
(type)?this.style:this,
|
423
|
-
name, CQ.prop( this, options[ name ], type, i, name ));
|
424
|
-
});
|
425
|
-
},
|
426
|
-
|
427
|
-
html: function( value ) {
|
428
|
-
return value === undefined ?
|
429
|
-
(this[0] ?
|
430
|
-
this[0].innerHTML.replace(/ CQ\d+="(?:\d+|null)"/g, "") :
|
431
|
-
null) :
|
432
|
-
this.empty().append( value );
|
433
|
-
// return value == undefined ?
|
434
|
-
// (this[0] ? this[0].innerHTML : null) :
|
435
|
-
// this.empty().append( value );
|
436
|
-
},
|
437
|
-
|
438
|
-
andSelf: function() { return this.add( this.prevObject ); },
|
439
|
-
|
440
|
-
/**
|
441
|
-
Returns YES if every element in the matching set matches the passed
|
442
|
-
selector. Remember that only simple selectors are supported in
|
443
|
-
CoreQuery.
|
444
|
-
|
445
|
-
@param {String} selector
|
446
|
-
@return {Boolean}
|
447
|
-
*/
|
448
|
-
is: function( selector ) {
|
449
|
-
return !!selector && CQ.multiFilter( selector, this ).length > 0;
|
450
|
-
},
|
451
|
-
|
452
|
-
/**
|
453
|
-
Returns YES if every element in the matching set has the named CSS
|
454
|
-
class.
|
455
|
-
|
456
|
-
@param {String} className
|
457
|
-
@returns {Boolean}
|
458
|
-
*/
|
459
|
-
hasClass: function( className ) {
|
460
|
-
return Array.prototype.every.call(this, function(elem) {
|
461
|
-
return (elem.nodeType!=1) || CQ.className.has(elem, className) ;
|
462
|
-
});
|
463
|
-
},
|
464
|
-
|
465
|
-
/**
|
466
|
-
Provides a standardized, cross-browser method to get and set the
|
467
|
-
value attribute of a form element. Optionally pass a value to set or
|
468
|
-
no value to get.
|
469
|
-
|
470
|
-
@param {Object} value
|
471
|
-
@return {Object|CoreQuery}
|
472
|
-
*/
|
473
|
-
val: function( value ) {
|
474
|
-
|
475
|
-
// get the value
|
476
|
-
if ( value == undefined ) {
|
477
|
-
var elem = this[0];
|
478
|
-
if (elem) {
|
479
|
-
if(CQ.nodeName(elem, 'option'))
|
480
|
-
return (elem.attributes.value || {}).specified ? elem.value : elem.text;
|
481
|
-
|
482
|
-
// We need to handle select boxes special
|
483
|
-
if ( CQ.nodeName( elem, "select" ) ) {
|
484
|
-
var index = elem.selectedIndex,
|
485
|
-
values = [],
|
486
|
-
options = elem.options,
|
487
|
-
one = elem.type == "select-one";
|
488
|
-
|
489
|
-
// Nothing was selected
|
490
|
-
if ( index < 0 ) return null;
|
491
|
-
|
492
|
-
// Loop through all the selected options
|
493
|
-
var i, max = one ? index+1:options.length;
|
494
|
-
for (i = one ? index : 0; i < max; i++ ) {
|
495
|
-
var option = options[ i ];
|
496
|
-
if ( option.selected ) {
|
497
|
-
value = CQ(option).val(); // get value
|
498
|
-
if (one) return value; // We don't need an array for one
|
499
|
-
values.push( value ); // Multi-Selects return an array
|
500
|
-
}
|
501
|
-
}
|
502
|
-
|
503
|
-
return values;
|
504
|
-
}
|
505
|
-
|
506
|
-
// Everything else, we just grab the value
|
507
|
-
return (elem.value || "").replace(/\r/g, "");
|
508
|
-
}
|
509
|
-
return undefined;
|
510
|
-
|
511
|
-
// otherwise set the value
|
512
|
-
} else {
|
513
|
-
if( value.constructor == Number ) value += ''; // force to string
|
514
|
-
this.each(function(){
|
515
|
-
if ( this.nodeType != 1 ) return;
|
516
|
-
|
517
|
-
// handle radio/checkbox. set the checked value
|
518
|
-
if (SC.typeOf(value) === SC.T_ARRAY && (/radio|checkbox/).test(this.type)) {
|
519
|
-
this.checked = (CQ.inArray(this.value, value) >= 0 ||
|
520
|
-
CQ.inArray(this.name, value) >= 0);
|
521
|
-
|
522
|
-
// handle selects
|
523
|
-
} else if ( CQ.nodeName( this, "select" ) ) {
|
524
|
-
var values = CQ.makeArray(value);
|
525
|
-
CQ( "option", this ).each(function(){
|
526
|
-
this.selected = (CQ.inArray( this.value, values ) >= 0 ||
|
527
|
-
CQ.inArray( this.text, values ) >= 0);
|
528
|
-
});
|
529
|
-
|
530
|
-
if (!values.length) this.selectedIndex = -1;
|
531
|
-
|
532
|
-
// otherwise, just set the value property
|
533
|
-
} else this.value = value;
|
534
|
-
});
|
535
|
-
}
|
536
|
-
return this ;
|
537
|
-
},
|
538
|
-
|
539
|
-
/**
|
540
|
-
Returns a clone of the matching set of elements. Note that this will
|
541
|
-
NOT clone event handlers like the jQuery version does becaue CoreQuery
|
542
|
-
does not deal with events.
|
543
|
-
*/
|
544
|
-
clone: function() {
|
545
|
-
// Do the clone
|
546
|
-
var ret = this.map(function(){
|
547
|
-
if ( SC.browser.msie && !CQ.isXMLDoc(this) ) {
|
548
|
-
// IE copies events bound via attachEvent when
|
549
|
-
// using cloneNode. Calling detachEvent on the
|
550
|
-
// clone will also remove the events from the orignal
|
551
|
-
// In order to get around this, we use innerHTML.
|
552
|
-
// Unfortunately, this means some modifications to
|
553
|
-
// attributes in IE that are actually only stored
|
554
|
-
// as properties will not be copied (such as the
|
555
|
-
// the name attribute on an input).
|
556
|
-
var clone = this.cloneNode(true),
|
557
|
-
container = document.createElement("div");
|
558
|
-
container.appendChild(clone);
|
559
|
-
return CQ.clean([container.innerHTML])[0];
|
560
|
-
} else return this.cloneNode(true);
|
561
|
-
});
|
562
|
-
|
563
|
-
// Need to set the expando to null on the cloned set if it exists
|
564
|
-
// removeData doesn't work here, IE removes it from the original as well
|
565
|
-
// this is primarily for IE but the data expando shouldn't be copied
|
566
|
-
// over in any browser
|
567
|
-
var clone = ret.find("*").andSelf().each(function(){
|
568
|
-
if ( this[ SC.guidKey ] != undefined )
|
569
|
-
this[ SC.guidKey ] = null;
|
570
|
-
});
|
571
|
-
|
572
|
-
// Return the cloned set
|
573
|
-
return ret;
|
574
|
-
},
|
575
|
-
|
576
|
-
/**
|
577
|
-
Set or retrieve the specified CSS value. Pass only a key to get the
|
578
|
-
current value, pass a key and value to change it.
|
579
|
-
|
580
|
-
@param {String} key
|
581
|
-
@param {Object} value
|
582
|
-
@returns {Object|CoreQuery}
|
583
|
-
*/
|
584
|
-
css: function( key, value ) {
|
585
|
-
// ignore negative width and height values
|
586
|
-
if ((key == 'width' || key == 'height') && parseFloat(value,0) < 0 ) {
|
587
|
-
value = undefined;
|
588
|
-
}
|
589
|
-
return this.attr( key, value, "curCSS" );
|
590
|
-
},
|
591
|
-
|
592
|
-
/**
|
593
|
-
Set or retrieve the text content of an element. Pass a text element to
|
594
|
-
update or set to end it.
|
595
|
-
|
596
|
-
@param {String} text
|
597
|
-
@returns {String|CoreQuery}
|
598
|
-
*/
|
599
|
-
text: function( text ) {
|
600
|
-
if ( typeof text != "object" && text != null )
|
601
|
-
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
|
602
|
-
|
603
|
-
var ret = "";
|
604
|
-
|
605
|
-
CQ.each( text || this, function(){
|
606
|
-
CQ.each( this.childNodes, function(){
|
607
|
-
if ( this.nodeType != 8 )
|
608
|
-
ret += this.nodeType != 1 ?
|
609
|
-
this.nodeValue : CQ.fn.text( [ this ] );
|
610
|
-
});
|
611
|
-
});
|
612
|
-
|
613
|
-
return ret;
|
614
|
-
},
|
615
|
-
|
616
|
-
/** Simple method to show elements without animation. */
|
617
|
-
show: function() {
|
618
|
-
var isVisible = SC.$.isVisible;
|
619
|
-
this.each(function() {
|
620
|
-
if (!isVisible(this)) {
|
621
|
-
|
622
|
-
// try to restore to natural layout as defined by CSS
|
623
|
-
this.style.display = this.oldblock || '';
|
624
|
-
|
625
|
-
// handle edge case where the CSS style is none so we can't detect
|
626
|
-
// the natural display state.
|
627
|
-
if (CQ.css(this,'display') == 'none') {
|
628
|
-
var elem = CQ('<' + this.tagName + '/>');
|
629
|
-
CQ('body').append(elem);
|
630
|
-
this.style.display = elem.css('display');
|
631
|
-
// edge case where we still can't get the display
|
632
|
-
if (this.style.display === 'none') this.style.display = 'block';
|
633
|
-
elem.remove(); elem = null;
|
634
|
-
}
|
635
|
-
}
|
636
|
-
}) ;
|
637
|
-
return this ;
|
638
|
-
},
|
639
|
-
|
640
|
-
/** Simple method to hide elements without animation. */
|
641
|
-
hide: function() {
|
642
|
-
var isVisible = SC.$.isVisible;
|
643
|
-
this.each(function() {
|
644
|
-
if (isVisible(this)) {
|
645
|
-
this.oldblock = this.oldblock || CQ.css(this,'display');
|
646
|
-
this.style.display = 'none';
|
647
|
-
}
|
648
|
-
}) ;
|
649
|
-
return this ;
|
650
|
-
},
|
651
|
-
|
652
|
-
/**
|
653
|
-
Low-level dom manipulation method used by append(), before(), after()
|
654
|
-
among others. Unlike the jQuery version, this version does not execute
|
655
|
-
<script> tags. That is generally not a good way to input scripts.
|
656
|
-
*/
|
657
|
-
domManip: function( args, table, reverse, callback ) {
|
658
|
-
var clone = this.length > 1, elems;
|
659
|
-
|
660
|
-
return this.each(function(){
|
661
|
-
if ( !elems ) {
|
662
|
-
elems = CQ.clean( args, this.ownerDocument );
|
663
|
-
if (reverse) elems.reverse();
|
664
|
-
}
|
665
|
-
|
666
|
-
var obj = this;
|
667
|
-
if ( table && CQ.nodeName( this, "table" ) && CQ.nodeName( elems[0], "tr" ) ) {
|
668
|
-
obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );
|
669
|
-
}
|
670
|
-
|
671
|
-
CQ.each(elems, function(){
|
672
|
-
var elem = clone ? CQ( this ).clone( true )[0] : this;
|
673
|
-
// Inject the elements into the document
|
674
|
-
callback.call( obj, elem );
|
675
|
-
});
|
676
|
-
});
|
677
|
-
},
|
678
|
-
|
679
|
-
append: function() {
|
680
|
-
return this.domManip(arguments, true, false, function(elem){
|
681
|
-
if (this.nodeType == 1)
|
682
|
-
this.appendChild( elem );
|
683
|
-
});
|
684
|
-
},
|
685
|
-
|
686
|
-
prepend: function() {
|
687
|
-
return this.domManip(arguments, true, true, function(elem){
|
688
|
-
if (this.nodeType == 1)
|
689
|
-
this.insertBefore( elem, this.firstChild );
|
690
|
-
});
|
691
|
-
},
|
692
|
-
|
693
|
-
before: function() {
|
694
|
-
return this.domManip(arguments, false, false, function(elem){
|
695
|
-
this.parentNode.insertBefore( elem, this );
|
696
|
-
});
|
697
|
-
},
|
698
|
-
|
699
|
-
after: function() {
|
700
|
-
return this.domManip(arguments, false, true, function(elem){
|
701
|
-
this.parentNode.insertBefore( elem, this.nextSibling );
|
702
|
-
});
|
703
|
-
},
|
704
|
-
|
705
|
-
replaceWith: function( value ) {
|
706
|
-
return this.after( value ).remove();
|
707
|
-
},
|
708
|
-
|
709
|
-
removeData: function( key ){
|
710
|
-
return this.each(function(){ SC.removeData( this, key ); });
|
711
|
-
}
|
712
|
-
|
713
|
-
}) ;
|
714
|
-
|
715
|
-
// add useful helper methods to CoreQuery
|
716
|
-
CoreQuery.mixin(/** @scope SC.CoreQuery */ {
|
717
|
-
|
718
|
-
nodeName: function( elem, name ) {
|
719
|
-
return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
|
720
|
-
},
|
721
|
-
|
722
|
-
/**
|
723
|
-
Execute the passed callback on the elems array, returning an array with
|
724
|
-
the mapped values. Note that null return values are left out of the
|
725
|
-
resulting mapping array. This differs from the standard map() function
|
726
|
-
defined by SC.Enumerable and the JavaScript standard.
|
727
|
-
|
728
|
-
The callback must have the signature:
|
729
|
-
|
730
|
-
{{{
|
731
|
-
function(currentElement, currentIndex) { return mappedValue; }
|
732
|
-
}}}
|
733
|
-
|
734
|
-
Note that "this" on the function will also be the currentElement.
|
735
|
-
|
736
|
-
@param {Array} elems
|
737
|
-
@param {Function} callback
|
738
|
-
@returns {Array} mapped elements
|
739
|
-
*/
|
740
|
-
map: function( elems, callback ) {
|
741
|
-
var ret = [];
|
742
|
-
|
743
|
-
// Go through the array, translating each of the items to their
|
744
|
-
// new value (or values).
|
745
|
-
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
746
|
-
var value = callback( elems[ i ], i );
|
747
|
-
|
748
|
-
if ( value != null )
|
749
|
-
ret[ ret.length ] = value;
|
750
|
-
}
|
751
|
-
|
752
|
-
return ret.concat.apply([],ret) ;
|
753
|
-
},
|
754
|
-
|
755
|
-
/**
|
756
|
-
Executes the passed callback on each item in the iterable object
|
757
|
-
passed. This deviates from the standard getEach() method defined in
|
758
|
-
SC.Enumerable and in the JavaScript standards.
|
759
|
-
|
760
|
-
@param {Array} object
|
761
|
-
@param {Function} callback
|
762
|
-
@param {Object} args internal use only
|
763
|
-
@returns {Object} object
|
764
|
-
*/
|
765
|
-
each: function( object, callback, args ) {
|
766
|
-
var name, i = 0, length = object.length;
|
767
|
-
|
768
|
-
if ( args ) {
|
769
|
-
if ( length == undefined ) {
|
770
|
-
for ( name in object )
|
771
|
-
if ( callback.apply( object[ name ], args ) === false )
|
772
|
-
break;
|
773
|
-
} else
|
774
|
-
for ( ; i < length; )
|
775
|
-
if ( callback.apply( object[ i++ ], args ) === false )
|
776
|
-
break;
|
777
|
-
|
778
|
-
// A special, fast, case for the most common use of each
|
779
|
-
} else {
|
780
|
-
if ( length == undefined ) {
|
781
|
-
for ( name in object )
|
782
|
-
if ( callback.call( object[ name ], name, object[ name ] ) === false )
|
783
|
-
break;
|
784
|
-
} else
|
785
|
-
for ( var value = object[0];
|
786
|
-
i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
|
787
|
-
}
|
788
|
-
|
789
|
-
return object;
|
790
|
-
},
|
791
|
-
|
792
|
-
isXMLDoc: function( elem ) {
|
793
|
-
return elem.documentElement && !elem.body ||
|
794
|
-
elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
|
795
|
-
},
|
796
|
-
|
797
|
-
clean: function( elems, context ) {
|
798
|
-
var ret = [];
|
799
|
-
context = context || document;
|
800
|
-
// !context.createElement fails in IE with an error but returns typeof 'object'
|
801
|
-
if (typeof context.createElement == 'undefined') {
|
802
|
-
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
|
803
|
-
}
|
804
|
-
|
805
|
-
CQ.each(elems, function(i, elem){
|
806
|
-
if ( typeof elem == 'number' ) elem += '';
|
807
|
-
if ( !elem ) return;
|
808
|
-
|
809
|
-
// Convert html string into DOM nodes
|
810
|
-
if ( typeof elem == "string" ) {
|
811
|
-
// Fix "XHTML"-style tags in all browsers
|
812
|
-
elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
|
813
|
-
return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
|
814
|
-
all :
|
815
|
-
front + "></" + tag + ">";
|
816
|
-
});
|
817
|
-
|
818
|
-
// Trim whitespace, otherwise indexOf won't work as expected
|
819
|
-
var tags = elem.trim().toLowerCase(),
|
820
|
-
div = context.createElement("div");
|
821
|
-
|
822
|
-
var wrap =
|
823
|
-
// option or optgroup
|
824
|
-
!tags.indexOf("<opt") &&
|
825
|
-
[ 1, "<select multiple='multiple'>", "</select>" ] ||
|
826
|
-
|
827
|
-
!tags.indexOf("<leg") &&
|
828
|
-
[ 1, "<fieldset>", "</fieldset>" ] ||
|
829
|
-
|
830
|
-
tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
|
831
|
-
[ 1, "<table>", "</table>" ] ||
|
832
|
-
|
833
|
-
!tags.indexOf("<tr") &&
|
834
|
-
[ 2, "<table><tbody>", "</tbody></table>" ] ||
|
835
|
-
|
836
|
-
// <thead> matched above
|
837
|
-
(!tags.indexOf("<td") || !tags.indexOf("<th")) &&
|
838
|
-
[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
|
839
|
-
|
840
|
-
!tags.indexOf("<col") &&
|
841
|
-
[ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
|
842
|
-
|
843
|
-
// IE can't serialize <link> and <script> tags normally
|
844
|
-
SC.browser.msie &&
|
845
|
-
[ 1, "div<div>", "</div>" ] ||
|
846
|
-
|
847
|
-
[ 0, "", "" ];
|
848
|
-
|
849
|
-
// Go to html and back, then peel off extra wrappers
|
850
|
-
div.innerHTML = wrap[1] + elem + wrap[2];
|
851
|
-
|
852
|
-
// Move to the right depth
|
853
|
-
while ( wrap[0]-- ) div = div.lastChild;
|
854
|
-
|
855
|
-
// Remove IE's autoinserted <tbody> from table fragments
|
856
|
-
if ( SC.browser.msie ) {
|
857
|
-
|
858
|
-
// String was a <table>, *may* have spurious <tbody>
|
859
|
-
var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
|
860
|
-
div.firstChild && div.firstChild.childNodes :
|
861
|
-
|
862
|
-
// String was a bare <thead> or <tfoot>
|
863
|
-
wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
|
864
|
-
div.childNodes :
|
865
|
-
[];
|
866
|
-
|
867
|
-
for ( var j = tbody.length - 1; j >= 0 ; --j )
|
868
|
-
if ( CQ.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
|
869
|
-
tbody[ j ].parentNode.removeChild( tbody[ j ] );
|
870
|
-
|
871
|
-
// IE completely kills leading whitespace when innerHTML is used
|
872
|
-
if ( /^\s/.test( elem ) )
|
873
|
-
div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
|
874
|
-
|
875
|
-
}
|
876
|
-
|
877
|
-
elem = CQ.makeArray( div.childNodes );
|
878
|
-
}
|
879
|
-
|
880
|
-
if (elem.length === 0 && (!CQ.nodeName( elem, "form" ) && !CQ.nodeName( elem, "select" ))) return;
|
881
|
-
|
882
|
-
if (elem[0] == undefined || CQ.nodeName( elem, "form" ) || elem.options) ret.push( elem );
|
883
|
-
|
884
|
-
else ret = CQ.merge( ret, elem );
|
885
|
-
|
886
|
-
});
|
887
|
-
|
888
|
-
return ret;
|
889
|
-
},
|
890
|
-
|
891
|
-
/**
|
892
|
-
Core element finder function in SC.CoreQuery. CoreQuery supports only
|
893
|
-
a very simple set of finders. Namely, you can specify the following
|
894
|
-
simple types of selectors:
|
895
|
-
|
896
|
-
- .class-name: this will find all elements with the matching class name
|
897
|
-
- #id: this will find all elements matching the ID
|
898
|
-
- tagname: this will find all elements with the matching tags.
|
899
|
-
|
900
|
-
You can also do some basic joined expressions like:
|
901
|
-
|
902
|
-
{{{
|
903
|
-
tagname.class-name and tagname#id
|
904
|
-
}}}
|
905
|
-
|
906
|
-
Finally, you can do simple compound searches like
|
907
|
-
|
908
|
-
{{{
|
909
|
-
tagname .class-name tagname#id
|
910
|
-
}}}
|
911
|
-
|
912
|
-
You can also pass multiple selectors separated by commas. The return
|
913
|
-
set will be the OR of all the result set.
|
914
|
-
|
915
|
-
{{{
|
916
|
-
#item1,#item2,#item3
|
917
|
-
}}}
|
918
|
-
|
919
|
-
You cannot do any child searches, psuedo-selectors or other complex
|
920
|
-
searches. These are only the kinds of selectors that can be parsed
|
921
|
-
quickly and use built-in methods on the browser.
|
922
|
-
|
923
|
-
@param {String} t selector
|
924
|
-
@param {Element} context
|
925
|
-
@returns {Array} matched elements
|
926
|
-
*/
|
927
|
-
find: function( t, context ) {
|
928
|
-
|
929
|
-
// Quickly handle non-string expressions
|
930
|
-
if ( typeof t != "string" ) return [ t ];
|
931
|
-
|
932
|
-
// if the selector contains commas, then we actually want to search
|
933
|
-
// multiple selectors.
|
934
|
-
if (t.indexOf(',')>=0) {
|
935
|
-
var ret = t.split(',').map(function(sel) {
|
936
|
-
return CQ.find(sel,context);
|
937
|
-
});
|
938
|
-
|
939
|
-
// flatten arrays
|
940
|
-
return ret.concat.apply([],ret).uniq() ;
|
941
|
-
}
|
942
|
-
|
943
|
-
// check to make sure context is a DOM element or a document
|
944
|
-
if ( context && context.nodeType != 1 && context.nodeType != 9) {
|
945
|
-
return [];
|
946
|
-
}
|
947
|
-
|
948
|
-
// Set the correct context (if none is provided)
|
949
|
-
context = context || document;
|
950
|
-
|
951
|
-
// Initialize the search. split the selector into pieces
|
952
|
-
var ret = [context], nodeName, inFindMode = YES;
|
953
|
-
var parts = t.match(quickSplit), len = parts.length, m ;
|
954
|
-
|
955
|
-
// loop through each part and either find or filter as needed
|
956
|
-
for(var idx=0;idx<len;idx++) {
|
957
|
-
t = parts[idx]; // the current selector to parse
|
958
|
-
|
959
|
-
// handle space separators. this just resets to find mode
|
960
|
-
if (t === ' ' || t === '') {
|
961
|
-
inFindMode = YES ;
|
962
|
-
|
963
|
-
// if we are in find mode, then use the current selector to
|
964
|
-
// find new elements that are children. at the end, leave findMode.
|
965
|
-
} else if (inFindMode) {
|
966
|
-
|
967
|
-
// split into parts to test result
|
968
|
-
m = singleClass.exec(t);
|
969
|
-
|
970
|
-
// handle special case where we get a tag name followed by an ID.
|
971
|
-
// in this case, just swap the two and proceed.
|
972
|
-
if ((m[1] === '') && (idx<(len-1)) && (parts[idx+1].charAt(0)==='#')) {
|
973
|
-
t = parts[idx+1]; parts[idx+1] = parts[idx]; // swap
|
974
|
-
m = singleClass.exec(t); // reparse
|
975
|
-
}
|
976
|
-
|
977
|
-
// now loop through and find elements based on tag
|
978
|
-
var next = [], retlen = ret.length, retidx, cur, val = m[2], found;
|
979
|
-
for(retidx=0;retidx<retlen;retidx++) {
|
980
|
-
cur = ret[retidx];
|
981
|
-
switch(m[1]) {
|
982
|
-
case '': // tag
|
983
|
-
if (!val) val = '*';
|
984
|
-
// Handle IE7 being really dumb about <object>s
|
985
|
-
if ( val == "*" && cur.nodeName.toLowerCase() == "object" ) {
|
986
|
-
val = "param";
|
987
|
-
}
|
988
|
-
|
989
|
-
next = CQ.merge(next, cur.getElementsByTagName(val));
|
990
|
-
break;
|
991
|
-
|
992
|
-
case '#': // id
|
993
|
-
// handle special case where we are searching the document
|
994
|
-
if (cur === document) {
|
995
|
-
found = document.getElementById(val) ;
|
996
|
-
|
997
|
-
// if this is IE, verify that it didn't search by name
|
998
|
-
if (SC.browser.msie && found && found.getAttribute('id')!==val){
|
999
|
-
found = NO; // clear
|
1000
|
-
} else {
|
1001
|
-
if (found) next.push(found) ;
|
1002
|
-
found = YES ; // do not do slow search
|
1003
|
-
}
|
1004
|
-
} else found = NO;
|
1005
|
-
|
1006
|
-
// Otherwise, we have to do a slow search
|
1007
|
-
if (!found) {
|
1008
|
-
// the return value of getElementsByTagName is not an Array
|
1009
|
-
// so we need to fake it.
|
1010
|
-
found = cur.getElementsByTagName('*') ;
|
1011
|
-
found = Array.prototype.find.call(found, function(el){
|
1012
|
-
return el.getAttribute && (el.getAttribute('id')===val);
|
1013
|
-
}) ;
|
1014
|
-
if (found) next.push(found) ;
|
1015
|
-
}
|
1016
|
-
break ;
|
1017
|
-
|
1018
|
-
case '.': // class
|
1019
|
-
if (cur.getElementsByClassName) {
|
1020
|
-
next = CQ.merge(next, cur.getElementsByClassName(val));
|
1021
|
-
} else {
|
1022
|
-
next = CQ.merge(next,
|
1023
|
-
CQ.classFilter(cur.getElementsByTagName('*'),val));
|
1024
|
-
}
|
1025
|
-
break;
|
1026
|
-
default:
|
1027
|
-
// do nothing
|
1028
|
-
}
|
1029
|
-
}
|
1030
|
-
delete ret; ret = next ; // swap array
|
1031
|
-
inFindMode = NO;
|
1032
|
-
|
1033
|
-
// if we are not in findMode then simply filter the results.
|
1034
|
-
} else ret = CQ.filter(t, ret) ;
|
1035
|
-
}
|
1036
|
-
|
1037
|
-
// remove original context if still there
|
1038
|
-
if (ret && ret[0] == context) ret.shift();
|
1039
|
-
return ret.uniq() ; // make sure no duplicated are returned
|
1040
|
-
},
|
1041
|
-
|
1042
|
-
classFilter: function(r,m,not){
|
1043
|
-
m = " " + m + " ";
|
1044
|
-
var tmp = [];
|
1045
|
-
for ( var i = 0; r[i]; i++ ) {
|
1046
|
-
var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
|
1047
|
-
if ( !not && pass || not && !pass )
|
1048
|
-
tmp.push( r[i] );
|
1049
|
-
}
|
1050
|
-
return tmp;
|
1051
|
-
},
|
1052
|
-
|
1053
|
-
/**
|
1054
|
-
Filters a set of elements according to those matching the passed
|
1055
|
-
selector. The selector can contain only tag, class, and id options.
|
1056
|
-
|
1057
|
-
The CoreQuery filter function is only capable of handling simple querys
|
1058
|
-
such as a tag, class or ID. You cannot combine them. Instead call
|
1059
|
-
filter several times.
|
1060
|
-
|
1061
|
-
@param {String} t the selector to filter by
|
1062
|
-
@param {Array} r the element to filter
|
1063
|
-
@param {Boolean} not invert filter
|
1064
|
-
@returns {Array} filtered array
|
1065
|
-
*/
|
1066
|
-
filter: function(t,r,not) {
|
1067
|
-
// split into parts to test result
|
1068
|
-
var m = singleClass.exec(t), val = m[2], kind = m[1], filter ;
|
1069
|
-
if (kind === '.') { // special case class
|
1070
|
-
return CQ.classFilter(CQ.makeArray(r), val, not) ;
|
1071
|
-
} else {
|
1072
|
-
if (kind === '#') { // id
|
1073
|
-
filter = function(el) {
|
1074
|
-
var ret=el && el.getAttribute && (el.getAttribute('id') === val);
|
1075
|
-
return (not) ? !ret : ret ;
|
1076
|
-
} ;
|
1077
|
-
|
1078
|
-
} else { // tag
|
1079
|
-
filter = function(el) {
|
1080
|
-
var ret= CQ.nodeName(el, val);
|
1081
|
-
return (not) ? !ret : ret ;
|
1082
|
-
} ;
|
1083
|
-
}
|
1084
|
-
|
1085
|
-
// the return value may not be a real instance of Array, so fake it.
|
1086
|
-
return Array.prototype.filter.call(CQ.makeArray(r), filter) ;
|
1087
|
-
}
|
1088
|
-
},
|
1089
|
-
|
1090
|
-
/** @private Accepts filters separated by commas. */
|
1091
|
-
multiFilter: function( expr, elems, not ) {
|
1092
|
-
expr = (expr.indexOf(',')) ? expr.split(',') : [expr];
|
1093
|
-
var loc=expr.length,cur,ret=[];
|
1094
|
-
while(--loc >= 0) { // unit tests expect reverse iteration
|
1095
|
-
cur = CQ.filter(expr[loc].trim(), elems, not) ;
|
1096
|
-
ret = not ? elems = cur : CQ.merge(cur,ret);
|
1097
|
-
}
|
1098
|
-
return ret ;
|
1099
|
-
},
|
1100
|
-
|
1101
|
-
/**
|
1102
|
-
Merge two result sets together. This method knows how to handle
|
1103
|
-
the special iterables returned by IE as well. Used internally.
|
1104
|
-
*/
|
1105
|
-
merge: function(first, second) {
|
1106
|
-
// We have to loop this way because IE & Opera overwrite the length
|
1107
|
-
// expando of getElementsByTagName
|
1108
|
-
var i = 0, elem, pos = first.length;
|
1109
|
-
// Also, we need to make sure that the correct elements are being
|
1110
|
-
// returned (IE returns comment nodes in a '*' query)
|
1111
|
-
if ( SC.browser.msie ) {
|
1112
|
-
while ( elem = second[ i++ ] ) {
|
1113
|
-
if ( elem.nodeType != 8 ) first[ pos++ ] = elem;
|
1114
|
-
}
|
1115
|
-
|
1116
|
-
} else {
|
1117
|
-
while ( elem = second[ i++ ] ) first[ pos++ ] = elem;
|
1118
|
-
}
|
1119
|
-
|
1120
|
-
return first;
|
1121
|
-
},
|
1122
|
-
|
1123
|
-
// makeArray is the CoreQuery version of $A().
|
1124
|
-
makeArray: function(array) {
|
1125
|
-
var ret = [];
|
1126
|
-
|
1127
|
-
if( array != null ){
|
1128
|
-
var i = array.length;
|
1129
|
-
// The window, strings (and functions) also have 'length'
|
1130
|
-
if( i == null || typeof array == 'string' || array.setInterval )
|
1131
|
-
ret[0] = array;
|
1132
|
-
else
|
1133
|
-
while( i )
|
1134
|
-
ret[--i] = array[i];
|
1135
|
-
}
|
1136
|
-
|
1137
|
-
return ret;
|
1138
|
-
},
|
1139
|
-
|
1140
|
-
inArray: function(elem,array) {
|
1141
|
-
return (array.indexOf) ? array.indexOf(elem) : Array.prototype.indexOf.call(array, elem);
|
1142
|
-
},
|
1143
|
-
|
1144
|
-
// Check to see if the W3C box model is being used
|
1145
|
-
boxModel: !SC.browser.msie || document.compatMode == "CSS1Compat",
|
1146
|
-
|
1147
|
-
props: {
|
1148
|
-
"for": "htmlFor",
|
1149
|
-
"class": "className",
|
1150
|
-
"float": styleFloat,
|
1151
|
-
cssFloat: styleFloat,
|
1152
|
-
styleFloat: styleFloat,
|
1153
|
-
readonly: "readOnly",
|
1154
|
-
maxlength: "maxLength",
|
1155
|
-
cellspacing: "cellSpacing",
|
1156
|
-
rowspan: "rowSpan"
|
1157
|
-
},
|
1158
|
-
|
1159
|
-
/** @private Prepares a property string for insertion. */
|
1160
|
-
prop: function( elem, value, type, i, name ) {
|
1161
|
-
// Handle executable functions
|
1162
|
-
if (SC.typeOf(value) === SC.T_FUNCTION) value = value.call(elem, i);
|
1163
|
-
|
1164
|
-
// Handle passing in a number to a CSS property
|
1165
|
-
return value && (value.constructor === Number) && type == "curCSS" && !exclude.test( name ) ? value + "px" : value;
|
1166
|
-
},
|
1167
|
-
|
1168
|
-
|
1169
|
-
grep: function( elems, callback, inv ) {
|
1170
|
-
var ret = [];
|
1171
|
-
|
1172
|
-
// Go through the array, only saving the items
|
1173
|
-
// that pass the validator function
|
1174
|
-
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
1175
|
-
if ( !inv != !callback( elems[ i ], i ) ) ret.push( elems[ i ] );
|
1176
|
-
}
|
1177
|
-
return ret;
|
1178
|
-
},
|
1179
|
-
|
1180
|
-
/** @private internal use only */
|
1181
|
-
className: {
|
1182
|
-
|
1183
|
-
// internal only, use addClass("class")
|
1184
|
-
add: function( elem, classNames ) {
|
1185
|
-
var has = CQ.className.has ;
|
1186
|
-
CQ.each((classNames || "").split(/\s+/), function(i, className){
|
1187
|
-
if ( elem.nodeType == 1 && !has( elem.className, className ) )
|
1188
|
-
elem.className += (elem.className ? " " : "") + className;
|
1189
|
-
});
|
1190
|
-
},
|
1191
|
-
|
1192
|
-
// internal only, use removeClass("class")
|
1193
|
-
remove: function( elem, classNames ) {
|
1194
|
-
if (elem.nodeType == 1) {
|
1195
|
-
elem.className = classNames != undefined ?
|
1196
|
-
CQ.grep(elem.className.split(/\s+/), function(className){
|
1197
|
-
return !CQ.className.has( classNames, className );
|
1198
|
-
}).join(" ") : "";
|
1199
|
-
}
|
1200
|
-
},
|
1201
|
-
|
1202
|
-
// internal only, use hasClass("class")
|
1203
|
-
has: function( elem, className ) {
|
1204
|
-
return CQ.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
|
1205
|
-
}
|
1206
|
-
},
|
1207
|
-
|
1208
|
-
/** @private A method for quickly swapping in/out CSS properties to get
|
1209
|
-
correct calculations */
|
1210
|
-
swap: function( elem, options, callback, direction, arg ) {
|
1211
|
-
var old = {};
|
1212
|
-
// Remember the old values, and insert the new ones
|
1213
|
-
for ( var name in options ) {
|
1214
|
-
old[ name ] = elem.style[ name ];
|
1215
|
-
elem.style[ name ] = options[ name ];
|
1216
|
-
}
|
1217
|
-
|
1218
|
-
var ret = callback(elem, direction, arg );
|
1219
|
-
|
1220
|
-
// Revert the old values
|
1221
|
-
for ( var name in options ) elem.style[ name ] = old[ name ];
|
1222
|
-
return ret ;
|
1223
|
-
},
|
1224
|
-
|
1225
|
-
/** returns a normalized value for the specified style name. */
|
1226
|
-
css: function( elem, name, force ) {
|
1227
|
-
// handle special case for width/height
|
1228
|
-
if ( name == "width" || name == "height" ) {
|
1229
|
-
var val, which = (name == "width") ? LEFT_RIGHT : TOP_BOTTOM,
|
1230
|
-
props = CSS_DISPLAY_PROPS;
|
1231
|
-
|
1232
|
-
val = SC.$.isVisible(elem) ? getWH(elem,name,which) : CQ.swap(elem,props,getWH,name,which) ;
|
1233
|
-
|
1234
|
-
return Math.max(0, val);
|
1235
|
-
}
|
1236
|
-
|
1237
|
-
return CQ.curCSS( elem, name, force );
|
1238
|
-
},
|
1239
|
-
|
1240
|
-
/** @private internal method to retrieve current CSS. */
|
1241
|
-
curCSS: function( elem, name, force ) {
|
1242
|
-
var ret, style = elem.style;
|
1243
|
-
|
1244
|
-
// We need to handle opacity special in IE
|
1245
|
-
if ( name == "opacity" && SC.browser.msie ) {
|
1246
|
-
ret = CQ.attr( style, "opacity" );
|
1247
|
-
return ret == "" ? "1" : ret;
|
1248
|
-
}
|
1249
|
-
|
1250
|
-
// Opera sometimes will give the wrong display answer, this fixes it,
|
1251
|
-
// see #2037
|
1252
|
-
if ( SC.browser.opera && name === "display" ) {
|
1253
|
-
var save = style.outline;
|
1254
|
-
style.outline = "0 solid black";
|
1255
|
-
style.outline = save;
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
// Make sure we're using the right name for getting the float value
|
1259
|
-
var isFloat = name.match(/float/i);
|
1260
|
-
if (isFloat) name = styleFloat;
|
1261
|
-
|
1262
|
-
// simple case to collect the value
|
1263
|
-
if ( !force && style && style[ name ] ) {
|
1264
|
-
ret = style[ name ];
|
1265
|
-
|
1266
|
-
// otherwise try to use cached computed value
|
1267
|
-
} else if ( defaultView.getComputedStyle ) {
|
1268
|
-
|
1269
|
-
// Only "float" is needed here
|
1270
|
-
if (isFloat) name = "float";
|
1271
|
-
|
1272
|
-
name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
|
1273
|
-
|
1274
|
-
// get the computed style and verify its not broken.
|
1275
|
-
var computedStyle = defaultView.getComputedStyle( elem, null );
|
1276
|
-
if ( computedStyle && !styleIsBorked(elem, defaultView) ) {
|
1277
|
-
ret = computedStyle.getPropertyValue( name );
|
1278
|
-
|
1279
|
-
// If the element isn't reporting its values properly in Safari
|
1280
|
-
// then some display: none elements are involved
|
1281
|
-
} else {
|
1282
|
-
var swap = [], stack = [], a = elem, i = 0;
|
1283
|
-
|
1284
|
-
// Locate all of the parent display: none elements
|
1285
|
-
for ( ; a && styleIsBorked(a); a = a.parentNode ) stack.unshift(a);
|
1286
|
-
|
1287
|
-
// Go through and make them visible, but in reverse
|
1288
|
-
// (It would be better if we knew the exact display type that they
|
1289
|
-
// had)
|
1290
|
-
for ( ; i < stack.length; i++ ) {
|
1291
|
-
if (styleIsBorked(stack[i])) {
|
1292
|
-
swap[i] = stack[i].style.display;
|
1293
|
-
stack[i].style.display = "block";
|
1294
|
-
}
|
1295
|
-
}
|
1296
|
-
|
1297
|
-
// Since we flip the display style, we have to handle that
|
1298
|
-
// one special, otherwise get the value
|
1299
|
-
ret = (name == "display" && swap[stack.length-1]!=null) ? "none" :
|
1300
|
-
(computedStyle && computedStyle.getPropertyValue(name)) || "";
|
1301
|
-
|
1302
|
-
// Finally, revert the display styles back
|
1303
|
-
for ( i = 0; i < swap.length; i++ ) {
|
1304
|
-
if (swap[i]!=null) stack[i].style.display = swap[i];
|
1305
|
-
}
|
1306
|
-
}
|
1307
|
-
|
1308
|
-
// We should always get a number back from opacity
|
1309
|
-
if (name == "opacity" && ret == "") ret = "1";
|
1310
|
-
|
1311
|
-
} else if (elem.currentStyle) {
|
1312
|
-
// var camelCase = name.camelize();
|
1313
|
-
|
1314
|
-
ret = elem.currentStyle[ name ] || elem.currentStyle[ name.camelize() ];
|
1315
|
-
|
1316
|
-
// From the awesome hack by Dean Edwards
|
1317
|
-
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
1318
|
-
// If we're not dealing with a regular pixel number
|
1319
|
-
// but a number that has a weird ending, we need to convert it to
|
1320
|
-
// pixels
|
1321
|
-
if (!(/^\d+(px)?$/i).test(ret) && (/^\d/).test(ret)) {
|
1322
|
-
// Remember the original values
|
1323
|
-
var left = style.left, rsLeft = elem.runtimeStyle.left;
|
1324
|
-
|
1325
|
-
// Put in the new values to get a computed value out
|
1326
|
-
elem.runtimeStyle.left = elem.currentStyle.left;
|
1327
|
-
style.left = ret || 0;
|
1328
|
-
ret = style.pixelLeft + "px";
|
1329
|
-
|
1330
|
-
// Revert the changed values
|
1331
|
-
style.left = left;
|
1332
|
-
elem.runtimeStyle.left = rsLeft;
|
1333
|
-
}
|
1334
|
-
}
|
1335
|
-
|
1336
|
-
return ret;
|
1337
|
-
},
|
1338
|
-
|
1339
|
-
/** @private
|
1340
|
-
returns all of the actual nodes (excluding whitespace, comments, etc) in
|
1341
|
-
the passed element.
|
1342
|
-
*/
|
1343
|
-
dir: function( elem, dir ){
|
1344
|
-
var matched = [], cur = elem[dir];
|
1345
|
-
while ( cur && cur != document ) {
|
1346
|
-
if ( cur.nodeType == 1 ) matched.push( cur );
|
1347
|
-
cur = cur[dir];
|
1348
|
-
}
|
1349
|
-
return matched;
|
1350
|
-
},
|
1351
|
-
|
1352
|
-
/** @private
|
1353
|
-
Returns the nth actual node (not whitespace, comment, etc) in the passed
|
1354
|
-
element.
|
1355
|
-
*/
|
1356
|
-
nth: function(cur,result,dir,elem){
|
1357
|
-
result = result || 1;
|
1358
|
-
var num = 0;
|
1359
|
-
for ( ; cur; cur = cur[dir] ) {
|
1360
|
-
if ( cur.nodeType == 1 && ++num == result ) break;
|
1361
|
-
}
|
1362
|
-
return cur;
|
1363
|
-
},
|
1364
|
-
|
1365
|
-
/** @private Finds the regular element-style siblings. */
|
1366
|
-
sibling: function( n, elem ) {
|
1367
|
-
var r = [];
|
1368
|
-
for ( ; n; n = n.nextSibling ) {
|
1369
|
-
if ( n.nodeType == 1 && n != elem ) r.push( n );
|
1370
|
-
}
|
1371
|
-
return r;
|
1372
|
-
},
|
1373
|
-
|
1374
|
-
/** Primitive helper can read or update an attribute on an element. */
|
1375
|
-
attr: function( elem, name, value ) {
|
1376
|
-
// don't set attributes on text and comment nodes
|
1377
|
-
if (!elem || elem.nodeType == 3 || elem.nodeType == 8) return undefined;
|
1378
|
-
|
1379
|
-
var notxml = !CQ.isXMLDoc( elem ),
|
1380
|
-
set = value !== undefined,
|
1381
|
-
msie = SC.browser.msie;
|
1382
|
-
|
1383
|
-
// Try to normalize/fix the name
|
1384
|
-
name = notxml && CQ.props[ name ] || name;
|
1385
|
-
|
1386
|
-
// Only do all the following if this is a node (faster for style)
|
1387
|
-
// IE elem.getAttribute passes even for style
|
1388
|
-
if ( elem.tagName ) {
|
1389
|
-
|
1390
|
-
// These attributes require special treatment
|
1391
|
-
var special = /href|src|style/.test( name );
|
1392
|
-
|
1393
|
-
// Safari mis-reports the default selected property of a hidden option
|
1394
|
-
// Accessing the parent's selectedIndex property fixes it
|
1395
|
-
if ( name == "selected" && SC.browser.safari ) {
|
1396
|
-
elem.parentNode.selectedIndex;
|
1397
|
-
}
|
1398
|
-
|
1399
|
-
// If applicable, access the attribute via the DOM 0 way
|
1400
|
-
if ( name in elem && notxml && !special ) {
|
1401
|
-
if ( set ){
|
1402
|
-
// We can't allow the type property to be changed (since it causes
|
1403
|
-
// problems in IE)
|
1404
|
-
if ( name == "type" && CQ.nodeName( elem, "input" ) && elem.parentNode ) {
|
1405
|
-
throw "type property can't be changed";
|
1406
|
-
}
|
1407
|
-
|
1408
|
-
elem[ name ] = value;
|
1409
|
-
}
|
1410
|
-
|
1411
|
-
// browsers index elements by id/name on forms, give priority to
|
1412
|
-
// attributes.
|
1413
|
-
if( CQ.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
|
1414
|
-
return elem.getAttributeNode( name ).nodeValue;
|
1415
|
-
}
|
1416
|
-
|
1417
|
-
return elem[ name ];
|
1418
|
-
}
|
1419
|
-
|
1420
|
-
if ( msie && notxml && name === "style" )
|
1421
|
-
return CQ.attr( elem.style, "cssText", value );
|
1422
|
-
|
1423
|
-
// convert the value to a string (all browsers do this but IE) see
|
1424
|
-
// #1070 (jQuery)
|
1425
|
-
if ( set ) elem.setAttribute( name, "" + value );
|
1426
|
-
|
1427
|
-
// Some attributes require a special call on IE
|
1428
|
-
var attr = (msie && notxml && special)
|
1429
|
-
? elem.getAttribute( name, 2 )
|
1430
|
-
: elem.getAttribute( name );
|
1431
|
-
|
1432
|
-
// Non-existent attributes return null, we normalize to undefined
|
1433
|
-
return attr === null ? undefined : attr;
|
1434
|
-
}
|
1435
|
-
|
1436
|
-
// elem is actually elem.style ... set the style
|
1437
|
-
|
1438
|
-
// IE uses filters for opacity
|
1439
|
-
if ( msie && name == "opacity" ) {
|
1440
|
-
if ( set ) {
|
1441
|
-
// IE has trouble with opacity if it does not have layout
|
1442
|
-
// Force it by setting the zoom level
|
1443
|
-
elem.zoom = 1;
|
1444
|
-
|
1445
|
-
// Set the alpha filter to set the opacity
|
1446
|
-
elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
|
1447
|
-
(parseInt(value,0) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
|
1448
|
-
}
|
1449
|
-
|
1450
|
-
return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
|
1451
|
-
(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
|
1452
|
-
"";
|
1453
|
-
}
|
1454
|
-
|
1455
|
-
name = name.camelize();
|
1456
|
-
if ( set ) elem[ name ] = value;
|
1457
|
-
|
1458
|
-
return elem[ name ];
|
1459
|
-
}
|
1460
|
-
|
1461
|
-
}) ;
|
1462
|
-
|
1463
|
-
CQ.fn.init.prototype = CQ.fn;
|
1464
|
-
|
1465
|
-
// Create a new generic handlers.
|
1466
|
-
CQ.each({
|
1467
|
-
parent: function(elem){return elem.parentNode;},
|
1468
|
-
|
1469
|
-
parents: function(elem){return CQ.dir(elem,"parentNode");},
|
1470
|
-
|
1471
|
-
next: function(elem){return CQ.nth(elem,2,"nextSibling");},
|
1472
|
-
|
1473
|
-
prev: function(elem){return CQ.nth(elem,2,"previousSibling");},
|
1474
|
-
|
1475
|
-
nextAll: function(elem){
|
1476
|
-
return CQ.dir(elem,"nextSibling");
|
1477
|
-
},
|
1478
|
-
|
1479
|
-
prevAll: function(elem){
|
1480
|
-
return CQ.dir(elem,"previousSibling");
|
1481
|
-
},
|
1482
|
-
|
1483
|
-
siblings: function(elem){
|
1484
|
-
return CQ.sibling(elem.parentNode.firstChild,elem);
|
1485
|
-
},
|
1486
|
-
|
1487
|
-
children: function(elem){return CQ.sibling(elem.firstChild);},
|
1488
|
-
|
1489
|
-
contents: function(elem){
|
1490
|
-
return CQ.nodeName(elem,"iframe") ?
|
1491
|
-
elem.contentDocument||elem.contentWindow.document :
|
1492
|
-
CQ.makeArray(elem.childNodes);
|
1493
|
-
}
|
1494
|
-
|
1495
|
-
}, function(name, fn){
|
1496
|
-
CQ.fn[ name ] = function( selector ) {
|
1497
|
-
var ret = CQ.map( this, fn );
|
1498
|
-
|
1499
|
-
if ( selector && typeof selector == "string" )
|
1500
|
-
ret = CQ.multiFilter( selector, ret );
|
1501
|
-
|
1502
|
-
return this.pushStack(ret.uniq());
|
1503
|
-
};
|
1504
|
-
});
|
1505
|
-
|
1506
|
-
CQ.each({
|
1507
|
-
appendTo: "append",
|
1508
|
-
prependTo: "prepend",
|
1509
|
-
insertBefore: "before",
|
1510
|
-
insertAfter: "after",
|
1511
|
-
replaceAll: "replaceWith"
|
1512
|
-
}, function(name, original){
|
1513
|
-
CQ.fn[ name ] = function() {
|
1514
|
-
var args = arguments;
|
1515
|
-
|
1516
|
-
return this.each(function(){
|
1517
|
-
for ( var i = 0, length = args.length; i < length; i++ )
|
1518
|
-
CQ( args[ i ] )[ original ]( this );
|
1519
|
-
});
|
1520
|
-
};
|
1521
|
-
});
|
1522
|
-
|
1523
|
-
CQ.each({
|
1524
|
-
removeAttr: function( name ) {
|
1525
|
-
CQ.attr( this, name, "" );
|
1526
|
-
if (this.nodeType == 1) this.removeAttribute( name );
|
1527
|
-
},
|
1528
|
-
|
1529
|
-
addClass: function( classNames ) {
|
1530
|
-
CQ.className.add( this, classNames );
|
1531
|
-
},
|
1532
|
-
|
1533
|
-
removeClass: function( classNames ) {
|
1534
|
-
CQ.className.remove( this, classNames );
|
1535
|
-
},
|
1536
|
-
|
1537
|
-
toggleClass: function( classNames ) {
|
1538
|
-
CQ.className[ CQ.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames );
|
1539
|
-
},
|
1540
|
-
|
1541
|
-
/**
|
1542
|
-
Removes either all elements or elements matching the selector. Note
|
1543
|
-
that this does NOT account for event handling, since events are not
|
1544
|
-
managed by CoreQuery, unlike jQuery.
|
1545
|
-
*/
|
1546
|
-
remove: function( selector ) {
|
1547
|
-
if ( !selector || CQ.filter( selector, [ this ] ).length ) {
|
1548
|
-
if (this.parentNode) this.parentNode.removeChild( this );
|
1549
|
-
}
|
1550
|
-
},
|
1551
|
-
|
1552
|
-
/**
|
1553
|
-
Removes the contents of the receiver, leaving it empty. Note that this
|
1554
|
-
does NOT deal with Event handling since that is not managed by
|
1555
|
-
CoreQuery.
|
1556
|
-
*/
|
1557
|
-
empty: function() {
|
1558
|
-
while ( this.firstChild ) this.removeChild( this.firstChild );
|
1559
|
-
}
|
1560
|
-
|
1561
|
-
}, function(name, fn){
|
1562
|
-
CQ.fn[name] = function(){ return this.each(fn, arguments); };
|
1563
|
-
});
|
1564
|
-
|
1565
|
-
// Setup width and height functions
|
1566
|
-
CQ.each([ "Height", "Width" ], function(i, name){
|
1567
|
-
var type = name.toLowerCase();
|
1568
|
-
|
1569
|
-
CQ.fn[ type ] = function( size ) {
|
1570
|
-
|
1571
|
-
// Get window width or height
|
1572
|
-
if(this[0] === window) {
|
1573
|
-
|
1574
|
-
// Opera reports document.body.client[Width/Height] properly in both
|
1575
|
-
// quirks and standards
|
1576
|
-
if (SC.browser.opera) {
|
1577
|
-
ret = document.body["client" + name];
|
1578
|
-
|
1579
|
-
// Safari reports inner[Width/Height] just fine (Mozilla and Opera
|
1580
|
-
// include scroll bar widths)
|
1581
|
-
} else if (SC.browser.safari) {
|
1582
|
-
ret = window["inner" + name] ;
|
1583
|
-
|
1584
|
-
// Everyone else use document.documentElement or document.body
|
1585
|
-
// depending on Quirks vs Standards mode
|
1586
|
-
} else if (document.compatMode) {
|
1587
|
-
ret = documentElement['client' + name];
|
1588
|
-
} else ret = document.body['client' + name];
|
1589
|
-
|
1590
|
-
// get document width or height
|
1591
|
-
} else if (this[0] === document) {
|
1592
|
-
// Either scroll[Width/Height] or offset[Width/Height], whichever is
|
1593
|
-
// greater
|
1594
|
-
ret = Math.max(
|
1595
|
-
Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]),
|
1596
|
-
Math.max(document.body["offset" + name], document.documentElement["offset" + name])) ;
|
1597
|
-
|
1598
|
-
// get/set element width/or height
|
1599
|
-
} else {
|
1600
|
-
if (size == undefined) {
|
1601
|
-
return this.length ? CQ.css(this[0], type) : null ;
|
1602
|
-
|
1603
|
-
// Set the width or height on the element (default to pixels if value is unitless)
|
1604
|
-
} else {
|
1605
|
-
return this.css(type, (size.constructor==String) ? size : size+"px");
|
1606
|
-
}
|
1607
|
-
}
|
1608
|
-
return ret ;
|
1609
|
-
};
|
1610
|
-
|
1611
|
-
var tl = i ? "Left" : "Top", // top or left
|
1612
|
-
br = i ? "Right" : "Bottom"; // bottom or right
|
1613
|
-
|
1614
|
-
// innerHeight and innerWidth
|
1615
|
-
CQ.fn["inner" + name] = function(){
|
1616
|
-
return this[ name.toLowerCase() ]() +
|
1617
|
-
num(this, "padding" + tl) +
|
1618
|
-
num(this, "padding" + br);
|
1619
|
-
};
|
1620
|
-
|
1621
|
-
// outerHeight and outerWidth
|
1622
|
-
CQ.fn["outer" + name] = function(margin) {
|
1623
|
-
return this["inner" + name]() +
|
1624
|
-
num(this, "border" + tl + "Width") +
|
1625
|
-
num(this, "border" + br + "Width") +
|
1626
|
-
(margin ? num(this, "margin" + tl) + num(this, "margin" + br) : 0);
|
1627
|
-
};
|
1628
|
-
|
1629
|
-
});
|
1630
|
-
|
1631
|
-
// The Offset Method
|
1632
|
-
// Originally By Brandon Aaron, part of the Dimension Plugin
|
1633
|
-
// http://jquery.com/plugins/project/dimensions
|
1634
|
-
|
1635
|
-
/** Calculates the offset for the first passed element. */
|
1636
|
-
CoreQuery.fn.offset = function() {
|
1637
|
-
var left = 0, top = 0, elem = this[0], br = SC.browser, results;
|
1638
|
-
if (!elem) return undefined;
|
1639
|
-
|
1640
|
-
function border(elem) {
|
1641
|
-
add( CQ.curCSS(elem, "borderLeftWidth", true), CQ.curCSS(elem, "borderTopWidth", true) );
|
1642
|
-
}
|
1643
|
-
|
1644
|
-
function add(l, t) {
|
1645
|
-
left += parseInt(l, 10) || 0;
|
1646
|
-
top += parseInt(t, 10) || 0;
|
1647
|
-
}
|
1648
|
-
|
1649
|
-
var parent = elem.parentNode,
|
1650
|
-
offsetChild = elem,
|
1651
|
-
offsetParent = elem.offsetParent,
|
1652
|
-
doc = elem.ownerDocument,
|
1653
|
-
safari2 = br.safari && parseInt(br.version,0) < 522 && !(/adobeair/i).test(br.userAgent),
|
1654
|
-
css = CQ.curCSS,
|
1655
|
-
fixed = CQ.css(elem, "position") == "fixed";
|
1656
|
-
|
1657
|
-
// Use getBoundingClientRect if available
|
1658
|
-
if (!(br.mozilla && elem==document.body) && elem.getBoundingClientRect){
|
1659
|
-
var box = elem.getBoundingClientRect();
|
1660
|
-
|
1661
|
-
// Add the document scroll offsets
|
1662
|
-
add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
|
1663
|
-
box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop));
|
1664
|
-
|
1665
|
-
// IE adds the HTML element's border, by default it is medium which is
|
1666
|
-
// 2px IE 6 and 7 quirks mode the border width is overwritable by the
|
1667
|
-
// following css html { border: 0; } IE 7 standards mode, the border is
|
1668
|
-
// always 2px This border/offset is typically represented by the
|
1669
|
-
// clientLeft and clientTop properties
|
1670
|
-
// However, in IE6 and 7 quirks mode the clientLeft and clientTop
|
1671
|
-
// properties are not updated when overwriting it via CSS
|
1672
|
-
// Therefore this method will be off by 2px in IE while in quirksmode
|
1673
|
-
add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
|
1674
|
-
|
1675
|
-
// Otherwise loop through the offsetParents and parentNodes
|
1676
|
-
} else {
|
1677
|
-
|
1678
|
-
// Initial element offsets
|
1679
|
-
add( elem.offsetLeft, elem.offsetTop );
|
1680
|
-
|
1681
|
-
// Get parent offsets
|
1682
|
-
while ( offsetParent ) {
|
1683
|
-
// Add offsetParent offsets
|
1684
|
-
add( offsetParent.offsetLeft, offsetParent.offsetTop );
|
1685
|
-
|
1686
|
-
// Mozilla and Safari > 2 does not include the border on offset parents
|
1687
|
-
// However Mozilla adds the border for table or table cells
|
1688
|
-
if ( br.mozilla && !(/^t(able|d|h)$/i).test(offsetParent.tagName) || br.safari && !safari2 ) border( offsetParent );
|
1689
|
-
|
1690
|
-
// Add the document scroll offsets if position is fixed on any
|
1691
|
-
// offsetParent
|
1692
|
-
if (!fixed && css(offsetParent, "position") == "fixed") fixed = true;
|
1693
|
-
|
1694
|
-
// Set offsetChild to previous offsetParent unless it is the body
|
1695
|
-
// element
|
1696
|
-
offsetChild = (/^body$/i).test(offsetParent.tagName) ? offsetChild : offsetParent;
|
1697
|
-
// Get next offsetParent
|
1698
|
-
offsetParent = offsetParent.offsetParent;
|
1699
|
-
}
|
1700
|
-
|
1701
|
-
// Get parent scroll offsets
|
1702
|
-
while ( parent && parent.tagName && !(/^body|html$/i).test(parent.tagName)) {
|
1703
|
-
|
1704
|
-
// Remove parent scroll UNLESS that parent is inline or a table to
|
1705
|
-
// work around Opera inline/table scrollLeft/Top bug
|
1706
|
-
if ( !(/^inline|table.*$/i).test(css(parent, "display")) ) {
|
1707
|
-
// Subtract parent scroll offsets
|
1708
|
-
add( -parent.scrollLeft, -parent.scrollTop );
|
1709
|
-
}
|
1710
|
-
|
1711
|
-
// Mozilla does not add the border for a parent that has overflow !=
|
1712
|
-
// visible
|
1713
|
-
if ( mozilla && css(parent, "overflow") != "visible" ) border(parent);
|
1714
|
-
|
1715
|
-
// Get next parent
|
1716
|
-
parent = parent.parentNode;
|
1717
|
-
}
|
1718
|
-
|
1719
|
-
// Safari <= 2 doubles body offsets with a fixed position
|
1720
|
-
// element/offsetParent or absolutely positioned offsetChild
|
1721
|
-
// Mozilla doubles body offsets with a non-absolutely positioned
|
1722
|
-
// offsetChild
|
1723
|
-
if ((safari2 && (fixed || css(offsetChild, "position") == "absolute"))||
|
1724
|
-
(br.mozilla && css(offsetChild, "position") != "absolute") ) {
|
1725
|
-
add( -doc.body.offsetLeft, -doc.body.offsetTop );
|
1726
|
-
}
|
1727
|
-
|
1728
|
-
// Add the document scroll offsets if position is fixed
|
1729
|
-
if ( fixed ) {
|
1730
|
-
add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
|
1731
|
-
Math.max(doc.documentElement.scrollTop, doc.body.scrollTop));
|
1732
|
-
}
|
1733
|
-
}
|
1734
|
-
|
1735
|
-
// Return an object with top and left properties
|
1736
|
-
results = { top: top, left: left };
|
1737
|
-
|
1738
|
-
return results;
|
1739
|
-
};
|
1740
|
-
|
1741
|
-
CoreQuery.fn.mixin({
|
1742
|
-
position: function() {
|
1743
|
-
var left = 0, top = 0, results;
|
1744
|
-
|
1745
|
-
if ( this[0] ) {
|
1746
|
-
// Get *real* offsetParent
|
1747
|
-
var offsetParent = this.offsetParent(),
|
1748
|
-
|
1749
|
-
// Get correct offsets
|
1750
|
-
offset = this.offset(),
|
1751
|
-
parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
|
1752
|
-
|
1753
|
-
// Subtract element margins
|
1754
|
-
// note: when an element has margin: auto the offsetLeft and marginLeft
|
1755
|
-
// are the same in Safari causing offset.left to incorrectly be 0
|
1756
|
-
offset.top -= num( this, 'marginTop' );
|
1757
|
-
offset.left -= num( this, 'marginLeft' );
|
1758
|
-
|
1759
|
-
// Add offsetParent borders
|
1760
|
-
parentOffset.top += num( offsetParent, 'borderTopWidth' );
|
1761
|
-
parentOffset.left += num( offsetParent, 'borderLeftWidth' );
|
1762
|
-
|
1763
|
-
// Subtract the two offsets
|
1764
|
-
results = {
|
1765
|
-
top: offset.top - parentOffset.top,
|
1766
|
-
left: offset.left - parentOffset.left
|
1767
|
-
};
|
1768
|
-
}
|
1769
|
-
|
1770
|
-
return results;
|
1771
|
-
},
|
1772
|
-
|
1773
|
-
offsetParent: function() {
|
1774
|
-
var offsetParent = this[0].offsetParent || document.body;
|
1775
|
-
while ( offsetParent && (!(/^body|html$/i).test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) {
|
1776
|
-
offsetParent = offsetParent.offsetParent;
|
1777
|
-
}
|
1778
|
-
return CQ(offsetParent);
|
1779
|
-
}
|
1780
|
-
}) ;
|
1781
|
-
|
1782
|
-
|
1783
|
-
// Create scrollLeft and scrollTop methods
|
1784
|
-
CQ.each( ['Left', 'Top'], function(i, name) {
|
1785
|
-
var method = 'scroll' + name;
|
1786
|
-
|
1787
|
-
CQ.fn[ method ] = function(val) {
|
1788
|
-
if (!this[0]) return;
|
1789
|
-
|
1790
|
-
return val != undefined ?
|
1791
|
-
|
1792
|
-
// Set the scroll offset
|
1793
|
-
this.each(function() {
|
1794
|
-
this == window || this == document ?
|
1795
|
-
window.scrollTo(
|
1796
|
-
!i ? val : CQ(window).scrollLeft(),
|
1797
|
-
i ? val : CQ(window).scrollTop()
|
1798
|
-
) :
|
1799
|
-
this[ method ] = val;
|
1800
|
-
}) :
|
1801
|
-
|
1802
|
-
// Return the scroll offset
|
1803
|
-
this[0] == window || this[0] == document ?
|
1804
|
-
self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
|
1805
|
-
CQ.boxModel && document.documentElement[ method ] ||
|
1806
|
-
document.body[ method ] : this[0][ method ];
|
1807
|
-
};
|
1808
|
-
});
|
1809
|
-
|
1810
|
-
|
1811
|
-
return CoreQuery ;
|
1812
|
-
}()) ;
|
1813
|
-
|
1814
|
-
// Install CoreQuery or jQuery, depending on what is available, as SC.$().
|
1815
|
-
SC.$ = (typeof jQuery == "undefined") ? SC.CoreQuery : jQuery ;
|
1816
|
-
|
1817
|
-
// Add some plugins to CoreQuery. If jQuery is installed, it will get these
|
1818
|
-
// also. -- test in system/core_query/additions
|
1819
|
-
SC.mixin(SC.$.fn, /** @scope SC.CoreQuery.prototype */ {
|
1820
|
-
|
1821
|
-
isCoreQuery: YES, // walk like a duck
|
1822
|
-
|
1823
|
-
/** @private - better loggin */
|
1824
|
-
toString: function() {
|
1825
|
-
var values = [];
|
1826
|
-
var len = this.length, idx=0;
|
1827
|
-
for(idx=0;idx<len;idx++) {
|
1828
|
-
values[idx] = '%@: %@'.fmt(idx,(this[idx]) ? this[idx].toString() : '(null)');
|
1829
|
-
}
|
1830
|
-
return "<$:%@>(%@)".fmt(SC.guidFor(this),values.join(' , '));
|
1831
|
-
},
|
1832
|
-
|
1833
|
-
/**
|
1834
|
-
Returns YES if all member elements are visible. This is provided as a
|
1835
|
-
common test since CoreQuery does not support filtering by
|
1836
|
-
psuedo-selector.
|
1837
|
-
*/
|
1838
|
-
isVisible: function() {
|
1839
|
-
return Array.prototype.every.call(this, function(elem){
|
1840
|
-
return SC.$.isVisible(elem);
|
1841
|
-
});
|
1842
|
-
},
|
1843
|
-
|
1844
|
-
/** Returns a new CQ object with only the first item in the object. */
|
1845
|
-
first: function() {
|
1846
|
-
return this.pushStack([this[0]]);
|
1847
|
-
},
|
1848
|
-
|
1849
|
-
/** Returns a new CQ object with only the last item in the set. */
|
1850
|
-
last: function() {
|
1851
|
-
return this.pushStack([this[this.length-1]]);
|
1852
|
-
},
|
1853
|
-
|
1854
|
-
/**
|
1855
|
-
Attempts to find the views managing the passed DOM elements and returns
|
1856
|
-
them. This will start with the matched element and walk up the DOM until
|
1857
|
-
it finds an element managed by a view.
|
1858
|
-
|
1859
|
-
@returns {Array} array of views or null.
|
1860
|
-
*/
|
1861
|
-
view: function() {
|
1862
|
-
return this.map(function() {
|
1863
|
-
var ret=null, guidKey = SC.viewKey, dom = this, value;
|
1864
|
-
while(!ret && dom && (dom !== document)) {
|
1865
|
-
if (value = dom.getAttribute('id')) ret = SC.View.views[value] ;
|
1866
|
-
dom = dom.parentNode;
|
1867
|
-
}
|
1868
|
-
dom =null;
|
1869
|
-
return ret ;
|
1870
|
-
});
|
1871
|
-
},
|
1872
|
-
|
1873
|
-
/**
|
1874
|
-
You can either pass a single class name and a boolean indicating whether
|
1875
|
-
the value should be added or removed, or you can pass a hash with all
|
1876
|
-
the class names you want to add or remove with a boolean indicating
|
1877
|
-
whether they should be there or not.
|
1878
|
-
|
1879
|
-
This is far more efficient than using addClass/removeClass.
|
1880
|
-
|
1881
|
-
@param {String|Hash} className class name or hash of classNames + bools
|
1882
|
-
@param {Boolean} shouldAdd for class name if a string was passed
|
1883
|
-
@returns {SC.CoreQuery} receiver
|
1884
|
-
*/
|
1885
|
-
setClass: function(className, shouldAdd) {
|
1886
|
-
if (SC.none(className)) return this; //nothing to do
|
1887
|
-
var isHash = SC.typeOf(className) !== SC.T_STRING ;
|
1888
|
-
var fix = this._fixupClass, key;
|
1889
|
-
this.each(function() {
|
1890
|
-
if (this.nodeType !== 1) return; // nothing to do
|
1891
|
-
|
1892
|
-
// collect the class name from the element and build an array
|
1893
|
-
var classNames = this.className.split(/\s+/), didChange = NO;
|
1894
|
-
|
1895
|
-
// loop through hash or just fix single className
|
1896
|
-
if (isHash) {
|
1897
|
-
for(var key in className) {
|
1898
|
-
if (!className.hasOwnProperty(key)) continue ;
|
1899
|
-
didChange = fix(classNames, key, className[key]) || didChange;
|
1900
|
-
}
|
1901
|
-
} else didChange = fix(classNames, className, shouldAdd);
|
1902
|
-
|
1903
|
-
// if classNames were changed, join them and set...
|
1904
|
-
if (didChange) this.className = classNames.join(' ');
|
1905
|
-
});
|
1906
|
-
return this ;
|
1907
|
-
},
|
1908
|
-
|
1909
|
-
/** @private used by setClass */
|
1910
|
-
_fixupClass: function(classNames, name, shouldAdd) {
|
1911
|
-
var indexOf = classNames.indexOf(name);
|
1912
|
-
// if should add, add class...
|
1913
|
-
if (shouldAdd) {
|
1914
|
-
if (indexOf < 0) { classNames.push(name); return YES ; }
|
1915
|
-
|
1916
|
-
// otherwise, null out class name (this will leave some extra spaces)
|
1917
|
-
} else if (indexOf >= 0) { classNames[indexOf]=null; return YES; }
|
1918
|
-
return NO ;
|
1919
|
-
},
|
1920
|
-
|
1921
|
-
/**
|
1922
|
-
Returns YES if any of the matched elements have the passed element or CQ object as a child element.
|
1923
|
-
*/
|
1924
|
-
within: function(el) {
|
1925
|
-
el = SC.$(el); // make into CQ object
|
1926
|
-
var ret, elCur, myCur, idx, len = el.length;
|
1927
|
-
var loc = this.length;
|
1928
|
-
while(!ret && (--loc >= 0)) {
|
1929
|
-
myCur = this[loc];
|
1930
|
-
for(idx=0; !ret && (idx<len); idx++) {
|
1931
|
-
elCur = el[idx];
|
1932
|
-
while(elCur && (elCur !== myCur)) elCur = elCur.parentNode;
|
1933
|
-
ret = elCur === myCur ;
|
1934
|
-
}
|
1935
|
-
}
|
1936
|
-
myCur = elCur = null ; // clear memory
|
1937
|
-
return ret ;
|
1938
|
-
}
|
1939
|
-
|
1940
|
-
});
|
1941
|
-
|
1942
|
-
/**
|
1943
|
-
Make CoreQuery enumerable. Since some methods need to be disambiguated,
|
1944
|
-
we will implement some wrapper functions here.
|
1945
|
-
|
1946
|
-
Note that SC.Enumerable is implemented on SC.Builder, which means the
|
1947
|
-
CoreQuery object inherits this automatically. jQuery does not extend from
|
1948
|
-
SC.Builder though, so we reapply SC.Enumerable just to be safe.
|
1949
|
-
*/
|
1950
|
-
(function() {
|
1951
|
-
var original = {};
|
1952
|
-
|
1953
|
-
var wrappers = {
|
1954
|
-
|
1955
|
-
// if you call find with a selector, then use the jQuery way. If you
|
1956
|
-
// call with a function/target, use Enumerable way
|
1957
|
-
find: function(callback,target) {
|
1958
|
-
return (target !== undefined) ? SC.Enumerable.find.call(this, callback, target) : original.find.call(this, callback) ;
|
1959
|
-
},
|
1960
|
-
|
1961
|
-
// ditto for filter - execute SC.Enumerable style if a target is passed.
|
1962
|
-
filter: function(callback,target) {
|
1963
|
-
return (target !== undefined) ?
|
1964
|
-
this.pushStack(SC.Enumerable.filter.call(this, callback, target)) :
|
1965
|
-
original.filter.call(this, callback) ;
|
1966
|
-
},
|
1967
|
-
|
1968
|
-
// filterProperty is an SC.Enumerable thing, but it needs to be wrapped
|
1969
|
-
// in a CoreQuery object.
|
1970
|
-
filterProperty: function(key, value) {
|
1971
|
-
return this.pushStack(
|
1972
|
-
SC.Enumerable.filterProperty.call(this,key,value));
|
1973
|
-
},
|
1974
|
-
|
1975
|
-
// indexOf() is best implemented using the jQuery index()
|
1976
|
-
indexOf: SC.$.index,
|
1977
|
-
|
1978
|
-
// map() is a little tricky because jQuery is non-standard. If you pass
|
1979
|
-
// a context object, we will treat it like SC.Enumerable. Otherwise use
|
1980
|
-
// jQuery.
|
1981
|
-
map: function(callback, target) {
|
1982
|
-
return (target !== undefined) ?
|
1983
|
-
SC.Enumerable.map.call(this, callback, target) :
|
1984
|
-
original.map.call(this, callback);
|
1985
|
-
}
|
1986
|
-
};
|
1987
|
-
|
1988
|
-
// loop through an update some enumerable methods. If this is CoreQuery,
|
1989
|
-
// we just need to patch up the wrapped methods. If this is jQuery, we
|
1990
|
-
// need to go through the entire set of SC.Enumerable.
|
1991
|
-
var isCoreQuery = SC.$.jquery === 'SC.CoreQuery';
|
1992
|
-
var fn = SC.$.fn, enumerable = isCoreQuery ? wrappers : SC.Enumerable ;
|
1993
|
-
for(var key in enumerable) {
|
1994
|
-
if (!enumerable.hasOwnProperty(key)) continue ;
|
1995
|
-
var value = enumerable[key];
|
1996
|
-
if (key in wrappers) {
|
1997
|
-
original[key] = fn[key]; value = wrappers[key];
|
1998
|
-
}
|
1999
|
-
fn[key] = value;
|
2000
|
-
}
|
2001
|
-
})();
|
2002
|
-
|
2003
|
-
// Add some global helper methods.
|
2004
|
-
SC.mixin(SC.$, {
|
2005
|
-
|
2006
|
-
/** @private helper method to determine if an element is visible. Exposed
|
2007
|
-
for use in testing. */
|
2008
|
-
isVisible: function(elem) {
|
2009
|
-
var CQ = SC.$;
|
2010
|
-
return ("hidden"!=elem.type) && (CQ.css(elem,"display")!="none") && (CQ.css(elem,"visibility")!="hidden");
|
2011
|
-
}
|
2012
|
-
|
2013
|
-
}) ;
|
2014
|
-
|
2015
|
-
|