radiant 0.6.9 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +105 -3
- data/CONTRIBUTORS +29 -0
- data/INSTALL +4 -2
- data/LICENSE +1 -1
- data/README +4 -0
- data/app/controllers/admin/abstract_model_controller.rb +4 -0
- data/app/controllers/admin/extensions_controller.rb +5 -0
- data/app/controllers/admin/layouts_controller.rb +6 -0
- data/app/controllers/admin/page_parts_controller.rb +9 -0
- data/app/controllers/admin/pages_controller.rb +56 -0
- data/app/controllers/admin/preferences_controller.rb +46 -0
- data/app/controllers/admin/references_controller.rb +7 -0
- data/app/controllers/admin/resource_controller.rb +180 -0
- data/app/controllers/admin/snippets_controller.rb +2 -0
- data/app/controllers/admin/users_controller.rb +21 -0
- data/app/controllers/admin/welcome_controller.rb +1 -1
- data/app/controllers/application.rb +7 -3
- data/app/controllers/site_controller.rb +0 -7
- data/app/helpers/admin/extensions_helper.rb +2 -0
- data/app/helpers/admin/layouts_helper.rb +2 -0
- data/app/helpers/admin/pages_helper.rb +59 -0
- data/app/helpers/admin/preferences_helper.rb +2 -0
- data/app/helpers/admin/references_helper.rb +42 -0
- data/app/helpers/admin/snippets_helper.rb +2 -0
- data/app/helpers/admin/users_helper.rb +8 -0
- data/app/helpers/application_helper.rb +12 -8
- data/app/models/page.rb +33 -3
- data/app/models/page_part.rb +5 -1
- data/app/models/radiant/config.rb +3 -3
- data/app/models/response_cache.rb +20 -12
- data/app/models/standard_tags.rb +285 -180
- data/app/models/user.rb +5 -1
- data/app/views/admin/extensions/index.html.haml +40 -0
- data/app/views/admin/layouts/_form.html.haml +36 -0
- data/app/views/admin/layouts/edit.html.haml +7 -0
- data/app/views/admin/layouts/index.html.haml +34 -0
- data/app/views/admin/layouts/new.html.haml +5 -0
- data/app/views/admin/layouts/remove.html.haml +16 -0
- data/app/views/admin/page_parts/_page_part.html.haml +15 -0
- data/app/views/admin/pages/_edit_styles.html.haml +15 -0
- data/app/views/admin/pages/_fields.html.haml +60 -0
- data/app/views/admin/pages/_meta_row.html.haml +6 -0
- data/app/views/admin/pages/_node.html.haml +25 -0
- data/app/views/admin/pages/_popups.html.haml +30 -0
- data/app/views/admin/pages/children.html.haml +2 -0
- data/app/views/admin/pages/edit.html.haml +9 -0
- data/app/views/admin/pages/index.html.haml +28 -0
- data/app/views/admin/pages/new.html.haml +9 -0
- data/app/views/admin/pages/remove.html.haml +21 -0
- data/app/views/admin/preferences/edit.html.haml +36 -0
- data/app/views/admin/references/_tag_reference.haml +3 -0
- data/app/views/admin/references/filters.js.erb +5 -0
- data/app/views/admin/references/tags.js.erb +5 -0
- data/app/views/admin/snippets/_form.html.haml +29 -0
- data/app/views/admin/snippets/edit.html.haml +5 -0
- data/app/views/admin/snippets/index.html.haml +30 -0
- data/app/views/admin/snippets/new.html.haml +5 -0
- data/app/views/admin/snippets/remove.html.haml +19 -0
- data/app/views/admin/users/_form.html.haml +74 -0
- data/app/views/admin/users/edit.html.haml +5 -0
- data/app/views/admin/users/index.html.haml +35 -0
- data/app/views/admin/users/new.html.haml +5 -0
- data/app/views/admin/users/remove.html.haml +18 -0
- data/app/views/layouts/application.html.haml +5 -5
- data/config/boot.rb +24 -7
- data/config/environment.rb +7 -3
- data/config/environments/development.rb +0 -1
- data/config/environments/test.rb +1 -5
- data/config/routes.rb +21 -49
- data/db/migrate/20081203140407_add_indexes.rb +19 -0
- data/db/schema.rb +10 -3
- data/db/templates/roasters.yml +1210 -0
- data/lib/generators/extension/templates/extension.rb +4 -2
- data/lib/generators/extension/templates/spec_helper.rb +2 -3
- data/lib/generators/extension/templates/tasks.rake +1 -1
- data/lib/generators/extension_controller/extension_controller_generator.rb +11 -3
- data/lib/generators/extension_controller/templates/controller.rb +0 -4
- data/lib/generators/extension_controller/templates/functional_test.rb +1 -7
- data/lib/generators/extension_controller/templates/{view.rhtml → view.html.erb} +0 -0
- data/lib/generators/extension_mailer/USAGE +17 -0
- data/lib/generators/extension_mailer/extension_mailer_generator.rb +68 -0
- data/lib/generators/extension_mailer/templates/fixture.erb +3 -0
- data/lib/generators/extension_mailer/templates/mailer.rb +15 -0
- data/lib/generators/extension_mailer/templates/unit_test.rb +21 -0
- data/lib/generators/extension_mailer/templates/view.erb +3 -0
- data/lib/generators/extension_migration/USAGE +34 -0
- data/lib/generators/extension_migration/extension_migration_generator.rb +25 -0
- data/lib/generators/extension_migration/templates/migration.rb +11 -0
- data/lib/generators/extension_model/extension_model_generator.rb +10 -2
- data/lib/generators/extension_model/templates/fixtures.yml +11 -3
- data/lib/generators/extension_model/templates/migration.rb +4 -1
- data/lib/generators/extension_model/templates/unit_test.rb +2 -4
- data/lib/generators/generator_base_extension.rb +0 -7
- data/lib/generators/instance/templates/instance_boot.rb +27 -7
- data/lib/generators/instance/templates/instance_environment.rb +1 -2
- data/lib/generators/instance/templates/instance_generate +2 -0
- data/lib/local_time.rb +2 -2
- data/lib/login_system.rb +18 -31
- data/lib/plugins/active_record_extensions/lib/active_record_extensions.rb +30 -1
- data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +1 -1
- data/lib/plugins/string_extensions/lib/string_extensions.rb +7 -0
- data/lib/radiant.rb +2 -2
- data/lib/radiant/admin_ui.rb +41 -3
- data/lib/radiant/compat.rb +10 -0
- data/lib/radiant/extension.rb +9 -10
- data/lib/radiant/extension/script.rb +103 -7
- data/lib/radiant/extension_loader.rb +1 -1
- data/lib/radiant/extension_migrator.rb +77 -38
- data/lib/radiant/initializer.rb +13 -1
- data/lib/radiant/legacy_routes.rb +72 -0
- data/lib/radiant/resource_responses.rb +115 -0
- data/lib/radiant/taggable.rb +17 -0
- data/lib/tasks/database.rake +0 -42
- data/lib/tasks/extensions.rake +1 -23
- data/lib/tasks/framework.rake +3 -1
- data/lib/tasks/instance.rake +7 -10
- data/lib/tasks/release.rake +22 -8
- data/lib/tasks/rspec.rake +173 -0
- data/lib/tasks/undefine.rake +1 -1
- data/public/javascripts/admin/admin.js +14 -16
- data/public/javascripts/admin/sitemap.js +1 -1
- data/public/javascripts/controls.js +4 -6
- data/public/javascripts/dragdrop.js +1 -3
- data/public/javascripts/effects.js +1 -3
- data/public/javascripts/prototype.js +132 -91
- data/public/stylesheets/admin/main.css +13 -1
- data/script/autospec +5 -0
- data/script/dbconsole +3 -0
- data/script/generate +2 -2
- data/script/performance/request +3 -0
- data/script/spec +3 -10
- data/script/spec_server +22 -5
- data/spec/controllers/admin/export_controller_spec.rb +1 -1
- data/spec/controllers/admin/extensions_controller_spec.rb +21 -0
- data/spec/controllers/admin/layouts_controller_spec.rb +56 -0
- data/spec/controllers/admin/pages_controller_spec.rb +187 -0
- data/spec/controllers/admin/preferences_controller_spec.rb +38 -0
- data/spec/controllers/admin/references_controller_spec.rb +15 -0
- data/spec/controllers/admin/snippets_controller_spec.rb +51 -0
- data/spec/controllers/admin/users_controller_spec.rb +48 -0
- data/spec/controllers/admin/welcome_controller_spec.rb +2 -2
- data/spec/controllers/application_controller_spec.rb +7 -3
- data/spec/controllers/site_controller_spec.rb +5 -38
- data/spec/datasets/file_not_found_dataset.rb +22 -0
- data/spec/datasets/home_page_dataset.rb +64 -0
- data/spec/datasets/layouts_dataset.rb +58 -0
- data/spec/datasets/markup_pages_dataset.rb +13 -0
- data/spec/datasets/pages_dataset.rb +56 -0
- data/spec/datasets/pages_with_layouts_dataset.rb +10 -0
- data/spec/datasets/snippets_dataset.rb +38 -0
- data/spec/datasets/users_and_pages_dataset.rb +9 -0
- data/spec/datasets/users_dataset.rb +43 -0
- data/spec/fixtures/example_extension/README +3 -0
- data/spec/fixtures/example_extension/Rakefile +120 -0
- data/spec/fixtures/example_extension/example_extension.rb +21 -0
- data/spec/fixtures/example_extension/lib/tasks/example_extension_tasks.rake +28 -0
- data/spec/fixtures/example_extension/spec/spec.opts +6 -0
- data/spec/fixtures/example_extension/spec/spec_helper.rb +36 -0
- data/spec/generators/extension_controller_generator_spec.rb +85 -0
- data/spec/generators/extension_generator_spec.rb +172 -0
- data/spec/generators/extension_generators_spec_helper.rb +139 -0
- data/spec/generators/extension_mailer_generator_spec.rb +60 -0
- data/spec/generators/extension_migration_generator_spec.rb +21 -0
- data/spec/generators/extension_model_generator_spec.rb +61 -0
- data/spec/helpers/admin/extensions_helper_spec.rb +4 -0
- data/spec/helpers/admin/layouts_helper_spec.rb +4 -0
- data/spec/helpers/admin/node_helper_spec.rb +33 -31
- data/spec/helpers/admin/pages_helper_spec.rb +63 -0
- data/spec/helpers/admin/preferences_helper_spec.rb +11 -0
- data/spec/helpers/admin/regions_helper_spec.rb +16 -13
- data/spec/helpers/admin/snippets_helper_spec.rb +4 -0
- data/spec/helpers/admin/users_helper_spec.rb +11 -0
- data/spec/helpers/application_helper_spec.rb +75 -61
- data/spec/integration/admin/content_negotiation_spec.rb +27 -0
- data/spec/integration/admin/pages_integration_spec.rb +118 -0
- data/spec/integration/admin/permission_integration_spec.rb +24 -0
- data/spec/integration/admin/snippets_integration_spec.rb +73 -0
- data/spec/integration/admin/user_management_integration_spec.rb +80 -0
- data/spec/integration/admin/user_preferences_integration_spec.rb +19 -0
- data/spec/integration/page_serving_spec.rb +37 -0
- data/spec/lib/autotest_spec.rb +1 -1
- data/spec/lib/core_ext/string_ext_spec.rb +10 -0
- data/spec/lib/login_system_spec.rb +143 -135
- data/spec/lib/radiant/admin_ui_spec.rb +33 -1
- data/spec/lib/radiant/extension/script_spec.rb +111 -4
- data/spec/lib/radiant/extension_migrator_spec.rb +31 -2
- data/spec/lib/radiant/extension_spec.rb +5 -1
- data/spec/lib/radiant/legacy_routes_spec.rb +14 -0
- data/spec/lib/radiant/resource_responses_spec.rb +207 -0
- data/spec/lib/radiant/taggable_spec.rb +38 -2
- data/{vendor/plugins/rspec/spec → spec/matchers}/autotest_matchers.rb +0 -0
- data/spec/matchers/generator_matchers.rb +237 -0
- data/spec/matchers/login_system_matcher.rb +1 -1
- data/spec/matchers/render_form_errors_matcher.rb +62 -0
- data/spec/matchers/render_matcher.rb +2 -2
- data/spec/models/file_not_found_page_spec.rb +1 -1
- data/spec/models/layout_spec.rb +1 -1
- data/spec/models/page_context_spec.rb +2 -4
- data/spec/models/page_part_spec.rb +24 -4
- data/spec/models/page_spec.rb +162 -110
- data/spec/models/radiant/exporter_spec.rb +1 -1
- data/spec/models/response_cache_spec.rb +28 -1
- data/spec/models/snippet_spec.rb +1 -1
- data/spec/models/standard_tags_spec.rb +52 -8
- data/spec/models/user_action_observer_spec.rb +1 -1
- data/spec/models/user_spec.rb +3 -3
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +45 -2
- data/test/fixtures/extensions/01_basic/basic_extension.rb +1 -1
- data/test/fixtures/extensions/01_basic/db/migrate/200812131420_create_initial_schema.rb +10 -0
- data/test/fixtures/extensions/01_basic/db/migrate/200812131421_modify_initial_schema.rb +10 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/01_first.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/02_second.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/03_pending.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/04_dont_run.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/upgrading_extension.rb +2 -0
- data/test/fixtures/extensions/special_characters/db/migrate/001_create_initial_schema.rb +10 -0
- data/test/fixtures/extensions/special_characters/special_characters_extension.rb +3 -0
- data/test/helpers/page_test_helper.rb +3 -1
- data/vendor/extensions/archive/spec/datasets/archive_dataset.rb +51 -0
- data/vendor/extensions/archive/spec/models/archive_day_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_month_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_year_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/spec_helper.rb +2 -3
- data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +5 -4
- data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +33 -0
- data/vendor/extensions/markdown_filter/lib/smarty_pants_filter.rb +0 -2
- data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +18 -1
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +11 -4
- data/vendor/extensions/markdown_filter/spec/models/smarty_pants_filter_spec.rb +8 -1
- data/vendor/extensions/markdown_filter/spec/spec_helper.rb +2 -3
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/CHANGES +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/LICENSE +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/README +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/bin/bluecloth +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/install.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/lib/bluecloth.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/test.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/00_Class.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/05_Markdown.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/10_Bug.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/15_Contrib.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/bctestcase.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/antsugar.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/ml-announce.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/re-overflow.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/re-overflow2.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/utils.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/README +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/Rakefile +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/install.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/rubypants.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/test_rubypants.rb +0 -0
- data/vendor/extensions/textile_filter/lib/textile_filter.rb +0 -2
- data/vendor/extensions/textile_filter/lib/textile_tags.rb +24 -0
- data/vendor/extensions/textile_filter/spec/models/textile_filter_spec.rb +9 -1
- data/vendor/extensions/textile_filter/spec/spec_helper.rb +2 -3
- data/vendor/extensions/textile_filter/textile_filter_extension.rb +3 -2
- data/vendor/plugins/dataset/History.txt +9 -0
- data/vendor/plugins/dataset/LICENSE +19 -0
- data/vendor/plugins/dataset/Manifest.txt +21 -0
- data/vendor/plugins/dataset/README.txt +111 -0
- data/vendor/plugins/dataset/Rakefile +20 -0
- data/vendor/plugins/dataset/TODO +19 -0
- data/vendor/plugins/dataset/lib/dataset.rb +123 -0
- data/vendor/plugins/dataset/lib/dataset/base.rb +157 -0
- data/vendor/plugins/dataset/lib/dataset/collection.rb +19 -0
- data/vendor/plugins/dataset/lib/dataset/database/base.rb +30 -0
- data/vendor/plugins/dataset/lib/dataset/database/mysql.rb +34 -0
- data/vendor/plugins/dataset/lib/dataset/database/postgresql.rb +34 -0
- data/vendor/plugins/dataset/lib/dataset/database/sqlite3.rb +32 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/rspec.rb +21 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/test_unit.rb +60 -0
- data/vendor/plugins/dataset/lib/dataset/instance_methods.rb +10 -0
- data/vendor/plugins/dataset/lib/dataset/load.rb +47 -0
- data/vendor/plugins/dataset/lib/dataset/record/fixture.rb +54 -0
- data/vendor/plugins/dataset/lib/dataset/record/meta.rb +42 -0
- data/vendor/plugins/dataset/lib/dataset/record/model.rb +41 -0
- data/vendor/plugins/dataset/lib/dataset/resolver.rb +110 -0
- data/vendor/plugins/dataset/lib/dataset/session.rb +51 -0
- data/vendor/plugins/dataset/lib/dataset/session_binding.rb +299 -0
- data/vendor/plugins/dataset/lib/dataset/version.rb +9 -0
- data/vendor/plugins/dataset/spec/dataset/database/base_spec.rb +21 -0
- data/vendor/plugins/dataset/spec/dataset/resolver_spec.rb +110 -0
- data/vendor/plugins/dataset/spec/dataset/rspec_spec.rb +137 -0
- data/vendor/plugins/dataset/spec/dataset/session_binding_spec.rb +160 -0
- data/vendor/plugins/dataset/spec/dataset/session_spec.rb +299 -0
- data/vendor/plugins/dataset/spec/dataset/test_unit_spec.rb +209 -0
- data/vendor/plugins/{rspec/spec/spec/runner/empty_file.txt → dataset/spec/fixtures/datasets/constant_not_defined.rb} +0 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/ending_with_dataset.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/exact_name.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/not_a_dataset_base.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/more_datasets/in_another_directory.rb +2 -0
- data/vendor/plugins/dataset/spec/models.rb +6 -0
- data/vendor/plugins/dataset/spec/schema.rb +24 -0
- data/vendor/plugins/{scenarios → dataset}/spec/spec.opts +0 -0
- data/vendor/plugins/dataset/spec/spec_helper.rb +49 -0
- data/vendor/plugins/dataset/tasks/dataset.rake +19 -0
- data/vendor/plugins/{scenarios → spec_integration}/LICENSE +0 -0
- data/vendor/plugins/spec_integration/README +117 -0
- data/vendor/plugins/spec_integration/Rakefile +10 -0
- data/vendor/plugins/spec_integration/lib/spec/integration.rb +10 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl.rb +11 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/form.rb +157 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/integration_example_group.rb +97 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/navigation.rb +102 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions.rb +8 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/action_controller.rb +25 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/hash.rb +48 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers.rb +1 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/display_object.rb +41 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/have_link_to.rb +35 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/navigate_successfully.rb +60 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/showing.rb +44 -0
- data/vendor/plugins/spec_integration/spec/application.rb +3 -0
- data/vendor/plugins/spec_integration/spec/dispatcher.rb +24 -0
- data/vendor/plugins/spec_integration/spec/dsl/form_spec.rb +130 -0
- data/vendor/plugins/spec_integration/spec/dsl/integration_spec_spec.rb +38 -0
- data/vendor/plugins/spec_integration/spec/dsl/navigation_spec.rb +35 -0
- data/vendor/plugins/spec_integration/spec/integration_dsl_controller.rb +5 -0
- data/vendor/plugins/spec_integration/spec/spec.opts +7 -0
- data/vendor/plugins/spec_integration/spec/spec_helper.rb +10 -0
- data/vendor/plugins/spec_integration/tasks/integration.rake +14 -0
- data/vendor/plugins/vizres/CHANGELOG +15 -0
- data/vendor/plugins/vizres/MIT-LICENSE +16 -0
- data/vendor/plugins/vizres/README +80 -0
- data/vendor/plugins/vizres/Rakefile +22 -0
- data/vendor/plugins/vizres/init.rb +1 -0
- data/vendor/plugins/vizres/lib/vizres.rb +33 -0
- data/vendor/plugins/vizres/lib/vizres/browser.rb +36 -0
- data/vendor/plugins/vizres/lib/vizres/scm.rb +27 -0
- data/vendor/plugins/vizres/test/vizres/browser_test.rb +76 -0
- data/vendor/plugins/vizres/test/vizres/scm_test.rb +41 -0
- data/vendor/plugins/vizres/test/vizres_test.rb +55 -0
- data/vendor/plugins/vizres/vizres.gemspec +26 -0
- data/vendor/rails/actionmailer/CHANGELOG +21 -0
- data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
- data/vendor/rails/actionmailer/README +14 -10
- data/vendor/rails/actionmailer/Rakefile +8 -4
- data/vendor/rails/actionmailer/lib/action_mailer.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +145 -101
- data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +7 -7
- data/vendor/rails/actionmailer/lib/action_mailer/part.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +3 -1
- data/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +15 -10
- data/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb +5 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb +426 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +46 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb +46 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb +41 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb +67 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb +63 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb +581 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb +960 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb +9 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb +1130 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb +3 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb +578 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb +495 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb +6 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb +3 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb +248 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb +132 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +1476 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.1.0 → tmail-1.2.3}/tmail/port.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb +118 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb +58 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb +49 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb +261 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb +280 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb +337 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb +39 -0
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionmailer/test/abstract_unit.rb +13 -6
- data/vendor/rails/actionmailer/test/delivery_method_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_helper_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_render_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_service_test.rb +50 -10
- data/vendor/rails/actionmailer/test/quoting_test.rb +19 -32
- data/vendor/rails/actionmailer/test/test_helper_test.rb +14 -2
- data/vendor/rails/actionmailer/test/tmail_test.rb +1 -1
- data/vendor/rails/actionmailer/test/url_test.rb +2 -2
- data/vendor/rails/actionpack/CHANGELOG +216 -0
- data/vendor/rails/actionpack/MIT-LICENSE +1 -1
- data/vendor/rails/actionpack/README +1 -1
- data/vendor/rails/actionpack/Rakefile +13 -8
- data/vendor/rails/actionpack/lib/action_controller.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +2 -1
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +8 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +8 -5
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +56 -73
- data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +3 -3
- data/vendor/rails/actionpack/lib/action_controller/base.rb +115 -136
- data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +3 -3
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +41 -652
- data/vendor/rails/actionpack/lib/action_controller/caching/actions.rb +144 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +138 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/pages.rb +154 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb +18 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb +97 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +28 -24
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +6 -4
- data/vendor/rails/actionpack/lib/action_controller/components.rb +7 -6
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +31 -19
- data/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +51 -84
- data/vendor/rails/actionpack/lib/action_controller/filters.rb +294 -419
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +1 -6
- data/vendor/rails/actionpack/lib/action_controller/headers.rb +31 -0
- data/vendor/rails/actionpack/lib/action_controller/helpers.rb +26 -9
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +3 -5
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +68 -15
- data/vendor/rails/actionpack/lib/action_controller/layout.rb +38 -54
- data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +7 -3
- data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +26 -7
- data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +123 -20
- data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +30 -17
- data/vendor/rails/actionpack/lib/action_controller/request.rb +79 -45
- data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +48 -40
- data/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +44 -13
- data/vendor/rails/actionpack/lib/action_controller/rescue.rb +24 -24
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +66 -23
- data/vendor/rails/actionpack/lib/action_controller/response.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +120 -1232
- data/vendor/rails/actionpack/lib/action_controller/routing/builder.rb +203 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/optimisations.rb +120 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb +162 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/route.rb +240 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +436 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/routing_ext.rb +46 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/segments.rb +283 -0
- data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +18 -14
- data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +22 -20
- data/vendor/rails/actionpack/lib/action_controller/session_management.rb +10 -3
- data/vendor/rails/actionpack/lib/action_controller/streaming.rb +45 -31
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +5 -5
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +41 -11
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +46 -40
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +44 -37
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/verification.rb +73 -57
- data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view.rb +11 -3
- data/vendor/rails/actionpack/lib/action_view/base.rb +86 -381
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +84 -63
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +126 -60
- data/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +50 -18
- data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +5 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +3 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +1 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +107 -85
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +156 -78
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +57 -24
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +47 -21
- data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +4 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +11 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +69 -37
- data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +23 -17
- data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +86 -60
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +4 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +153 -125
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +90 -41
- data/vendor/rails/actionpack/lib/action_view/inline_template.rb +20 -0
- data/vendor/rails/actionpack/lib/action_view/partial_template.rb +70 -0
- data/vendor/rails/actionpack/lib/action_view/partials.rb +31 -73
- data/vendor/rails/actionpack/lib/action_view/template.rb +127 -0
- data/vendor/rails/actionpack/lib/action_view/template_error.rb +18 -10
- data/vendor/rails/actionpack/lib/action_view/template_finder.rb +177 -0
- data/vendor/rails/actionpack/lib/action_view/template_handler.rb +18 -1
- data/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +10 -2
- data/vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb +128 -0
- data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +37 -2
- data/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +14 -1
- data/vendor/rails/actionpack/lib/action_view/test_case.rb +58 -0
- data/vendor/rails/actionpack/test/abstract_unit.rb +1 -1
- data/vendor/rails/actionpack/test/active_record_unit.rb +3 -6
- data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +2 -3
- data/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +158 -41
- data/vendor/rails/actionpack/test/adv_attr_test.rb +20 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +57 -6
- data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/assert_select_test.rb +19 -7
- data/vendor/rails/actionpack/test/controller/base_test.rb +88 -3
- data/vendor/rails/actionpack/test/controller/benchmark_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/caching_test.rb +282 -21
- data/vendor/rails/actionpack/test/controller/capture_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/cgi_test.rb +5 -4
- data/vendor/rails/actionpack/test/controller/components_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +13 -2
- data/vendor/rails/actionpack/test/controller/custom_handler_test.rb +14 -10
- data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/dispatcher_test.rb +33 -51
- data/vendor/rails/actionpack/test/controller/fake_controllers.rb +17 -0
- data/vendor/rails/actionpack/test/controller/fake_models.rb +6 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +14 -8
- data/vendor/rails/actionpack/test/controller/filters_test.rb +44 -19
- data/vendor/rails/actionpack/test/controller/flash_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/header_test.rb +14 -0
- data/vendor/rails/actionpack/test/controller/helper_test.rb +19 -15
- data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +26 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +15 -6
- data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +2 -3
- data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +8 -2
- data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/integration_test.rb +14 -17
- data/vendor/rails/actionpack/test/controller/integration_upload_test.rb +43 -0
- data/vendor/rails/actionpack/test/controller/layout_test.rb +26 -6
- data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +39 -7
- data/vendor/rails/actionpack/test/controller/mime_type_test.rb +34 -5
- data/vendor/rails/actionpack/test/controller/new_render_test.rb +150 -37
- data/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +153 -77
- data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +38 -2
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +32 -1
- data/vendor/rails/actionpack/test/controller/render_test.rb +78 -15
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +101 -5
- data/vendor/rails/actionpack/test/controller/request_test.rb +103 -11
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +22 -6
- data/vendor/rails/actionpack/test/controller/resources_test.rb +117 -31
- data/vendor/rails/actionpack/test/controller/routing_test.rb +286 -25
- data/vendor/rails/actionpack/test/controller/selector_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +14 -3
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +16 -4
- data/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +3 -4
- data/vendor/rails/actionpack/test/controller/session_fixation_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/session_management_test.rb +23 -1
- data/vendor/rails/actionpack/test/controller/test_test.rb +82 -10
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +69 -5
- data/vendor/rails/actionpack/test/controller/verification_test.rb +35 -18
- data/vendor/rails/actionpack/test/controller/view_paths_test.rb +15 -12
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +48 -3
- data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/company.rb +1 -0
- data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +6 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/good_customers/_good_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/mascot.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/mascots.yml +4 -0
- data/vendor/rails/actionpack/test/fixtures/mascots/_mascot.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/controls.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/dragdrop.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/effects.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/prototype.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/version.1.0.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/version.1.0.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/reply.rb +1 -0
- data/vendor/rails/actionpack/test/fixtures/shared.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb +5 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_counter.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_form.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_labelling_form.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_raise.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/greeting.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_from_template.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/topics/_topic.html.erb +1 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +25 -8
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +117 -30
- data/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +81 -3
- data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +10 -22
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +515 -162
- data/vendor/rails/actionpack/test/template/deprecated_erb_variable_test.rb +9 -0
- data/vendor/rails/actionpack/test/template/erb_util_test.rb +10 -42
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +192 -66
- data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +514 -477
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +42 -8
- data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +10 -13
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +7 -3
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +41 -46
- data/vendor/rails/actionpack/test/template/record_tag_helper_test.rb +54 -0
- data/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +5 -6
- data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +7 -13
- data/vendor/rails/actionpack/test/template/tag_helper_test.rb +3 -6
- data/vendor/rails/actionpack/test/template/template_finder_test.rb +73 -0
- data/vendor/rails/actionpack/test/template/template_object_test.rb +95 -0
- data/vendor/rails/actionpack/test/template/test_test.rb +56 -0
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +75 -43
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +20 -12
- data/vendor/rails/actionpack/test/testing_sandbox.rb +8 -4
- data/vendor/rails/activerecord/CHANGELOG +235 -2
- data/vendor/rails/activerecord/README +27 -22
- data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +7 -4
- data/vendor/rails/activerecord/Rakefile +27 -26
- data/vendor/rails/activerecord/lib/active_record.rb +16 -12
- data/vendor/rails/activerecord/lib/active_record/aggregations.rb +21 -12
- data/vendor/rails/activerecord/lib/active_record/association_preload.rb +285 -0
- data/vendor/rails/activerecord/lib/active_record/associations.rb +696 -453
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +167 -39
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +73 -13
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +5 -3
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +5 -6
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +26 -79
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +19 -72
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +90 -120
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +9 -7
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +32 -0
- data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +73 -22
- data/vendor/rails/activerecord/lib/active_record/base.rb +581 -308
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +52 -27
- data/vendor/rails/activerecord/lib/active_record/callbacks.rb +9 -38
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +4 -3
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +9 -4
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +6 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +248 -56
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +159 -37
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +10 -13
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +99 -36
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +204 -57
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +43 -16
- data/vendor/rails/activerecord/lib/active_record/dirty.rb +165 -0
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +144 -181
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +15 -11
- data/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/migration.rb +187 -81
- data/vendor/rails/activerecord/lib/active_record/named_scope.rb +168 -0
- data/vendor/rails/activerecord/lib/active_record/observer.rb +24 -8
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +38 -14
- data/vendor/rails/activerecord/lib/active_record/schema.rb +7 -14
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +4 -4
- data/vendor/rails/activerecord/lib/active_record/serialization.rb +5 -5
- data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +37 -28
- data/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +52 -29
- data/vendor/rails/activerecord/lib/active_record/test_case.rb +47 -0
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +4 -4
- data/vendor/rails/activerecord/lib/active_record/transactions.rb +6 -8
- data/vendor/rails/activerecord/lib/active_record/validations.rb +201 -255
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/test/{fixtures → assets}/example.log +0 -0
- data/vendor/rails/activerecord/test/{fixtures → assets}/flowers.jpg +0 -0
- data/vendor/rails/activerecord/test/cases/aaa_create_tables_test.rb +24 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +95 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb +24 -0
- data/vendor/rails/activerecord/test/cases/adapter_test.rb +127 -0
- data/vendor/rails/activerecord/test/cases/adapter_test_sqlserver.rb +95 -0
- data/vendor/rails/activerecord/test/cases/aggregations_test.rb +128 -0
- data/vendor/rails/activerecord/test/cases/ar_schema_test.rb +33 -0
- data/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +431 -0
- data/vendor/rails/activerecord/test/cases/associations/callbacks_test.rb +161 -0
- data/vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +123 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb +36 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +83 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_singularization_test.rb +145 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_test.rb +643 -0
- data/vendor/rails/activerecord/test/cases/associations/extension_test.rb +62 -0
- data/vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +706 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +1034 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +200 -0
- data/vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb +345 -0
- data/vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +113 -0
- data/vendor/rails/activerecord/test/cases/associations/inner_join_association_test.rb +88 -0
- data/vendor/rails/activerecord/test/cases/associations/join_model_test.rb +714 -0
- data/vendor/rails/activerecord/test/cases/associations_test.rb +262 -0
- data/vendor/rails/activerecord/test/cases/attribute_methods_test.rb +238 -0
- data/vendor/rails/activerecord/test/cases/base_test.rb +2015 -0
- data/vendor/rails/activerecord/test/cases/binary_test.rb +34 -0
- data/vendor/rails/activerecord/test/cases/calculations_test.rb +323 -0
- data/vendor/rails/activerecord/test/cases/callbacks_test.rb +400 -0
- data/vendor/rails/activerecord/test/cases/class_inheritable_attributes_test.rb +32 -0
- data/vendor/rails/activerecord/test/cases/column_alias_test.rb +17 -0
- data/vendor/rails/activerecord/test/cases/column_definition_test.rb +36 -0
- data/vendor/rails/activerecord/test/cases/connection_test_firebird.rb +8 -0
- data/vendor/rails/activerecord/test/cases/connection_test_mysql.rb +30 -0
- data/vendor/rails/activerecord/test/cases/copy_table_test_sqlite.rb +69 -0
- data/vendor/rails/activerecord/test/cases/database_statements_test.rb +12 -0
- data/vendor/rails/activerecord/test/cases/datatype_test_postgresql.rb +203 -0
- data/vendor/rails/activerecord/test/cases/date_time_test.rb +37 -0
- data/vendor/rails/activerecord/test/cases/default_test_firebird.rb +16 -0
- data/vendor/rails/activerecord/test/cases/defaults_test.rb +69 -0
- data/vendor/rails/activerecord/test/cases/deprecated_finder_test.rb +30 -0
- data/vendor/rails/activerecord/test/cases/dirty_test.rb +257 -0
- data/vendor/rails/activerecord/test/cases/finder_respond_to_test.rb +76 -0
- data/vendor/rails/activerecord/test/cases/finder_test.rb +898 -0
- data/vendor/rails/activerecord/test/cases/fixtures_test.rb +626 -0
- data/vendor/rails/activerecord/test/cases/helper.rb +47 -0
- data/vendor/rails/activerecord/test/cases/inheritance_test.rb +262 -0
- data/vendor/rails/activerecord/test/cases/invalid_date_test.rb +24 -0
- data/vendor/rails/activerecord/test/cases/json_serialization_test.rb +205 -0
- data/vendor/rails/activerecord/test/cases/lifecycle_test.rb +193 -0
- data/vendor/rails/activerecord/test/cases/locking_test.rb +309 -0
- data/vendor/rails/activerecord/test/cases/method_scoping_test.rb +462 -0
- data/vendor/rails/activerecord/test/cases/migration_test.rb +1444 -0
- data/vendor/rails/activerecord/test/cases/migration_test_firebird.rb +124 -0
- data/vendor/rails/activerecord/test/cases/mixin_test.rb +96 -0
- data/vendor/rails/activerecord/test/cases/modules_test.rb +39 -0
- data/vendor/rails/activerecord/test/cases/multiple_db_test.rb +60 -0
- data/vendor/rails/activerecord/test/cases/named_scope_test.rb +206 -0
- data/vendor/rails/activerecord/test/cases/pk_test.rb +101 -0
- data/vendor/rails/activerecord/test/cases/query_cache_test.rb +127 -0
- data/vendor/rails/activerecord/test/cases/readonly_test.rb +107 -0
- data/vendor/rails/activerecord/test/cases/reflection_test.rb +176 -0
- data/vendor/rails/activerecord/test/cases/reserved_word_test_mysql.rb +176 -0
- data/vendor/rails/activerecord/test/cases/schema_authorization_test_postgresql.rb +75 -0
- data/vendor/rails/activerecord/test/cases/schema_dumper_test.rb +184 -0
- data/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +102 -0
- data/vendor/rails/activerecord/test/cases/serialization_test.rb +47 -0
- data/vendor/rails/activerecord/test/cases/synonym_test_oracle.rb +17 -0
- data/vendor/rails/activerecord/test/cases/table_name_test_sqlserver.rb +23 -0
- data/vendor/rails/activerecord/test/cases/threaded_connections_test.rb +48 -0
- data/vendor/rails/activerecord/test/cases/transactions_test.rb +307 -0
- data/vendor/rails/activerecord/test/cases/unconnected_test.rb +32 -0
- data/vendor/rails/activerecord/test/cases/validations_test.rb +1541 -0
- data/vendor/rails/activerecord/test/cases/xml_serialization_test.rb +202 -0
- data/vendor/rails/activerecord/test/config.rb +5 -0
- data/vendor/rails/activerecord/test/connections/native_db2/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +1 -3
- data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +2 -2
- data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +2 -2
- data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +3 -3
- data/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/fixtures/author_addresses.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/authors.yml +2 -0
- data/vendor/rails/activerecord/test/fixtures/clubs.yml +6 -0
- data/vendor/rails/activerecord/test/fixtures/jobs.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/members.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/memberships.yml +20 -0
- data/vendor/rails/activerecord/test/fixtures/owners.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/people.yml +4 -1
- data/vendor/rails/activerecord/test/fixtures/pets.yml +14 -0
- data/vendor/rails/activerecord/test/fixtures/posts.yml +1 -0
- data/vendor/rails/activerecord/test/fixtures/price_estimates.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/readers.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/references.yml +17 -0
- data/vendor/rails/activerecord/test/fixtures/sponsors.yml +9 -0
- data/vendor/rails/activerecord/test/fixtures/subscribers.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/subscriptions.yml +12 -0
- data/vendor/rails/activerecord/test/fixtures/taggings.yml +4 -1
- data/vendor/rails/activerecord/test/fixtures/topics.yml +22 -2
- data/vendor/rails/activerecord/test/fixtures/warehouse-things.yml +3 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_decimal → migrations/decimal}/1_give_me_big_numbers.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_duplicate → migrations/duplicate}/3_foo.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations → migrations/duplicate}/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507052938_chunky.rb +7 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507053028_chunky.rb +7 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_duplicate → migrations/interleaved/pass_1}/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_2/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_missing_versions/4_innocent_jointable.rb → migrations/interleaved/pass_2/3_innocent_jointable.rb} +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +8 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/missing/3_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/valid/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/valid/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/models/author.rb +137 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/auto_id.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/binary.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/book.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/categorization.rb +0 -0
- data/vendor/rails/activerecord/test/models/category.rb +30 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/citation.rb +0 -0
- data/vendor/rails/activerecord/test/models/club.rb +7 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/column_name.rb +0 -0
- data/vendor/rails/activerecord/test/models/comment.rb +25 -0
- data/vendor/rails/activerecord/test/models/company.rb +132 -0
- data/vendor/rails/activerecord/test/models/company_in_module.rb +61 -0
- data/vendor/rails/activerecord/test/models/computer.rb +3 -0
- data/vendor/rails/activerecord/test/models/contact.rb +16 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/course.rb +0 -0
- data/vendor/rails/activerecord/test/models/customer.rb +55 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/default.rb +0 -0
- data/vendor/rails/activerecord/test/models/developer.rb +79 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/edge.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/entrant.rb +0 -0
- data/vendor/rails/activerecord/test/models/guid.rb +2 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/item.rb +0 -0
- data/vendor/rails/activerecord/test/models/job.rb +5 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/joke.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/keyboard.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/legacy_thing.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/matey.rb +0 -0
- data/vendor/rails/activerecord/test/models/member.rb +9 -0
- data/vendor/rails/activerecord/test/models/membership.rb +9 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/minimalistic.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/mixed_case_monkey.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/movie.rb +0 -0
- data/vendor/rails/activerecord/test/models/order.rb +4 -0
- data/vendor/rails/activerecord/test/models/owner.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/parrot.rb +0 -0
- data/vendor/rails/activerecord/test/models/person.rb +10 -0
- data/vendor/rails/activerecord/test/models/pet.rb +4 -0
- data/vendor/rails/activerecord/test/models/pirate.rb +9 -0
- data/vendor/rails/activerecord/test/models/post.rb +85 -0
- data/vendor/rails/activerecord/test/models/price_estimate.rb +3 -0
- data/vendor/rails/activerecord/test/models/project.rb +29 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/reader.rb +0 -0
- data/vendor/rails/activerecord/test/models/reference.rb +4 -0
- data/vendor/rails/activerecord/test/models/reply.rb +39 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/ship.rb +0 -0
- data/vendor/rails/activerecord/test/models/sponsor.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/subject.rb +0 -0
- data/vendor/rails/activerecord/test/models/subscriber.rb +8 -0
- data/vendor/rails/activerecord/test/models/subscription.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/tag.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/tagging.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/task.rb +0 -0
- data/vendor/rails/activerecord/test/models/topic.rb +66 -0
- data/vendor/rails/activerecord/test/models/treasure.rb +6 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/vertex.rb +0 -0
- data/vendor/rails/activerecord/test/models/warehouse_thing.rb +5 -0
- data/vendor/rails/activerecord/test/schema/mysql_specific_schema.rb +12 -0
- data/vendor/rails/activerecord/test/schema/postgresql_specific_schema.rb +103 -0
- data/vendor/rails/activerecord/test/schema/schema.rb +429 -0
- data/vendor/rails/activerecord/test/schema/schema2.rb +6 -0
- data/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb +25 -0
- data/vendor/rails/activerecord/test/schema/sqlserver_specific_schema.rb +5 -0
- data/vendor/rails/activeresource/CHANGELOG +33 -0
- data/vendor/rails/activeresource/Rakefile +9 -5
- data/vendor/rails/activeresource/lib/active_resource.rb +1 -1
- data/vendor/rails/activeresource/lib/active_resource/base.rb +309 -160
- data/vendor/rails/activeresource/lib/active_resource/connection.rb +41 -6
- data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +58 -44
- data/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +1 -1
- data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +82 -12
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +2 -2
- data/vendor/rails/activeresource/lib/active_resource/version.rb +1 -1
- data/vendor/rails/activeresource/test/abstract_unit.rb +17 -1
- data/vendor/rails/activeresource/test/authorization_test.rb +45 -5
- data/vendor/rails/activeresource/test/base/custom_methods_test.rb +6 -3
- data/vendor/rails/activeresource/test/base/equality_test.rb +1 -1
- data/vendor/rails/activeresource/test/base/load_test.rb +36 -1
- data/vendor/rails/activeresource/test/base_errors_test.rb +1 -1
- data/vendor/rails/activeresource/test/base_test.rb +422 -28
- data/vendor/rails/activeresource/test/connection_test.rb +22 -2
- data/vendor/rails/activeresource/test/fixtures/customer.rb +3 -0
- data/vendor/rails/activeresource/test/format_test.rb +43 -2
- data/vendor/rails/activeresource/test/setter_trap.rb +1 -1
- data/vendor/rails/activesupport/CHANGELOG +214 -2
- data/vendor/rails/activesupport/lib/active_support.rb +13 -1
- data/vendor/rails/activesupport/lib/active_support/base64.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/basic_object.rb +23 -4
- data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +17 -3
- data/vendor/rails/activesupport/lib/active_support/cache.rb +147 -0
- data/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/cache/drb_store.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/cache/file_store.rb +70 -0
- data/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +100 -0
- data/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +38 -0
- data/vendor/rails/activesupport/lib/active_support/callbacks.rb +275 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +2 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +89 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +3 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +39 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +5 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +28 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +13 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +37 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +41 -19
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +19 -13
- data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +6 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +27 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +4 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +6 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +4 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +10 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +2 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +4 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +11 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +5 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +56 -16
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +52 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/process.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/process/daemon.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +16 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +5 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/rexml.rb +36 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +5 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +72 -48
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/filters.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +58 -63
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +12 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +54 -30
- data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/test/unit/assertions.rb +5 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +24 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +75 -23
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +33 -38
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/zones.rb +86 -0
- data/vendor/rails/activesupport/lib/active_support/dependencies.rb +418 -405
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +29 -10
- data/vendor/rails/activesupport/lib/active_support/duration.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/gzip.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/inflections.rb +51 -49
- data/vendor/rails/activesupport/lib/active_support/inflector.rb +267 -236
- data/vendor/rails/activesupport/lib/active_support/json.rb +17 -25
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +9 -6
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +3 -6
- data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +8 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +10 -14
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +11 -11
- data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +43 -0
- data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +13 -43
- data/vendor/rails/activesupport/lib/active_support/string_inquirer.rb +11 -0
- data/vendor/rails/activesupport/lib/active_support/test_case.rb +10 -2
- data/vendor/rails/activesupport/lib/active_support/testing/default.rb +3 -6
- data/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb +93 -0
- data/vendor/rails/activesupport/lib/active_support/time_with_zone.rb +304 -0
- data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +378 -163
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb +849 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/data_timezone.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/data_timezone_info.rb +228 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Casablanca.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Argentina/San_Juan.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Bogota.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Caracas.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Chicago.rb +283 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Denver.rb +204 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Godthab.rb +161 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Halifax.rb +274 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Juneau.rb +194 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Lima.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/New_York.rb +282 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Regina.rb +74 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Santiago.rb +205 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Karachi.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Katmandu.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/London.rb +288 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/info_timezone.rb +52 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/linked_timezone.rb +51 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/linked_timezone_info.rb +44 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/offset_rationals.rb +98 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/ruby_core_support.rb +56 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/time_or_datetime.rb +292 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone.rb +508 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_definition.rb +56 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_info.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_offset_info.rb +94 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_period.rb +198 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_transition_info.rb +129 -0
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +30 -10
- data/vendor/rails/railties/CHANGELOG +148 -0
- data/vendor/rails/railties/MIT-LICENSE +1 -1
- data/vendor/rails/railties/README +67 -14
- data/vendor/rails/railties/Rakefile +15 -21
- data/vendor/rails/railties/bin/about +2 -1
- data/vendor/rails/railties/bin/dbconsole +3 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +22 -20
- data/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +1 -1
- data/vendor/rails/railties/configs/databases/frontbase.yml +2 -2
- data/vendor/rails/railties/configs/databases/mysql.yml +2 -2
- data/vendor/rails/railties/configs/databases/oracle.yml +3 -3
- data/vendor/rails/railties/configs/databases/postgresql.yml +2 -2
- data/vendor/rails/railties/configs/databases/sqlite2.yml +2 -2
- data/vendor/rails/railties/configs/databases/sqlite3.yml +2 -2
- data/vendor/rails/railties/configs/initializers/inflections.rb +1 -1
- data/vendor/rails/railties/configs/initializers/new_rails_defaults.rb +17 -0
- data/vendor/rails/railties/configs/routes.rb +8 -0
- data/vendor/rails/railties/dispatches/gateway.cgi +2 -2
- data/vendor/rails/railties/environments/boot.rb +6 -6
- data/vendor/rails/railties/environments/development.rb +0 -1
- data/vendor/rails/railties/environments/environment.rb +15 -7
- data/vendor/rails/railties/environments/production.rb +3 -0
- data/vendor/rails/railties/environments/test.rb +1 -1
- data/vendor/rails/railties/helpers/application.rb +5 -0
- data/vendor/rails/railties/html/images/rails.png +0 -0
- data/vendor/rails/railties/html/index.html +6 -9
- data/vendor/rails/railties/html/javascripts/controls.js +1 -1
- data/vendor/rails/railties/html/javascripts/dragdrop.js +1 -1
- data/vendor/rails/railties/html/javascripts/effects.js +1 -1
- data/vendor/rails/railties/lib/commands/about.rb +1 -0
- data/vendor/rails/railties/lib/commands/console.rb +5 -5
- data/vendor/rails/railties/lib/commands/dbconsole.rb +67 -0
- data/vendor/rails/railties/lib/commands/performance/profiler.rb +1 -1
- data/vendor/rails/railties/lib/commands/plugin.rb +30 -3
- data/vendor/rails/railties/lib/commands/server.rb +2 -2
- data/vendor/rails/railties/lib/commands/servers/lighttpd.rb +1 -1
- data/vendor/rails/railties/lib/commands/servers/mongrel.rb +9 -9
- data/vendor/rails/railties/lib/commands/servers/new_mongrel.rb +16 -0
- data/vendor/rails/railties/lib/commands/servers/webrick.rb +1 -1
- data/vendor/rails/railties/lib/console_app.rb +2 -2
- data/vendor/rails/railties/lib/console_sandbox.rb +2 -2
- data/vendor/rails/railties/lib/console_with_helpers.rb +1 -1
- data/vendor/rails/railties/lib/dispatcher.rb +1 -1
- data/vendor/rails/railties/lib/fcgi_handler.rb +32 -16
- data/vendor/rails/railties/lib/initializer.rb +303 -70
- data/vendor/rails/railties/lib/rails/gem_builder.rb +21 -0
- data/vendor/rails/railties/lib/rails/gem_dependency.rb +129 -0
- data/vendor/rails/railties/lib/rails/mongrel_server/commands.rb +342 -0
- data/vendor/rails/railties/lib/rails/mongrel_server/handler.rb +55 -0
- data/vendor/rails/railties/lib/rails/plugin.rb +51 -19
- data/vendor/rails/railties/lib/rails/plugin/loader.rb +4 -2
- data/vendor/rails/railties/lib/rails/plugin/locator.rb +24 -2
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/base.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/commands.rb +85 -54
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +9 -10
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +1 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +2 -6
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +8 -6
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +4 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +4 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -20
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +3 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +3 -4
- data/vendor/rails/railties/lib/rails_generator/lookup.rb +9 -4
- data/vendor/rails/railties/lib/rails_generator/options.rb +7 -0
- data/vendor/rails/railties/lib/rails_generator/scripts.rb +8 -5
- data/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +12 -8
- data/vendor/rails/railties/lib/source_annotation_extractor.rb +40 -0
- data/vendor/rails/railties/lib/tasks/databases.rake +81 -55
- data/vendor/rails/railties/lib/tasks/documentation.rake +4 -4
- data/vendor/rails/railties/lib/tasks/framework.rake +23 -27
- data/vendor/rails/railties/lib/tasks/gems.rake +64 -0
- data/vendor/rails/railties/lib/tasks/misc.rake +47 -0
- data/vendor/rails/railties/lib/tasks/rails.rb +1 -1
- data/vendor/rails/railties/lib/tasks/testing.rake +3 -3
- data/vendor/rails/railties/lib/test_help.rb +8 -0
- metadata +788 -1204
- data/app/controllers/admin/extension_controller.rb +0 -5
- data/app/controllers/admin/layout_controller.rb +0 -21
- data/app/controllers/admin/page_controller.rb +0 -115
- data/app/controllers/admin/snippet_controller.rb +0 -3
- data/app/controllers/admin/user_controller.rb +0 -44
- data/app/helpers/admin/extension_helper.rb +0 -2
- data/app/helpers/admin/layout_helper.rb +0 -2
- data/app/helpers/admin/page_helper.rb +0 -69
- data/app/helpers/admin/snippet_helper.rb +0 -2
- data/app/helpers/admin/user_helper.rb +0 -8
- data/app/models/radiant/extension_meta.rb +0 -5
- data/app/views/admin/extension/index.html.haml +0 -28
- data/app/views/admin/layout/edit.html.haml +0 -44
- data/app/views/admin/layout/index.html.haml +0 -25
- data/app/views/admin/layout/remove.html.haml +0 -16
- data/app/views/admin/page/_meta_row.html.haml +0 -6
- data/app/views/admin/page/_node.html.haml +0 -25
- data/app/views/admin/page/_part.html.haml +0 -17
- data/app/views/admin/page/_tag_reference.html.haml +0 -3
- data/app/views/admin/page/children.html.haml +0 -2
- data/app/views/admin/page/edit.html.haml +0 -115
- data/app/views/admin/page/filter_reference.rjs +0 -5
- data/app/views/admin/page/index.html.haml +0 -28
- data/app/views/admin/page/remove.html.haml +0 -20
- data/app/views/admin/page/tag_reference.rjs +0 -5
- data/app/views/admin/snippet/edit.html.haml +0 -36
- data/app/views/admin/snippet/index.html.haml +0 -20
- data/app/views/admin/snippet/remove.html.haml +0 -19
- data/app/views/admin/user/edit.html.haml +0 -80
- data/app/views/admin/user/index.html.haml +0 -23
- data/app/views/admin/user/preferences.html.haml +0 -28
- data/app/views/admin/user/remove.html.haml +0 -18
- data/lib/plugins/dependencies_fix/init.rb +0 -6
- data/lib/plugins/string_io/init.rb +0 -2
- data/spec/controllers/admin/abstract_model_controller_spec.rb +0 -265
- data/spec/controllers/admin/extension_controller_spec.rb +0 -21
- data/spec/controllers/admin/layout_controller_spec.rb +0 -42
- data/spec/controllers/admin/page_controller_spec.rb +0 -287
- data/spec/controllers/admin/snippet_controller_spec.rb +0 -27
- data/spec/controllers/admin/user_controller_spec.rb +0 -72
- data/spec/helpers/admin/extension_helper_spec.rb +0 -4
- data/spec/helpers/admin/layout_helper_spec.rb +0 -4
- data/spec/helpers/admin/page_helper_spec.rb +0 -45
- data/spec/helpers/admin/snippet_helper_spec.rb +0 -4
- data/spec/helpers/admin/user_helper_spec.rb +0 -11
- data/spec/scenarios/file_not_found_scenario.rb +0 -19
- data/spec/scenarios/home_page_scenario.rb +0 -64
- data/spec/scenarios/layouts_scenario.rb +0 -58
- data/spec/scenarios/markup_pages_scenario.rb +0 -13
- data/spec/scenarios/pages_scenario.rb +0 -56
- data/spec/scenarios/pages_with_layouts_scenario.rb +0 -10
- data/spec/scenarios/snippets_scenario.rb +0 -38
- data/spec/scenarios/users_and_pages_scenario.rb +0 -9
- data/spec/scenarios/users_scenario.rb +0 -43
- data/test/fixtures/extensions/01_basic/db/migrate/001_create_initial_schema.rb +0 -8
- data/test/fixtures/extensions/01_basic/db/migrate/002_modify_initial_schema.rb +0 -8
- data/test/fixtures/layouts.yml +0 -26
- data/test/fixtures/page_parts.yml +0 -119
- data/test/fixtures/pages.yml +0 -353
- data/test/fixtures/sample.txt +0 -1
- data/test/fixtures/snippets.yml +0 -26
- data/test/fixtures/users.yml +0 -35
- data/test/helpers/caching_test_helper.rb +0 -42
- data/test/helpers/difference_test_helper.rb +0 -13
- data/test/helpers/extension_fixture_test_helper.rb +0 -40
- data/test/helpers/extension_tag_test_helper.rb +0 -17
- data/test/helpers/layout_test_helper.rb +0 -35
- data/test/helpers/logging_test_helper.rb +0 -20
- data/test/helpers/login_test_helper.rb +0 -23
- data/test/helpers/page_part_test_helper.rb +0 -49
- data/test/helpers/routing_test_helper.rb +0 -19
- data/test/helpers/snippet_test_helper.rb +0 -32
- data/vendor/extensions/archive/spec/scenarios/archive_scenario.rb +0 -51
- data/vendor/plugins/rspec/CHANGES +0 -1079
- data/vendor/plugins/rspec/MIT-LICENSE +0 -20
- data/vendor/plugins/rspec/README +0 -71
- data/vendor/plugins/rspec/Rakefile +0 -279
- data/vendor/plugins/rspec/TODO +0 -2
- data/vendor/plugins/rspec/UPGRADE +0 -31
- data/vendor/plugins/rspec/bin/spec +0 -4
- data/vendor/plugins/rspec/bin/spec_translator +0 -8
- data/vendor/plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +0 -19
- data/vendor/plugins/rspec/examples/pure/before_and_after_example.rb +0 -40
- data/vendor/plugins/rspec/examples/pure/behave_as_example.rb +0 -45
- data/vendor/plugins/rspec/examples/pure/custom_expectation_matchers.rb +0 -54
- data/vendor/plugins/rspec/examples/pure/custom_formatter.rb +0 -12
- data/vendor/plugins/rspec/examples/pure/dynamic_spec.rb +0 -9
- data/vendor/plugins/rspec/examples/pure/file_accessor.rb +0 -19
- data/vendor/plugins/rspec/examples/pure/file_accessor_spec.rb +0 -38
- data/vendor/plugins/rspec/examples/pure/greeter_spec.rb +0 -31
- data/vendor/plugins/rspec/examples/pure/helper_method_example.rb +0 -14
- data/vendor/plugins/rspec/examples/pure/io_processor.rb +0 -8
- data/vendor/plugins/rspec/examples/pure/io_processor_spec.rb +0 -21
- data/vendor/plugins/rspec/examples/pure/legacy_spec.rb +0 -11
- data/vendor/plugins/rspec/examples/pure/mocking_example.rb +0 -27
- data/vendor/plugins/rspec/examples/pure/multi_threaded_behaviour_runner.rb +0 -28
- data/vendor/plugins/rspec/examples/pure/nested_classes_example.rb +0 -36
- data/vendor/plugins/rspec/examples/pure/partial_mock_example.rb +0 -28
- data/vendor/plugins/rspec/examples/pure/pending_example.rb +0 -20
- data/vendor/plugins/rspec/examples/pure/predicate_example.rb +0 -27
- data/vendor/plugins/rspec/examples/pure/priority.txt +0 -1
- data/vendor/plugins/rspec/examples/pure/shared_example_group_example.rb +0 -81
- data/vendor/plugins/rspec/examples/pure/shared_stack_examples.rb +0 -38
- data/vendor/plugins/rspec/examples/pure/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/examples/pure/stack.rb +0 -36
- data/vendor/plugins/rspec/examples/pure/stack_spec.rb +0 -63
- data/vendor/plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +0 -67
- data/vendor/plugins/rspec/examples/pure/stubbing_example.rb +0 -69
- data/vendor/plugins/rspec/examples/stories/adder.rb +0 -13
- data/vendor/plugins/rspec/examples/stories/addition +0 -34
- data/vendor/plugins/rspec/examples/stories/addition.rb +0 -9
- data/vendor/plugins/rspec/examples/stories/calculator.rb +0 -65
- data/vendor/plugins/rspec/examples/stories/game-of-life/README.txt +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/everything.rb +0 -6
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/examples.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +0 -35
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +0 -66
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story +0 -42
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story +0 -42
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanKillACell.story +0 -17
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/TheGridWraps.story +0 -53
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +0 -52
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/helper.rb +0 -6
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +0 -26
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/steps.rb +0 -5
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.txt +0 -22
- data/vendor/plugins/rspec/examples/stories/game-of-life/life.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/game.rb +0 -23
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/grid.rb +0 -43
- data/vendor/plugins/rspec/examples/stories/helper.rb +0 -9
- data/vendor/plugins/rspec/examples/stories/steps/addition_steps.rb +0 -18
- data/vendor/plugins/rspec/failing_examples/README.txt +0 -7
- data/vendor/plugins/rspec/failing_examples/diffing_spec.rb +0 -36
- data/vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +0 -19
- data/vendor/plugins/rspec/failing_examples/failure_in_setup.rb +0 -10
- data/vendor/plugins/rspec/failing_examples/failure_in_teardown.rb +0 -10
- data/vendor/plugins/rspec/failing_examples/mocking_example.rb +0 -40
- data/vendor/plugins/rspec/failing_examples/mocking_with_flexmock.rb +0 -26
- data/vendor/plugins/rspec/failing_examples/mocking_with_mocha.rb +0 -25
- data/vendor/plugins/rspec/failing_examples/mocking_with_rr.rb +0 -27
- data/vendor/plugins/rspec/failing_examples/partial_mock_example.rb +0 -20
- data/vendor/plugins/rspec/failing_examples/predicate_example.rb +0 -29
- data/vendor/plugins/rspec/failing_examples/raising_example.rb +0 -47
- data/vendor/plugins/rspec/failing_examples/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/failing_examples/syntax_error_example.rb +0 -7
- data/vendor/plugins/rspec/failing_examples/team_spec.rb +0 -44
- data/vendor/plugins/rspec/failing_examples/timeout_behaviour.rb +0 -7
- data/vendor/plugins/rspec/init.rb +0 -9
- data/vendor/plugins/rspec/lib/autotest/discover.rb +0 -3
- data/vendor/plugins/rspec/lib/autotest/rspec.rb +0 -72
- data/vendor/plugins/rspec/lib/spec.rb +0 -30
- data/vendor/plugins/rspec/lib/spec/example.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/example/configuration.rb +0 -144
- data/vendor/plugins/rspec/lib/spec/example/errors.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/example/example_group.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/example/example_group_factory.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb +0 -433
- data/vendor/plugins/rspec/lib/spec/example/example_matcher.rb +0 -42
- data/vendor/plugins/rspec/lib/spec/example/example_methods.rb +0 -110
- data/vendor/plugins/rspec/lib/spec/example/module_reopening_fix.rb +0 -21
- data/vendor/plugins/rspec/lib/spec/example/pending.rb +0 -18
- data/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/expectations.rb +0 -56
- data/vendor/plugins/rspec/lib/spec/expectations/differs/default.rb +0 -66
- data/vendor/plugins/rspec/lib/spec/expectations/errors.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/expectations/extensions.rb +0 -2
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb +0 -71
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/string_and_symbol.rb +0 -17
- data/vendor/plugins/rspec/lib/spec/expectations/handler.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/extensions.rb +0 -4
- data/vendor/plugins/rspec/lib/spec/extensions/class.rb +0 -24
- data/vendor/plugins/rspec/lib/spec/extensions/main.rb +0 -102
- data/vendor/plugins/rspec/lib/spec/extensions/metaclass.rb +0 -7
- data/vendor/plugins/rspec/lib/spec/extensions/object.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb +0 -61
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +0 -34
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +0 -61
- data/vendor/plugins/rspec/lib/spec/matchers.rb +0 -156
- data/vendor/plugins/rspec/lib/spec/matchers/be.rb +0 -224
- data/vendor/plugins/rspec/lib/spec/matchers/be_close.rb +0 -37
- data/vendor/plugins/rspec/lib/spec/matchers/change.rb +0 -144
- data/vendor/plugins/rspec/lib/spec/matchers/eql.rb +0 -43
- data/vendor/plugins/rspec/lib/spec/matchers/equal.rb +0 -43
- data/vendor/plugins/rspec/lib/spec/matchers/exist.rb +0 -17
- data/vendor/plugins/rspec/lib/spec/matchers/has.rb +0 -34
- data/vendor/plugins/rspec/lib/spec/matchers/have.rb +0 -145
- data/vendor/plugins/rspec/lib/spec/matchers/include.rb +0 -70
- data/vendor/plugins/rspec/lib/spec/matchers/match.rb +0 -41
- data/vendor/plugins/rspec/lib/spec/matchers/operator_matcher.rb +0 -73
- data/vendor/plugins/rspec/lib/spec/matchers/raise_error.rb +0 -132
- data/vendor/plugins/rspec/lib/spec/matchers/respond_to.rb +0 -45
- data/vendor/plugins/rspec/lib/spec/matchers/satisfy.rb +0 -47
- data/vendor/plugins/rspec/lib/spec/matchers/simple_matcher.rb +0 -29
- data/vendor/plugins/rspec/lib/spec/matchers/throw_symbol.rb +0 -74
- data/vendor/plugins/rspec/lib/spec/mocks.rb +0 -211
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +0 -31
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb.orig +0 -27
- data/vendor/plugins/rspec/lib/spec/mocks/argument_expectation.rb +0 -209
- data/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb +0 -84
- data/vendor/plugins/rspec/lib/spec/mocks/errors.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/mocks/extensions/object.rb +0 -3
- data/vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb +0 -269
- data/vendor/plugins/rspec/lib/spec/mocks/methods.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/mocks/mock.rb +0 -50
- data/vendor/plugins/rspec/lib/spec/mocks/order_group.rb +0 -29
- data/vendor/plugins/rspec/lib/spec/mocks/proxy.rb +0 -166
- data/vendor/plugins/rspec/lib/spec/mocks/space.rb +0 -28
- data/vendor/plugins/rspec/lib/spec/mocks/spec_methods.rb +0 -38
- data/vendor/plugins/rspec/lib/spec/rake/spectask.rb +0 -235
- data/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/runner.rb +0 -202
- data/vendor/plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +0 -57
- data/vendor/plugins/rspec/lib/spec/runner/class_and_arguments_parser.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/runner/command_line.rb +0 -28
- data/vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb +0 -20
- data/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb +0 -59
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +0 -77
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +0 -130
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_example_groups_formatter.rb +0 -33
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +0 -20
- data/vendor/plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +0 -333
- data/vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +0 -47
- data/vendor/plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +0 -30
- data/vendor/plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +0 -128
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +0 -131
- data/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner.rb +0 -72
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner_unsupported.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/runner/option_parser.rb +0 -205
- data/vendor/plugins/rspec/lib/spec/runner/options.rb +0 -288
- data/vendor/plugins/rspec/lib/spec/runner/reporter.rb +0 -147
- data/vendor/plugins/rspec/lib/spec/runner/spec_parser.rb +0 -71
- data/vendor/plugins/rspec/lib/spec/story.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/story/extensions.rb +0 -3
- data/vendor/plugins/rspec/lib/spec/story/extensions/main.rb +0 -86
- data/vendor/plugins/rspec/lib/spec/story/extensions/regexp.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/story/extensions/string.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/story/given_scenario.rb +0 -14
- data/vendor/plugins/rspec/lib/spec/story/runner.rb +0 -56
- data/vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +0 -48
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_collector.rb +0 -18
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb +0 -48
- data/vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb +0 -123
- data/vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb +0 -227
- data/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb +0 -70
- data/vendor/plugins/rspec/lib/spec/story/scenario.rb +0 -14
- data/vendor/plugins/rspec/lib/spec/story/step.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/story/step_group.rb +0 -89
- data/vendor/plugins/rspec/lib/spec/story/step_mother.rb +0 -37
- data/vendor/plugins/rspec/lib/spec/story/story.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/story/world.rb +0 -124
- data/vendor/plugins/rspec/lib/spec/translator.rb +0 -114
- data/vendor/plugins/rspec/lib/spec/version.rb +0 -22
- data/vendor/plugins/rspec/plugins/mock_frameworks/flexmock.rb +0 -23
- data/vendor/plugins/rspec/plugins/mock_frameworks/mocha.rb +0 -19
- data/vendor/plugins/rspec/plugins/mock_frameworks/rr.rb +0 -21
- data/vendor/plugins/rspec/plugins/mock_frameworks/rspec.rb +0 -18
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit.rb +0 -4
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb +0 -50
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +0 -54
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +0 -111
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +0 -314
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +0 -15
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +0 -51
- data/vendor/plugins/rspec/pre_commit/spec/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/pre_commit/spec/spec_suite.rb +0 -11
- data/vendor/plugins/rspec/rake_tasks/examples.rake +0 -7
- data/vendor/plugins/rspec/rake_tasks/examples_with_rcov.rake +0 -9
- data/vendor/plugins/rspec/rake_tasks/failing_examples_with_html.rake +0 -9
- data/vendor/plugins/rspec/rake_tasks/verify_rcov.rake +0 -7
- data/vendor/plugins/rspec/spec/README.jruby +0 -15
- data/vendor/plugins/rspec/spec/autotest/discover_spec.rb +0 -19
- data/vendor/plugins/rspec/spec/autotest/rspec_spec.rb +0 -197
- data/vendor/plugins/rspec/spec/autotest_helper.rb +0 -6
- data/vendor/plugins/rspec/spec/rspec_suite.rb +0 -7
- data/vendor/plugins/rspec/spec/ruby_forker.rb +0 -13
- data/vendor/plugins/rspec/spec/spec.opts +0 -6
- data/vendor/plugins/rspec/spec/spec/example/configuration_spec.rb +0 -282
- data/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb +0 -48
- data/vendor/plugins/rspec/spec/spec/example/example_group_factory_spec.rb +0 -135
- data/vendor/plugins/rspec/spec/spec/example/example_group_methods_spec.rb +0 -523
- data/vendor/plugins/rspec/spec/spec/example/example_group_spec.rb +0 -711
- data/vendor/plugins/rspec/spec/spec/example/example_matcher_spec.rb +0 -96
- data/vendor/plugins/rspec/spec/spec/example/example_methods_spec.rb +0 -115
- data/vendor/plugins/rspec/spec/spec/example/example_runner_spec.rb +0 -194
- data/vendor/plugins/rspec/spec/spec/example/example_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb +0 -71
- data/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +0 -21
- data/vendor/plugins/rspec/spec/spec/example/shared_example_group_spec.rb +0 -265
- data/vendor/plugins/rspec/spec/spec/example/subclassing_example_group_spec.rb +0 -25
- data/vendor/plugins/rspec/spec/spec/expectations/differs/default_spec.rb +0 -127
- data/vendor/plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +0 -107
- data/vendor/plugins/rspec/spec/spec/expectations/fail_with_spec.rb +0 -71
- data/vendor/plugins/rspec/spec/spec/extensions/main_spec.rb +0 -76
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_fails.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_passes.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_with_errors.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +0 -38
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +0 -9
- data/vendor/plugins/rspec/spec/spec/matchers/be_close_spec.rb +0 -39
- data/vendor/plugins/rspec/spec/spec/matchers/be_spec.rb +0 -248
- data/vendor/plugins/rspec/spec/spec/matchers/change_spec.rb +0 -319
- data/vendor/plugins/rspec/spec/spec/matchers/description_generation_spec.rb +0 -153
- data/vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb +0 -28
- data/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb +0 -28
- data/vendor/plugins/rspec/spec/spec/matchers/exist_spec.rb +0 -57
- data/vendor/plugins/rspec/spec/spec/matchers/handler_spec.rb +0 -129
- data/vendor/plugins/rspec/spec/spec/matchers/has_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/matchers/have_spec.rb +0 -291
- data/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/matchers/match_spec.rb +0 -37
- data/vendor/plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +0 -78
- data/vendor/plugins/rspec/spec/spec/matchers/mock_constraint_matchers_spec.rb +0 -24
- data/vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +0 -158
- data/vendor/plugins/rspec/spec/spec/matchers/raise_error_spec.rb +0 -315
- data/vendor/plugins/rspec/spec/spec/matchers/respond_to_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb +0 -36
- data/vendor/plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +0 -29
- data/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb +0 -23
- data/vendor/plugins/rspec/spec/spec/mocks/at_least_spec.rb +0 -97
- data/vendor/plugins/rspec/spec/spec/mocks/at_most_spec.rb +0 -93
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10260_spec.rb +0 -8
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb +0 -24
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +0 -33
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +0 -30
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +0 -19
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb +0 -22
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8165_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +0 -26
- data/vendor/plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +0 -123
- data/vendor/plugins/rspec/spec/spec/mocks/hash_including_matcher_spec.rb +0 -32
- data/vendor/plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +0 -84
- data/vendor/plugins/rspec/spec/spec/mocks/mock_space_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/mocks/mock_spec.rb +0 -481
- data/vendor/plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +0 -113
- data/vendor/plugins/rspec/spec/spec/mocks/null_object_mock_spec.rb +0 -40
- data/vendor/plugins/rspec/spec/spec/mocks/once_counts_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/mocks/options_hash_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +0 -106
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +0 -66
- data/vendor/plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +0 -160
- data/vendor/plugins/rspec/spec/spec/mocks/precise_counts_spec.rb +0 -52
- data/vendor/plugins/rspec/spec/spec/mocks/record_messages_spec.rb +0 -26
- data/vendor/plugins/rspec/spec/spec/mocks/stub_spec.rb +0 -181
- data/vendor/plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +0 -67
- data/vendor/plugins/rspec/spec/spec/package/bin_spec_spec.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +0 -23
- data/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb +0 -147
- data/vendor/plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +0 -92
- data/vendor/plugins/rspec/spec/spec/runner/examples.txt +0 -2
- data/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb +0 -37
- data/vendor/plugins/rspec/spec/spec/runner/failed.txt +0 -3
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +0 -33
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +0 -365
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +0 -387
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +0 -381
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +0 -66
- data/vendor/plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +0 -65
- data/vendor/plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +0 -137
- data/vendor/plugins/rspec/spec/spec/runner/formatter/snippet_extractor_spec.rb +0 -18
- data/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +0 -103
- data/vendor/plugins/rspec/spec/spec/runner/formatter/specdoc_formatter_spec.rb +0 -129
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +0 -61
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +0 -335
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +0 -365
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +0 -78
- data/vendor/plugins/rspec/spec/spec/runner/heckler_spec.rb +0 -13
- data/vendor/plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/runner/option_parser_spec.rb +0 -384
- data/vendor/plugins/rspec/spec/spec/runner/options_spec.rb +0 -386
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture.rb +0 -7
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture_runner.rb +0 -8
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_spec.rb +0 -16
- data/vendor/plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +0 -56
- data/vendor/plugins/rspec/spec/spec/runner/reporter_spec.rb +0 -192
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_bar.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_foo.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_spec.rb +0 -1
- data/vendor/plugins/rspec/spec/spec/runner/spec.opts +0 -2
- data/vendor/plugins/rspec/spec/spec/runner/spec_drb.opts +0 -1
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser/spec_parser_fixture.rb +0 -70
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser_spec.rb +0 -79
- data/vendor/plugins/rspec/spec/spec/runner/spec_spaced.opts +0 -2
- data/vendor/plugins/rspec/spec/spec/runner_spec.rb +0 -11
- data/vendor/plugins/rspec/spec/spec/spec_classes.rb +0 -133
- data/vendor/plugins/rspec/spec/spec/story/builders.rb +0 -46
- data/vendor/plugins/rspec/spec/spec/story/extensions/main_spec.rb +0 -161
- data/vendor/plugins/rspec/spec/spec/story/extensions_spec.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/story/given_scenario_spec.rb +0 -27
- data/vendor/plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +0 -92
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +0 -27
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +0 -191
- data/vendor/plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +0 -133
- data/vendor/plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +0 -384
- data/vendor/plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +0 -294
- data/vendor/plugins/rspec/spec/spec/story/runner_spec.rb +0 -106
- data/vendor/plugins/rspec/spec/spec/story/scenario_spec.rb +0 -20
- data/vendor/plugins/rspec/spec/spec/story/step_group_spec.rb +0 -157
- data/vendor/plugins/rspec/spec/spec/story/step_mother_spec.rb +0 -72
- data/vendor/plugins/rspec/spec/spec/story/step_spec.rb +0 -200
- data/vendor/plugins/rspec/spec/spec/story/story_helper.rb +0 -2
- data/vendor/plugins/rspec/spec/spec/story/story_spec.rb +0 -86
- data/vendor/plugins/rspec/spec/spec/story/world_spec.rb +0 -423
- data/vendor/plugins/rspec/spec/spec/translator_spec.rb +0 -265
- data/vendor/plugins/rspec/spec/spec_helper.rb +0 -103
- data/vendor/plugins/rspec/stories/all.rb +0 -5
- data/vendor/plugins/rspec/stories/example_groups/autogenerated_docstrings +0 -45
- data/vendor/plugins/rspec/stories/example_groups/example_group_with_should_methods +0 -17
- data/vendor/plugins/rspec/stories/example_groups/nested_groups +0 -17
- data/vendor/plugins/rspec/stories/example_groups/output +0 -25
- data/vendor/plugins/rspec/stories/example_groups/stories.rb +0 -7
- data/vendor/plugins/rspec/stories/helper.rb +0 -6
- data/vendor/plugins/rspec/stories/interop/examples_and_tests_together +0 -30
- data/vendor/plugins/rspec/stories/interop/stories.rb +0 -7
- data/vendor/plugins/rspec/stories/interop/test_case_with_should_methods +0 -17
- data/vendor/plugins/rspec/stories/pending_stories/README +0 -3
- data/vendor/plugins/rspec/stories/resources/helpers/cmdline.rb +0 -9
- data/vendor/plugins/rspec/stories/resources/helpers/story_helper.rb +0 -16
- data/vendor/plugins/rspec/stories/resources/matchers/smart_match.rb +0 -37
- data/vendor/plugins/rspec/stories/resources/spec/example_group_with_should_methods.rb +0 -12
- data/vendor/plugins/rspec/stories/resources/spec/simple_spec.rb +0 -8
- data/vendor/plugins/rspec/stories/resources/steps/running_rspec.rb +0 -50
- data/vendor/plugins/rspec/stories/resources/stories/failing_story.rb +0 -15
- data/vendor/plugins/rspec/stories/resources/test/spec_and_test_together.rb +0 -57
- data/vendor/plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +0 -30
- data/vendor/plugins/rspec/story_server/prototype/javascripts/builder.js +0 -136
- data/vendor/plugins/rspec/story_server/prototype/javascripts/controls.js +0 -972
- data/vendor/plugins/rspec/story_server/prototype/javascripts/dragdrop.js +0 -976
- data/vendor/plugins/rspec/story_server/prototype/javascripts/effects.js +0 -1117
- data/vendor/plugins/rspec/story_server/prototype/javascripts/prototype.js +0 -4140
- data/vendor/plugins/rspec/story_server/prototype/javascripts/rspec.js +0 -149
- data/vendor/plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +0 -58
- data/vendor/plugins/rspec/story_server/prototype/javascripts/slider.js +0 -276
- data/vendor/plugins/rspec/story_server/prototype/javascripts/sound.js +0 -55
- data/vendor/plugins/rspec/story_server/prototype/javascripts/unittest.js +0 -568
- data/vendor/plugins/rspec/story_server/prototype/lib/server.rb +0 -24
- data/vendor/plugins/rspec/story_server/prototype/stories.html +0 -176
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/rspec.css +0 -136
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/test.css +0 -90
- data/vendor/plugins/rspec_on_rails/MIT-LICENSE +0 -31
- data/vendor/plugins/rspec_on_rails/README +0 -3
- data/vendor/plugins/rspec_on_rails/Rakefile +0 -9
- data/vendor/plugins/rspec_on_rails/generators/rspec/CHANGES +0 -1
- data/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb +0 -35
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/all_stories.rb +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/previous_failures.txt +0 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +0 -2
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +0 -102
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec.opts +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec_helper.rb +0 -39
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/stories_helper.rb +0 -3
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/USAGE +0 -33
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/rspec_controller_generator.rb +0 -49
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/controller_spec.rb +0 -25
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +0 -12
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/USAGE +0 -18
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/rspec_model_generator.rb +0 -30
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/templates/model_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +0 -167
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +0 -313
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +0 -25
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +0 -22
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +0 -26
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +0 -61
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +0 -22
- data/vendor/plugins/rspec_on_rails/init.rb +0 -9
- data/vendor/plugins/rspec_on_rails/lib/autotest/discover.rb +0 -1
- data/vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +0 -81
- data/vendor/plugins/rspec_on_rails/lib/spec/rails.rb +0 -51
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example.rb +0 -46
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb +0 -43
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +0 -269
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/functional_example_group.rb +0 -59
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb +0 -130
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/model_example_group.rb +0 -14
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +0 -98
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +0 -90
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +0 -178
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb +0 -12
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +0 -14
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/rescue.rb +0 -21
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/test_response.rb +0 -11
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb +0 -27
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb +0 -30
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/object.rb +0 -5
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb +0 -66
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +0 -21
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers.rb +0 -29
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +0 -130
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +0 -55
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb +0 -113
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +0 -70
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +0 -71
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb +0 -23
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +0 -36
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/rails_rspec_spec.rb +0 -8
- data/vendor/plugins/rspec_on_rails/spec/rails/example/assigns_hash_proxy_spec.rb +0 -60
- data/vendor/plugins/rspec_on_rails/spec/rails/example/configuration_spec.rb +0 -83
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +0 -43
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +0 -195
- data/vendor/plugins/rspec_on_rails/spec/rails/example/example_group_factory_spec.rb +0 -112
- data/vendor/plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +0 -133
- data/vendor/plugins/rspec_on_rails/spec/rails/example/model_spec_spec.rb +0 -18
- data/vendor/plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +0 -16
- data/vendor/plugins/rspec_on_rails/spec/rails/example/test_unit_assertion_accessibility_spec.rb +0 -33
- data/vendor/plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +0 -264
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_controller_rescue_action_spec.rb +0 -54
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +0 -48
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +0 -14
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +0 -783
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +0 -37
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/errors_on_spec.rb +0 -13
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +0 -62
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +0 -209
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +0 -169
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/ar_classes.rb +0 -10
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +0 -55
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/stub_model_spec.rb +0 -54
- data/vendor/plugins/rspec_on_rails/spec/rails/sample_spec.rb +0 -7
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_server_spec.rb +0 -89
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/spec/rails_suite.rb +0 -7
- data/vendor/plugins/rspec_on_rails/spec/spec_helper.rb +0 -46
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/action_view_base_spec_controller.rb +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +0 -68
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +0 -59
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +0 -26
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +0 -58
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +0 -10
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/more_explicit_helper.rb +0 -5
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/plugin_application_helper.rb +0 -6
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/view_spec_helper.rb +0 -13
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/_partial.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_errors_in_template.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_template.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/_a_partial.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.js.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/_replacement_partial.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_div.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_page_element.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/insert_html.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html_with_partial.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_effect.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_toggle_effect.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/no_tags.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_used_twice.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_local_variable.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_spacer.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/accessor.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/entry_form.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/explicit_helper.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/foo/show.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/implicit_helper.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/multiple_helpers.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial.rhtml +0 -5
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_with_array.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/stories/all.rb +0 -10
- data/vendor/plugins/rspec_on_rails/stories/helper.rb +0 -5
- data/vendor/plugins/rspec_on_rails/stories/steps/people.rb +0 -8
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback +0 -15
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback.rb +0 -25
- data/vendor/plugins/rspec_on_rails/tasks/rspec.rake +0 -137
- data/vendor/plugins/scenarios/README +0 -262
- data/vendor/plugins/scenarios/Rakefile +0 -66
- data/vendor/plugins/scenarios/TODO +0 -1
- data/vendor/plugins/scenarios/lib/scenarios.rb +0 -34
- data/vendor/plugins/scenarios/lib/scenarios/base.rb +0 -73
- data/vendor/plugins/scenarios/lib/scenarios/builtin/blank_scenario.rb +0 -18
- data/vendor/plugins/scenarios/lib/scenarios/configuration.rb +0 -55
- data/vendor/plugins/scenarios/lib/scenarios/extensions.rb +0 -5
- data/vendor/plugins/scenarios/lib/scenarios/extensions/active_record.rb +0 -14
- data/vendor/plugins/scenarios/lib/scenarios/extensions/delegating_attributes.rb +0 -40
- data/vendor/plugins/scenarios/lib/scenarios/extensions/object.rb +0 -5
- data/vendor/plugins/scenarios/lib/scenarios/extensions/string.rb +0 -22
- data/vendor/plugins/scenarios/lib/scenarios/extensions/symbol.rb +0 -14
- data/vendor/plugins/scenarios/lib/scenarios/extensions/test_case.rb +0 -76
- data/vendor/plugins/scenarios/lib/scenarios/loading.rb +0 -51
- data/vendor/plugins/scenarios/lib/scenarios/table_blasting.rb +0 -20
- data/vendor/plugins/scenarios/lib/scenarios/table_methods.rb +0 -205
- data/vendor/plugins/scenarios/spec/scenarios/complex_composite_scenario.rb +0 -9
- data/vendor/plugins/scenarios/spec/scenarios/composite_scenario.rb +0 -9
- data/vendor/plugins/scenarios/spec/scenarios/empty_scenario.rb +0 -4
- data/vendor/plugins/scenarios/spec/scenarios/people_scenario.rb +0 -26
- data/vendor/plugins/scenarios/spec/scenarios/places_scenario.rb +0 -22
- data/vendor/plugins/scenarios/spec/scenarios/things_scenario.rb +0 -22
- data/vendor/plugins/scenarios/spec/scenarios_spec.rb +0 -189
- data/vendor/plugins/scenarios/spec/spec_helper.rb +0 -6
- data/vendor/plugins/scenarios/tasks/scenario.rake +0 -21
- data/vendor/plugins/scenarios/test/scenarios_test.rb +0 -39
- data/vendor/plugins/scenarios/test/test_helper.rb +0 -5
- data/vendor/plugins/scenarios/testing/application.rb +0 -2
- data/vendor/plugins/scenarios/testing/database.yml +0 -9
- data/vendor/plugins/scenarios/testing/environment.rb +0 -68
- data/vendor/plugins/scenarios/testing/library.rb +0 -128
- data/vendor/plugins/scenarios/testing/models.rb +0 -14
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3014.patch +0 -52
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3119.patch +0 -53
- data/vendor/plugins/scenarios/testing/schema.rb +0 -31
- data/vendor/rails/Rakefile +0 -21
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb +0 -4
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile +0 -19
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb +0 -245
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb +0 -47
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb +0 -52
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb +0 -39
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb +0 -71
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb +0 -67
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb +0 -481
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/facade.rb +0 -552
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb +0 -931
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/info.rb +0 -35
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb +0 -540
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/loader.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb +0 -462
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb +0 -435
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mbox.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb +0 -282
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb +0 -137
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb +0 -1475
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y +0 -381
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb +0 -142
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb +0 -43
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb +0 -263
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb +0 -279
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/tmail.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb +0 -281
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb +0 -38
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string +0 -1
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/routing_optimisation.rb +0 -119
- data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +0 -69
- data/vendor/rails/actionpack/test/action_view_test.rb +0 -44
- data/vendor/rails/actionpack/test/controller/fragment_store_setting_test.rb +0 -47
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +0 -193
- data/vendor/rails/activemodel/CHANGES +0 -12
- data/vendor/rails/activemodel/README +0 -21
- data/vendor/rails/activemodel/Rakefile +0 -4
- data/vendor/rails/activemodel/lib/active_model.rb +0 -17
- data/vendor/rails/activemodel/lib/active_model/base.rb +0 -4
- data/vendor/rails/activemodel/lib/active_model/callbacks.rb +0 -5
- data/vendor/rails/activemodel/lib/active_model/observing.rb +0 -100
- data/vendor/rails/activemodel/lib/active_model/validations.rb +0 -4
- data/vendor/rails/activemodel/spec/observing_spec.rb +0 -120
- data/vendor/rails/activemodel/spec/spec_helper.rb +0 -17
- data/vendor/rails/activerecord/MIT-LICENSE +0 -20
- data/vendor/rails/activerecord/lib/active_record/vendor/db2.rb +0 -362
- data/vendor/rails/activerecord/test/aaa_create_tables_test.rb +0 -72
- data/vendor/rails/activerecord/test/abstract_unit.rb +0 -84
- data/vendor/rails/activerecord/test/active_schema_test_mysql.rb +0 -43
- data/vendor/rails/activerecord/test/adapter_test.rb +0 -105
- data/vendor/rails/activerecord/test/adapter_test_sqlserver.rb +0 -95
- data/vendor/rails/activerecord/test/aggregations_test.rb +0 -128
- data/vendor/rails/activerecord/test/all.sh +0 -8
- data/vendor/rails/activerecord/test/ar_schema_test.rb +0 -33
- data/vendor/rails/activerecord/test/association_inheritance_reload.rb +0 -14
- data/vendor/rails/activerecord/test/associations/callbacks_test.rb +0 -147
- data/vendor/rails/activerecord/test/associations/cascaded_eager_loading_test.rb +0 -110
- data/vendor/rails/activerecord/test/associations/eager_singularization_test.rb +0 -145
- data/vendor/rails/activerecord/test/associations/eager_test.rb +0 -442
- data/vendor/rails/activerecord/test/associations/extension_test.rb +0 -47
- data/vendor/rails/activerecord/test/associations/inner_join_association_test.rb +0 -88
- data/vendor/rails/activerecord/test/associations/join_model_test.rb +0 -559
- data/vendor/rails/activerecord/test/associations_test.rb +0 -2147
- data/vendor/rails/activerecord/test/attribute_methods_test.rb +0 -146
- data/vendor/rails/activerecord/test/base_test.rb +0 -1745
- data/vendor/rails/activerecord/test/binary_test.rb +0 -32
- data/vendor/rails/activerecord/test/calculations_test.rb +0 -251
- data/vendor/rails/activerecord/test/callbacks_test.rb +0 -400
- data/vendor/rails/activerecord/test/class_inheritable_attributes_test.rb +0 -32
- data/vendor/rails/activerecord/test/column_alias_test.rb +0 -17
- data/vendor/rails/activerecord/test/connection_test_firebird.rb +0 -8
- data/vendor/rails/activerecord/test/connection_test_mysql.rb +0 -30
- data/vendor/rails/activerecord/test/copy_table_test_sqlite.rb +0 -69
- data/vendor/rails/activerecord/test/datatype_test_postgresql.rb +0 -203
- data/vendor/rails/activerecord/test/date_time_test.rb +0 -37
- data/vendor/rails/activerecord/test/default_test_firebird.rb +0 -16
- data/vendor/rails/activerecord/test/defaults_test.rb +0 -67
- data/vendor/rails/activerecord/test/deprecated_finder_test.rb +0 -30
- data/vendor/rails/activerecord/test/finder_test.rb +0 -650
- data/vendor/rails/activerecord/test/fixtures/author.rb +0 -109
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_numeric_first_char +0 -1
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_spaces +0 -1
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/blank_line +0 -3
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/duplicate_attributes +0 -3
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/missing_value +0 -1
- data/vendor/rails/activerecord/test/fixtures/category.rb +0 -26
- data/vendor/rails/activerecord/test/fixtures/comment.rb +0 -23
- data/vendor/rails/activerecord/test/fixtures/company.rb +0 -114
- data/vendor/rails/activerecord/test/fixtures/company_in_module.rb +0 -59
- data/vendor/rails/activerecord/test/fixtures/computer.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/contact.rb +0 -16
- data/vendor/rails/activerecord/test/fixtures/customer.rb +0 -55
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.sql +0 -235
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.drop.sql +0 -65
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.sql +0 -310
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.sql +0 -6
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.sql +0 -273
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.drop.sql +0 -1
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.sql +0 -318
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.sql +0 -7
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.drop.sql +0 -67
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.sql +0 -330
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.sql +0 -6
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.drop.sql +0 -44
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.sql +0 -292
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +0 -354
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema2.rb +0 -11
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.sql +0 -219
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.drop.sql +0 -35
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.sql +0 -222
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.drop.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/developer.rb +0 -72
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_action_controller +0 -3
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_active_record +0 -3
- data/vendor/rails/activerecord/test/fixtures/developers_projects/jamis_active_record +0 -2
- data/vendor/rails/activerecord/test/fixtures/migrations/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations/2_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/2_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1000_people_have_middle_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/3_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/order.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/person.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/pirate.rb +0 -5
- data/vendor/rails/activerecord/test/fixtures/post.rb +0 -59
- data/vendor/rails/activerecord/test/fixtures/project.rb +0 -28
- data/vendor/rails/activerecord/test/fixtures/reply.rb +0 -37
- data/vendor/rails/activerecord/test/fixtures/subscriber.rb +0 -6
- data/vendor/rails/activerecord/test/fixtures/subscribers/first +0 -2
- data/vendor/rails/activerecord/test/fixtures/subscribers/second +0 -2
- data/vendor/rails/activerecord/test/fixtures/topic.rb +0 -37
- data/vendor/rails/activerecord/test/fixtures/treasure.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures_test.rb +0 -602
- data/vendor/rails/activerecord/test/inheritance_test.rb +0 -211
- data/vendor/rails/activerecord/test/json_serialization_test.rb +0 -180
- data/vendor/rails/activerecord/test/lifecycle_test.rb +0 -137
- data/vendor/rails/activerecord/test/locking_test.rb +0 -282
- data/vendor/rails/activerecord/test/method_scoping_test.rb +0 -416
- data/vendor/rails/activerecord/test/migration_test.rb +0 -933
- data/vendor/rails/activerecord/test/migration_test_firebird.rb +0 -124
- data/vendor/rails/activerecord/test/mixin_test.rb +0 -95
- data/vendor/rails/activerecord/test/modules_test.rb +0 -34
- data/vendor/rails/activerecord/test/multiple_db_test.rb +0 -60
- data/vendor/rails/activerecord/test/pk_test.rb +0 -101
- data/vendor/rails/activerecord/test/query_cache_test.rb +0 -104
- data/vendor/rails/activerecord/test/readonly_test.rb +0 -107
- data/vendor/rails/activerecord/test/reflection_test.rb +0 -175
- data/vendor/rails/activerecord/test/reserved_word_test_mysql.rb +0 -177
- data/vendor/rails/activerecord/test/schema_authorization_test_postgresql.rb +0 -75
- data/vendor/rails/activerecord/test/schema_dumper_test.rb +0 -131
- data/vendor/rails/activerecord/test/schema_test_postgresql.rb +0 -64
- data/vendor/rails/activerecord/test/serialization_test.rb +0 -47
- data/vendor/rails/activerecord/test/synonym_test_oracle.rb +0 -17
- data/vendor/rails/activerecord/test/table_name_test_sqlserver.rb +0 -23
- data/vendor/rails/activerecord/test/threaded_connections_test.rb +0 -48
- data/vendor/rails/activerecord/test/transactions_test.rb +0 -281
- data/vendor/rails/activerecord/test/unconnected_test.rb +0 -32
- data/vendor/rails/activerecord/test/validations_test.rb +0 -1395
- data/vendor/rails/activerecord/test/xml_serialization_test.rb +0 -202
- data/vendor/rails/activeresource/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/Rakefile +0 -83
- data/vendor/rails/activesupport/install.rb +0 -30
- data/vendor/rails/activesupport/lib/active_support/testing.rb +0 -1
- data/vendor/rails/activesupport/test/abstract_unit.rb +0 -20
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +0 -7
- data/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +0 -5
- data/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +0 -4
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +0 -3
- data/vendor/rails/activesupport/test/buffered_logger_test.rb +0 -107
- data/vendor/rails/activesupport/test/clean_logger_test.rb +0 -57
- data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +0 -250
- data/vendor/rails/activesupport/test/core_ext/blank_test.rb +0 -19
- data/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +0 -14
- data/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +0 -31
- data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +0 -224
- data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +0 -105
- data/vendor/rails/activesupport/test/core_ext/class_test.rb +0 -46
- data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +0 -196
- data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +0 -230
- data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +0 -22
- data/vendor/rails/activesupport/test/core_ext/duration_test.rb +0 -21
- data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +0 -61
- data/vendor/rails/activesupport/test/core_ext/exception_test.rb +0 -64
- data/vendor/rails/activesupport/test/core_ext/file_test.rb +0 -29
- data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +0 -25
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +0 -743
- data/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +0 -37
- data/vendor/rails/activesupport/test/core_ext/kernel_test.rb +0 -43
- data/vendor/rails/activesupport/test/core_ext/load_error_tests.rb +0 -16
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +0 -30
- data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +0 -52
- data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +0 -33
- data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +0 -58
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +0 -293
- data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +0 -24
- data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +0 -147
- data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +0 -242
- data/vendor/rails/activesupport/test/core_ext/pathname_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/proc_test.rb +0 -11
- data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +0 -63
- data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +0 -180
- data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +0 -420
- data/vendor/rails/activesupport/test/dependencies/check_warnings.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/mutual_one.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/mutual_two.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/raises_exception.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/service_one.rb +0 -5
- data/vendor/rails/activesupport/test/dependencies/service_two.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies_test.rb +0 -751
- data/vendor/rails/activesupport/test/deprecation_test.rb +0 -151
- data/vendor/rails/activesupport/test/inflector_test.rb +0 -248
- data/vendor/rails/activesupport/test/inflector_test_cases.rb +0 -208
- data/vendor/rails/activesupport/test/json/decoding_test.rb +0 -41
- data/vendor/rails/activesupport/test/json/encoding_test.rb +0 -111
- data/vendor/rails/activesupport/test/multibyte_chars_test.rb +0 -173
- data/vendor/rails/activesupport/test/multibyte_conformance.rb +0 -141
- data/vendor/rails/activesupport/test/multibyte_handler_test.rb +0 -367
- data/vendor/rails/activesupport/test/option_merger_test.rb +0 -50
- data/vendor/rails/activesupport/test/ordered_options_test.rb +0 -84
- data/vendor/rails/activesupport/test/test_test.rb +0 -73
- data/vendor/rails/activesupport/test/time_zone_test.rb +0 -98
- data/vendor/rails/activesupport/test/whiny_nil_test.rb +0 -38
- data/vendor/rails/cleanlogs.sh +0 -1
- data/vendor/rails/pushgems.rb +0 -15
- data/vendor/rails/railties/lib/tasks/tmp.rake +0 -37
- data/vendor/rails/railties/test/abstract_unit.rb +0 -24
- data/vendor/rails/railties/test/boot_test.rb +0 -179
- data/vendor/rails/railties/test/console_app_test.rb +0 -29
- data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +0 -265
- data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +0 -1
- data/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
- data/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +0 -7
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +0 -2
- data/vendor/rails/railties/test/generators/generator_test_helper.rb +0 -195
- data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +0 -109
- data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +0 -106
- data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +0 -185
- data/vendor/rails/railties/test/initializer_test.rb +0 -218
- data/vendor/rails/railties/test/mocks/routes.rb +0 -6
- data/vendor/rails/railties/test/plugin_loader_test.rb +0 -140
- data/vendor/rails/railties/test/plugin_locator_test.rb +0 -69
- data/vendor/rails/railties/test/plugin_test.rb +0 -141
- data/vendor/rails/railties/test/plugin_test_helper.rb +0 -29
- data/vendor/rails/railties/test/rails_generator_test.rb +0 -137
- data/vendor/rails/railties/test/rails_info_controller_test.rb +0 -48
- data/vendor/rails/railties/test/rails_info_test.rb +0 -105
- data/vendor/rails/railties/test/secret_key_generation_test.rb +0 -35
- data/vendor/rails/release.rb +0 -25
@@ -1,4140 +0,0 @@
|
|
1
|
-
/* Prototype JavaScript framework, version 1.6.0_rc0
|
2
|
-
* (c) 2005-2007 Sam Stephenson
|
3
|
-
*
|
4
|
-
* Prototype is freely distributable under the terms of an MIT-style license.
|
5
|
-
* For details, see the Prototype web site: http://www.prototypejs.org/
|
6
|
-
*
|
7
|
-
*--------------------------------------------------------------------------*/
|
8
|
-
|
9
|
-
var Prototype = {
|
10
|
-
Version: '1.6.0_rc0',
|
11
|
-
|
12
|
-
Browser: {
|
13
|
-
IE: !!(window.attachEvent && !window.opera),
|
14
|
-
Opera: !!window.opera,
|
15
|
-
WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
|
16
|
-
Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
|
17
|
-
MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
|
18
|
-
},
|
19
|
-
|
20
|
-
BrowserFeatures: {
|
21
|
-
XPath: !!document.evaluate,
|
22
|
-
ElementExtensions: !!window.HTMLElement,
|
23
|
-
SpecificElementExtensions:
|
24
|
-
document.createElement('div').__proto__ !==
|
25
|
-
document.createElement('form').__proto__
|
26
|
-
},
|
27
|
-
|
28
|
-
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
|
29
|
-
JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
|
30
|
-
|
31
|
-
emptyFunction: function() { },
|
32
|
-
K: function(x) { return x }
|
33
|
-
};
|
34
|
-
|
35
|
-
if (Prototype.Browser.MobileSafari)
|
36
|
-
Prototype.BrowserFeatures.SpecificElementExtensions = false;
|
37
|
-
|
38
|
-
/* Based on Alex Arnell's inheritance implementation. */
|
39
|
-
var Class = {
|
40
|
-
create: function() {
|
41
|
-
var parent = null, properties = $A(arguments);
|
42
|
-
if (Object.isFunction(properties[0]))
|
43
|
-
parent = properties.shift();
|
44
|
-
|
45
|
-
function klass() {
|
46
|
-
this.initialize.apply(this, arguments);
|
47
|
-
}
|
48
|
-
|
49
|
-
Object.extend(klass, Class.Methods);
|
50
|
-
klass.superclass = parent;
|
51
|
-
klass.subclasses = [];
|
52
|
-
|
53
|
-
if (parent) {
|
54
|
-
var subclass = function() { };
|
55
|
-
subclass.prototype = parent.prototype;
|
56
|
-
klass.prototype = new subclass;
|
57
|
-
parent.subclasses.push(klass);
|
58
|
-
}
|
59
|
-
|
60
|
-
for (var i = 0; i < properties.length; i++)
|
61
|
-
klass.addMethods(properties[i]);
|
62
|
-
|
63
|
-
if (!klass.prototype.initialize)
|
64
|
-
klass.prototype.initialize = Prototype.emptyFunction;
|
65
|
-
|
66
|
-
klass.prototype.constructor = klass;
|
67
|
-
|
68
|
-
return klass;
|
69
|
-
}
|
70
|
-
};
|
71
|
-
|
72
|
-
Class.Methods = {
|
73
|
-
addMethods: function(source) {
|
74
|
-
var ancestor = this.superclass && this.superclass.prototype;
|
75
|
-
|
76
|
-
for (var property in source) {
|
77
|
-
var value = source[property];
|
78
|
-
if (ancestor && Object.isFunction(value) &&
|
79
|
-
value.argumentNames().first() == "$super") {
|
80
|
-
var method = value, value = Object.extend((function(m) {
|
81
|
-
return function() { return ancestor[m].apply(this, arguments) };
|
82
|
-
})(property).wrap(method), {
|
83
|
-
valueOf: function() { return method },
|
84
|
-
toString: function() { return method.toString() }
|
85
|
-
});
|
86
|
-
}
|
87
|
-
this.prototype[property] = value;
|
88
|
-
}
|
89
|
-
|
90
|
-
return this;
|
91
|
-
}
|
92
|
-
};
|
93
|
-
|
94
|
-
var Abstract = { };
|
95
|
-
|
96
|
-
Object.extend = function(destination, source) {
|
97
|
-
for (var property in source)
|
98
|
-
destination[property] = source[property];
|
99
|
-
return destination;
|
100
|
-
};
|
101
|
-
|
102
|
-
Object.extend(Object, {
|
103
|
-
inspect: function(object) {
|
104
|
-
try {
|
105
|
-
if (object === undefined) return 'undefined';
|
106
|
-
if (object === null) return 'null';
|
107
|
-
return object.inspect ? object.inspect() : object.toString();
|
108
|
-
} catch (e) {
|
109
|
-
if (e instanceof RangeError) return '...';
|
110
|
-
throw e;
|
111
|
-
}
|
112
|
-
},
|
113
|
-
|
114
|
-
toJSON: function(object) {
|
115
|
-
var type = typeof object;
|
116
|
-
switch (type) {
|
117
|
-
case 'undefined':
|
118
|
-
case 'function':
|
119
|
-
case 'unknown': return;
|
120
|
-
case 'boolean': return object.toString();
|
121
|
-
}
|
122
|
-
|
123
|
-
if (object === null) return 'null';
|
124
|
-
if (object.toJSON) return object.toJSON();
|
125
|
-
if (Object.isElement(object)) return;
|
126
|
-
|
127
|
-
var results = [];
|
128
|
-
for (var property in object) {
|
129
|
-
var value = Object.toJSON(object[property]);
|
130
|
-
if (value !== undefined)
|
131
|
-
results.push(property.toJSON() + ': ' + value);
|
132
|
-
}
|
133
|
-
|
134
|
-
return '{' + results.join(', ') + '}';
|
135
|
-
},
|
136
|
-
|
137
|
-
toHTML: function(object) {
|
138
|
-
return object && object.toHTML ? object.toHTML() : String.interpret(object);
|
139
|
-
},
|
140
|
-
|
141
|
-
keys: function(object) {
|
142
|
-
var keys = [];
|
143
|
-
for (var property in object)
|
144
|
-
keys.push(property);
|
145
|
-
return keys;
|
146
|
-
},
|
147
|
-
|
148
|
-
values: function(object) {
|
149
|
-
var values = [];
|
150
|
-
for (var property in object)
|
151
|
-
values.push(object[property]);
|
152
|
-
return values;
|
153
|
-
},
|
154
|
-
|
155
|
-
clone: function(object) {
|
156
|
-
return Object.extend({ }, object);
|
157
|
-
},
|
158
|
-
|
159
|
-
isElement: function(object) {
|
160
|
-
return object && object.nodeType == 1;
|
161
|
-
},
|
162
|
-
|
163
|
-
isArray: function(object) {
|
164
|
-
return object && object.constructor === Array;
|
165
|
-
},
|
166
|
-
|
167
|
-
isFunction: function(object) {
|
168
|
-
return typeof object == "function";
|
169
|
-
},
|
170
|
-
|
171
|
-
isString: function(object) {
|
172
|
-
return typeof object == "string";
|
173
|
-
},
|
174
|
-
|
175
|
-
isNumber: function(object) {
|
176
|
-
return typeof object == "number";
|
177
|
-
},
|
178
|
-
|
179
|
-
isUndefined: function(object) {
|
180
|
-
return typeof object == "undefined";
|
181
|
-
}
|
182
|
-
});
|
183
|
-
|
184
|
-
Object.extend(Function.prototype, {
|
185
|
-
argumentNames: function() {
|
186
|
-
var names = this.toString().match(/^[\s\(]*function\s*\((.*?)\)/)[1].split(",").invoke("strip");
|
187
|
-
return names.length == 1 && !names[0] ? [] : names;
|
188
|
-
},
|
189
|
-
|
190
|
-
bind: function() {
|
191
|
-
if (arguments.length < 2 && arguments[0] === undefined) return this;
|
192
|
-
var __method = this, args = $A(arguments), object = args.shift();
|
193
|
-
return function() {
|
194
|
-
return __method.apply(object, args.concat($A(arguments)));
|
195
|
-
}
|
196
|
-
},
|
197
|
-
|
198
|
-
bindAsEventListener: function() {
|
199
|
-
var __method = this, args = $A(arguments), object = args.shift();
|
200
|
-
return function(event) {
|
201
|
-
return __method.apply(object, [event || window.event].concat(args));
|
202
|
-
}
|
203
|
-
},
|
204
|
-
|
205
|
-
curry: function() {
|
206
|
-
if (!arguments.length) return this;
|
207
|
-
var __method = this, args = $A(arguments);
|
208
|
-
return function() {
|
209
|
-
return __method.apply(this, args.concat($A(arguments)));
|
210
|
-
}
|
211
|
-
},
|
212
|
-
|
213
|
-
delay: function() {
|
214
|
-
var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
|
215
|
-
return window.setTimeout(function() {
|
216
|
-
return __method.apply(__method, args);
|
217
|
-
}, timeout);
|
218
|
-
},
|
219
|
-
|
220
|
-
wrap: function(wrapper) {
|
221
|
-
var __method = this;
|
222
|
-
return function() {
|
223
|
-
return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
|
224
|
-
}
|
225
|
-
},
|
226
|
-
|
227
|
-
methodize: function() {
|
228
|
-
if (this._methodized) return this._methodized;
|
229
|
-
var __method = this;
|
230
|
-
return this._methodized = function() {
|
231
|
-
return __method.apply(null, [this].concat($A(arguments)));
|
232
|
-
};
|
233
|
-
}
|
234
|
-
});
|
235
|
-
|
236
|
-
Function.prototype.defer = Function.prototype.delay.curry(0.01);
|
237
|
-
|
238
|
-
Date.prototype.toJSON = function() {
|
239
|
-
return '"' + this.getUTCFullYear() + '-' +
|
240
|
-
(this.getUTCMonth() + 1).toPaddedString(2) + '-' +
|
241
|
-
this.getUTCDate().toPaddedString(2) + 'T' +
|
242
|
-
this.getUTCHours().toPaddedString(2) + ':' +
|
243
|
-
this.getUTCMinutes().toPaddedString(2) + ':' +
|
244
|
-
this.getUTCSeconds().toPaddedString(2) + 'Z"';
|
245
|
-
};
|
246
|
-
|
247
|
-
var Try = {
|
248
|
-
these: function() {
|
249
|
-
var returnValue;
|
250
|
-
|
251
|
-
for (var i = 0, length = arguments.length; i < length; i++) {
|
252
|
-
var lambda = arguments[i];
|
253
|
-
try {
|
254
|
-
returnValue = lambda();
|
255
|
-
break;
|
256
|
-
} catch (e) { }
|
257
|
-
}
|
258
|
-
|
259
|
-
return returnValue;
|
260
|
-
}
|
261
|
-
};
|
262
|
-
|
263
|
-
RegExp.prototype.match = RegExp.prototype.test;
|
264
|
-
|
265
|
-
RegExp.escape = function(str) {
|
266
|
-
return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
267
|
-
};
|
268
|
-
|
269
|
-
/*--------------------------------------------------------------------------*/
|
270
|
-
|
271
|
-
var PeriodicalExecuter = Class.create({
|
272
|
-
initialize: function(callback, frequency) {
|
273
|
-
this.callback = callback;
|
274
|
-
this.frequency = frequency;
|
275
|
-
this.currentlyExecuting = false;
|
276
|
-
|
277
|
-
this.registerCallback();
|
278
|
-
},
|
279
|
-
|
280
|
-
registerCallback: function() {
|
281
|
-
this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
|
282
|
-
},
|
283
|
-
|
284
|
-
execute: function() {
|
285
|
-
this.callback(this);
|
286
|
-
},
|
287
|
-
|
288
|
-
stop: function() {
|
289
|
-
if (!this.timer) return;
|
290
|
-
clearInterval(this.timer);
|
291
|
-
this.timer = null;
|
292
|
-
},
|
293
|
-
|
294
|
-
onTimerEvent: function() {
|
295
|
-
if (!this.currentlyExecuting) {
|
296
|
-
try {
|
297
|
-
this.currentlyExecuting = true;
|
298
|
-
this.execute();
|
299
|
-
} finally {
|
300
|
-
this.currentlyExecuting = false;
|
301
|
-
}
|
302
|
-
}
|
303
|
-
}
|
304
|
-
});
|
305
|
-
Object.extend(String, {
|
306
|
-
interpret: function(value) {
|
307
|
-
return value == null ? '' : String(value);
|
308
|
-
},
|
309
|
-
specialChar: {
|
310
|
-
'\b': '\\b',
|
311
|
-
'\t': '\\t',
|
312
|
-
'\n': '\\n',
|
313
|
-
'\f': '\\f',
|
314
|
-
'\r': '\\r',
|
315
|
-
'\\': '\\\\'
|
316
|
-
}
|
317
|
-
});
|
318
|
-
|
319
|
-
Object.extend(String.prototype, {
|
320
|
-
gsub: function(pattern, replacement) {
|
321
|
-
var result = '', source = this, match;
|
322
|
-
replacement = arguments.callee.prepareReplacement(replacement);
|
323
|
-
|
324
|
-
while (source.length > 0) {
|
325
|
-
if (match = source.match(pattern)) {
|
326
|
-
result += source.slice(0, match.index);
|
327
|
-
result += String.interpret(replacement(match));
|
328
|
-
source = source.slice(match.index + match[0].length);
|
329
|
-
} else {
|
330
|
-
result += source, source = '';
|
331
|
-
}
|
332
|
-
}
|
333
|
-
return result;
|
334
|
-
},
|
335
|
-
|
336
|
-
sub: function(pattern, replacement, count) {
|
337
|
-
replacement = this.gsub.prepareReplacement(replacement);
|
338
|
-
count = count === undefined ? 1 : count;
|
339
|
-
|
340
|
-
return this.gsub(pattern, function(match) {
|
341
|
-
if (--count < 0) return match[0];
|
342
|
-
return replacement(match);
|
343
|
-
});
|
344
|
-
},
|
345
|
-
|
346
|
-
scan: function(pattern, iterator) {
|
347
|
-
this.gsub(pattern, iterator);
|
348
|
-
return String(this);
|
349
|
-
},
|
350
|
-
|
351
|
-
truncate: function(length, truncation) {
|
352
|
-
length = length || 30;
|
353
|
-
truncation = truncation === undefined ? '...' : truncation;
|
354
|
-
return this.length > length ?
|
355
|
-
this.slice(0, length - truncation.length) + truncation : String(this);
|
356
|
-
},
|
357
|
-
|
358
|
-
strip: function() {
|
359
|
-
return this.replace(/^\s+/, '').replace(/\s+$/, '');
|
360
|
-
},
|
361
|
-
|
362
|
-
stripTags: function() {
|
363
|
-
return this.replace(/<\/?[^>]+>/gi, '');
|
364
|
-
},
|
365
|
-
|
366
|
-
stripScripts: function() {
|
367
|
-
return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
|
368
|
-
},
|
369
|
-
|
370
|
-
extractScripts: function() {
|
371
|
-
var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
|
372
|
-
var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
|
373
|
-
return (this.match(matchAll) || []).map(function(scriptTag) {
|
374
|
-
return (scriptTag.match(matchOne) || ['', ''])[1];
|
375
|
-
});
|
376
|
-
},
|
377
|
-
|
378
|
-
evalScripts: function() {
|
379
|
-
return this.extractScripts().map(function(script) { return eval(script) });
|
380
|
-
},
|
381
|
-
|
382
|
-
escapeHTML: function() {
|
383
|
-
var self = arguments.callee;
|
384
|
-
self.text.data = this;
|
385
|
-
return self.div.innerHTML;
|
386
|
-
},
|
387
|
-
|
388
|
-
unescapeHTML: function() {
|
389
|
-
var div = new Element('div');
|
390
|
-
div.innerHTML = this.stripTags();
|
391
|
-
return div.childNodes[0] ? (div.childNodes.length > 1 ?
|
392
|
-
$A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
|
393
|
-
div.childNodes[0].nodeValue) : '';
|
394
|
-
},
|
395
|
-
|
396
|
-
toQueryParams: function(separator) {
|
397
|
-
var match = this.strip().match(/([^?#]*)(#.*)?$/);
|
398
|
-
if (!match) return { };
|
399
|
-
|
400
|
-
return match[1].split(separator || '&').inject({ }, function(hash, pair) {
|
401
|
-
if ((pair = pair.split('='))[0]) {
|
402
|
-
var key = decodeURIComponent(pair.shift());
|
403
|
-
var value = pair.length > 1 ? pair.join('=') : pair[0];
|
404
|
-
if (value != undefined) value = decodeURIComponent(value);
|
405
|
-
|
406
|
-
if (key in hash) {
|
407
|
-
if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
|
408
|
-
hash[key].push(value);
|
409
|
-
}
|
410
|
-
else hash[key] = value;
|
411
|
-
}
|
412
|
-
return hash;
|
413
|
-
});
|
414
|
-
},
|
415
|
-
|
416
|
-
toArray: function() {
|
417
|
-
return this.split('');
|
418
|
-
},
|
419
|
-
|
420
|
-
succ: function() {
|
421
|
-
return this.slice(0, this.length - 1) +
|
422
|
-
String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
|
423
|
-
},
|
424
|
-
|
425
|
-
times: function(count) {
|
426
|
-
var result = '';
|
427
|
-
for (var i = 0; i < count; i++) result += this;
|
428
|
-
return result;
|
429
|
-
},
|
430
|
-
|
431
|
-
camelize: function() {
|
432
|
-
var parts = this.split('-'), len = parts.length;
|
433
|
-
if (len == 1) return parts[0];
|
434
|
-
|
435
|
-
var camelized = this.charAt(0) == '-'
|
436
|
-
? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
|
437
|
-
: parts[0];
|
438
|
-
|
439
|
-
for (var i = 1; i < len; i++)
|
440
|
-
camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
|
441
|
-
|
442
|
-
return camelized;
|
443
|
-
},
|
444
|
-
|
445
|
-
capitalize: function() {
|
446
|
-
return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
|
447
|
-
},
|
448
|
-
|
449
|
-
underscore: function() {
|
450
|
-
return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
|
451
|
-
},
|
452
|
-
|
453
|
-
dasherize: function() {
|
454
|
-
return this.gsub(/_/,'-');
|
455
|
-
},
|
456
|
-
|
457
|
-
inspect: function(useDoubleQuotes) {
|
458
|
-
var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
|
459
|
-
var character = String.specialChar[match[0]];
|
460
|
-
return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
|
461
|
-
});
|
462
|
-
if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
|
463
|
-
return "'" + escapedString.replace(/'/g, '\\\'') + "'";
|
464
|
-
},
|
465
|
-
|
466
|
-
toJSON: function() {
|
467
|
-
return this.inspect(true);
|
468
|
-
},
|
469
|
-
|
470
|
-
unfilterJSON: function(filter) {
|
471
|
-
return this.sub(filter || Prototype.JSONFilter, '#{1}');
|
472
|
-
},
|
473
|
-
|
474
|
-
isJSON: function() {
|
475
|
-
var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
|
476
|
-
return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
|
477
|
-
},
|
478
|
-
|
479
|
-
evalJSON: function(sanitize) {
|
480
|
-
var json = this.unfilterJSON();
|
481
|
-
try {
|
482
|
-
if (!sanitize || json.isJSON()) return eval('(' + json + ')');
|
483
|
-
} catch (e) { }
|
484
|
-
throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
|
485
|
-
},
|
486
|
-
|
487
|
-
include: function(pattern) {
|
488
|
-
return this.indexOf(pattern) > -1;
|
489
|
-
},
|
490
|
-
|
491
|
-
startsWith: function(pattern) {
|
492
|
-
return this.indexOf(pattern) === 0;
|
493
|
-
},
|
494
|
-
|
495
|
-
endsWith: function(pattern) {
|
496
|
-
var d = this.length - pattern.length;
|
497
|
-
return d >= 0 && this.lastIndexOf(pattern) === d;
|
498
|
-
},
|
499
|
-
|
500
|
-
empty: function() {
|
501
|
-
return this == '';
|
502
|
-
},
|
503
|
-
|
504
|
-
blank: function() {
|
505
|
-
return /^\s*$/.test(this);
|
506
|
-
},
|
507
|
-
|
508
|
-
interpolate: function(object, pattern) {
|
509
|
-
return new Template(this, pattern).evaluate(object);
|
510
|
-
}
|
511
|
-
});
|
512
|
-
|
513
|
-
if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
|
514
|
-
escapeHTML: function() {
|
515
|
-
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
516
|
-
},
|
517
|
-
unescapeHTML: function() {
|
518
|
-
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
519
|
-
}
|
520
|
-
});
|
521
|
-
|
522
|
-
String.prototype.gsub.prepareReplacement = function(replacement) {
|
523
|
-
if (Object.isFunction(replacement)) return replacement;
|
524
|
-
var template = new Template(replacement);
|
525
|
-
return function(match) { return template.evaluate(match) };
|
526
|
-
};
|
527
|
-
|
528
|
-
String.prototype.parseQuery = String.prototype.toQueryParams;
|
529
|
-
|
530
|
-
Object.extend(String.prototype.escapeHTML, {
|
531
|
-
div: document.createElement('div'),
|
532
|
-
text: document.createTextNode('')
|
533
|
-
});
|
534
|
-
|
535
|
-
with (String.prototype.escapeHTML) div.appendChild(text);
|
536
|
-
|
537
|
-
var Template = Class.create({
|
538
|
-
initialize: function(template, pattern) {
|
539
|
-
this.template = template.toString();
|
540
|
-
this.pattern = pattern || Template.Pattern;
|
541
|
-
},
|
542
|
-
|
543
|
-
evaluate: function(object) {
|
544
|
-
if (Object.isFunction(object.toTemplateReplacements))
|
545
|
-
object = object.toTemplateReplacements();
|
546
|
-
|
547
|
-
return this.template.gsub(this.pattern, function(match) {
|
548
|
-
if (object == null) return '';
|
549
|
-
|
550
|
-
var before = match[1] || '';
|
551
|
-
if (before == '\\') return match[2];
|
552
|
-
|
553
|
-
var ctx = object, expr = match[3];
|
554
|
-
var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr);
|
555
|
-
if (match == null) return '';
|
556
|
-
|
557
|
-
while (match != null) {
|
558
|
-
var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
|
559
|
-
ctx = ctx[comp];
|
560
|
-
if (null == ctx || '' == match[3]) break;
|
561
|
-
expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
|
562
|
-
match = pattern.exec(expr);
|
563
|
-
}
|
564
|
-
|
565
|
-
return before + String.interpret(ctx);
|
566
|
-
}.bind(this));
|
567
|
-
}
|
568
|
-
});
|
569
|
-
Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
|
570
|
-
|
571
|
-
var $break = { };
|
572
|
-
|
573
|
-
var Enumerable = {
|
574
|
-
each: function(iterator, context) {
|
575
|
-
var index = 0;
|
576
|
-
iterator = iterator.bind(context);
|
577
|
-
try {
|
578
|
-
this._each(function(value) {
|
579
|
-
iterator(value, index++);
|
580
|
-
});
|
581
|
-
} catch (e) {
|
582
|
-
if (e != $break) throw e;
|
583
|
-
}
|
584
|
-
return this;
|
585
|
-
},
|
586
|
-
|
587
|
-
eachSlice: function(number, iterator, context) {
|
588
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
589
|
-
var index = -number, slices = [], array = this.toArray();
|
590
|
-
while ((index += number) < array.length)
|
591
|
-
slices.push(array.slice(index, index+number));
|
592
|
-
return slices.collect(iterator, context);
|
593
|
-
},
|
594
|
-
|
595
|
-
all: function(iterator, context) {
|
596
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
597
|
-
var result = true;
|
598
|
-
this.each(function(value, index) {
|
599
|
-
result = result && !!iterator(value, index);
|
600
|
-
if (!result) throw $break;
|
601
|
-
});
|
602
|
-
return result;
|
603
|
-
},
|
604
|
-
|
605
|
-
any: function(iterator, context) {
|
606
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
607
|
-
var result = false;
|
608
|
-
this.each(function(value, index) {
|
609
|
-
if (result = !!iterator(value, index))
|
610
|
-
throw $break;
|
611
|
-
});
|
612
|
-
return result;
|
613
|
-
},
|
614
|
-
|
615
|
-
collect: function(iterator, context) {
|
616
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
617
|
-
var results = [];
|
618
|
-
this.each(function(value, index) {
|
619
|
-
results.push(iterator(value, index));
|
620
|
-
});
|
621
|
-
return results;
|
622
|
-
},
|
623
|
-
|
624
|
-
detect: function(iterator, context) {
|
625
|
-
iterator = iterator.bind(context);
|
626
|
-
var result;
|
627
|
-
this.each(function(value, index) {
|
628
|
-
if (iterator(value, index)) {
|
629
|
-
result = value;
|
630
|
-
throw $break;
|
631
|
-
}
|
632
|
-
});
|
633
|
-
return result;
|
634
|
-
},
|
635
|
-
|
636
|
-
findAll: function(iterator, context) {
|
637
|
-
iterator = iterator.bind(context);
|
638
|
-
var results = [];
|
639
|
-
this.each(function(value, index) {
|
640
|
-
if (iterator(value, index))
|
641
|
-
results.push(value);
|
642
|
-
});
|
643
|
-
return results;
|
644
|
-
},
|
645
|
-
|
646
|
-
grep: function(filter, iterator, context) {
|
647
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
648
|
-
var results = [];
|
649
|
-
|
650
|
-
if (Object.isString(filter))
|
651
|
-
filter = new RegExp(filter);
|
652
|
-
|
653
|
-
this.each(function(value, index) {
|
654
|
-
if (filter.match(value))
|
655
|
-
results.push(iterator(value, index));
|
656
|
-
});
|
657
|
-
return results;
|
658
|
-
},
|
659
|
-
|
660
|
-
include: function(object) {
|
661
|
-
if (Object.isFunction(this.indexOf))
|
662
|
-
if (this.indexOf(object) != -1) return true;
|
663
|
-
|
664
|
-
var found = false;
|
665
|
-
this.each(function(value) {
|
666
|
-
if (value == object) {
|
667
|
-
found = true;
|
668
|
-
throw $break;
|
669
|
-
}
|
670
|
-
});
|
671
|
-
return found;
|
672
|
-
},
|
673
|
-
|
674
|
-
inGroupsOf: function(number, fillWith) {
|
675
|
-
fillWith = fillWith === undefined ? null : fillWith;
|
676
|
-
return this.eachSlice(number, function(slice) {
|
677
|
-
while(slice.length < number) slice.push(fillWith);
|
678
|
-
return slice;
|
679
|
-
});
|
680
|
-
},
|
681
|
-
|
682
|
-
inject: function(memo, iterator, context) {
|
683
|
-
iterator = iterator.bind(context);
|
684
|
-
this.each(function(value, index) {
|
685
|
-
memo = iterator(memo, value, index);
|
686
|
-
});
|
687
|
-
return memo;
|
688
|
-
},
|
689
|
-
|
690
|
-
invoke: function(method) {
|
691
|
-
var args = $A(arguments).slice(1);
|
692
|
-
return this.map(function(value) {
|
693
|
-
return value[method].apply(value, args);
|
694
|
-
});
|
695
|
-
},
|
696
|
-
|
697
|
-
max: function(iterator, context) {
|
698
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
699
|
-
var result;
|
700
|
-
this.each(function(value, index) {
|
701
|
-
value = iterator(value, index);
|
702
|
-
if (result == undefined || value >= result)
|
703
|
-
result = value;
|
704
|
-
});
|
705
|
-
return result;
|
706
|
-
},
|
707
|
-
|
708
|
-
min: function(iterator, context) {
|
709
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
710
|
-
var result;
|
711
|
-
this.each(function(value, index) {
|
712
|
-
value = iterator(value, index);
|
713
|
-
if (result == undefined || value < result)
|
714
|
-
result = value;
|
715
|
-
});
|
716
|
-
return result;
|
717
|
-
},
|
718
|
-
|
719
|
-
partition: function(iterator, context) {
|
720
|
-
iterator = iterator ? iterator.bind(context) : Prototype.K;
|
721
|
-
var trues = [], falses = [];
|
722
|
-
this.each(function(value, index) {
|
723
|
-
(iterator(value, index) ?
|
724
|
-
trues : falses).push(value);
|
725
|
-
});
|
726
|
-
return [trues, falses];
|
727
|
-
},
|
728
|
-
|
729
|
-
pluck: function(property) {
|
730
|
-
var results = [];
|
731
|
-
this.each(function(value) {
|
732
|
-
results.push(value[property]);
|
733
|
-
});
|
734
|
-
return results;
|
735
|
-
},
|
736
|
-
|
737
|
-
reject: function(iterator, context) {
|
738
|
-
iterator = iterator.bind(context);
|
739
|
-
var results = [];
|
740
|
-
this.each(function(value, index) {
|
741
|
-
if (!iterator(value, index))
|
742
|
-
results.push(value);
|
743
|
-
});
|
744
|
-
return results;
|
745
|
-
},
|
746
|
-
|
747
|
-
sortBy: function(iterator, context) {
|
748
|
-
iterator = iterator.bind(context);
|
749
|
-
return this.map(function(value, index) {
|
750
|
-
return {value: value, criteria: iterator(value, index)};
|
751
|
-
}).sort(function(left, right) {
|
752
|
-
var a = left.criteria, b = right.criteria;
|
753
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
754
|
-
}).pluck('value');
|
755
|
-
},
|
756
|
-
|
757
|
-
toArray: function() {
|
758
|
-
return this.map();
|
759
|
-
},
|
760
|
-
|
761
|
-
zip: function() {
|
762
|
-
var iterator = Prototype.K, args = $A(arguments);
|
763
|
-
if (Object.isFunction(args.last()))
|
764
|
-
iterator = args.pop();
|
765
|
-
|
766
|
-
var collections = [this].concat(args).map($A);
|
767
|
-
return this.map(function(value, index) {
|
768
|
-
return iterator(collections.pluck(index));
|
769
|
-
});
|
770
|
-
},
|
771
|
-
|
772
|
-
size: function() {
|
773
|
-
return this.toArray().length;
|
774
|
-
},
|
775
|
-
|
776
|
-
inspect: function() {
|
777
|
-
return '#<Enumerable:' + this.toArray().inspect() + '>';
|
778
|
-
}
|
779
|
-
};
|
780
|
-
|
781
|
-
Object.extend(Enumerable, {
|
782
|
-
map: Enumerable.collect,
|
783
|
-
find: Enumerable.detect,
|
784
|
-
select: Enumerable.findAll,
|
785
|
-
filter: Enumerable.findAll,
|
786
|
-
member: Enumerable.include,
|
787
|
-
entries: Enumerable.toArray,
|
788
|
-
every: Enumerable.all,
|
789
|
-
some: Enumerable.any
|
790
|
-
});
|
791
|
-
function $A(iterable) {
|
792
|
-
if (!iterable) return [];
|
793
|
-
if (iterable.toArray) return iterable.toArray();
|
794
|
-
else {
|
795
|
-
var results = [];
|
796
|
-
for (var i = 0, length = iterable.length; i < length; i++)
|
797
|
-
results.push(iterable[i]);
|
798
|
-
return results;
|
799
|
-
}
|
800
|
-
}
|
801
|
-
|
802
|
-
if (Prototype.Browser.WebKit) {
|
803
|
-
function $A(iterable) {
|
804
|
-
if (!iterable) return [];
|
805
|
-
if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
|
806
|
-
iterable.toArray) {
|
807
|
-
return iterable.toArray();
|
808
|
-
} else {
|
809
|
-
var results = [];
|
810
|
-
for (var i = 0, length = iterable.length; i < length; i++)
|
811
|
-
results.push(iterable[i]);
|
812
|
-
return results;
|
813
|
-
}
|
814
|
-
}
|
815
|
-
}
|
816
|
-
|
817
|
-
Array.from = $A;
|
818
|
-
|
819
|
-
Object.extend(Array.prototype, Enumerable);
|
820
|
-
|
821
|
-
if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
|
822
|
-
|
823
|
-
Object.extend(Array.prototype, {
|
824
|
-
_each: function(iterator) {
|
825
|
-
for (var i = 0, length = this.length; i < length; i++)
|
826
|
-
iterator(this[i]);
|
827
|
-
},
|
828
|
-
|
829
|
-
clear: function() {
|
830
|
-
this.length = 0;
|
831
|
-
return this;
|
832
|
-
},
|
833
|
-
|
834
|
-
first: function() {
|
835
|
-
return this[0];
|
836
|
-
},
|
837
|
-
|
838
|
-
last: function() {
|
839
|
-
return this[this.length - 1];
|
840
|
-
},
|
841
|
-
|
842
|
-
compact: function() {
|
843
|
-
return this.select(function(value) {
|
844
|
-
return value != null;
|
845
|
-
});
|
846
|
-
},
|
847
|
-
|
848
|
-
flatten: function() {
|
849
|
-
return this.inject([], function(array, value) {
|
850
|
-
return array.concat(Object.isArray(value) ?
|
851
|
-
value.flatten() : [value]);
|
852
|
-
});
|
853
|
-
},
|
854
|
-
|
855
|
-
without: function() {
|
856
|
-
var values = $A(arguments);
|
857
|
-
return this.select(function(value) {
|
858
|
-
return !values.include(value);
|
859
|
-
});
|
860
|
-
},
|
861
|
-
|
862
|
-
reverse: function(inline) {
|
863
|
-
return (inline !== false ? this : this.toArray())._reverse();
|
864
|
-
},
|
865
|
-
|
866
|
-
reduce: function() {
|
867
|
-
return this.length > 1 ? this : this[0];
|
868
|
-
},
|
869
|
-
|
870
|
-
uniq: function(sorted) {
|
871
|
-
return this.inject([], function(array, value, index) {
|
872
|
-
if (0 == index || (sorted ? array.last() != value : !array.include(value)))
|
873
|
-
array.push(value);
|
874
|
-
return array;
|
875
|
-
});
|
876
|
-
},
|
877
|
-
|
878
|
-
intersect: function(array) {
|
879
|
-
return this.uniq().findAll(function(item) {
|
880
|
-
return array.detect(function(value) { return item === value });
|
881
|
-
});
|
882
|
-
},
|
883
|
-
|
884
|
-
clone: function() {
|
885
|
-
return [].concat(this);
|
886
|
-
},
|
887
|
-
|
888
|
-
size: function() {
|
889
|
-
return this.length;
|
890
|
-
},
|
891
|
-
|
892
|
-
inspect: function() {
|
893
|
-
return '[' + this.map(Object.inspect).join(', ') + ']';
|
894
|
-
},
|
895
|
-
|
896
|
-
toJSON: function() {
|
897
|
-
var results = [];
|
898
|
-
this.each(function(object) {
|
899
|
-
var value = Object.toJSON(object);
|
900
|
-
if (value !== undefined) results.push(value);
|
901
|
-
});
|
902
|
-
return '[' + results.join(', ') + ']';
|
903
|
-
}
|
904
|
-
});
|
905
|
-
|
906
|
-
// use native browser JS 1.6 implementation if available
|
907
|
-
if (Object.isFunction(Array.prototype.forEach))
|
908
|
-
Array.prototype._each = Array.prototype.forEach;
|
909
|
-
|
910
|
-
if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
|
911
|
-
i || (i = 0);
|
912
|
-
var length = this.length;
|
913
|
-
if (i < 0) i = length + i;
|
914
|
-
for (; i < length; i++)
|
915
|
-
if (this[i] === item) return i;
|
916
|
-
return -1;
|
917
|
-
};
|
918
|
-
|
919
|
-
if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
|
920
|
-
i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
|
921
|
-
var n = this.slice(0, i).reverse().indexOf(item);
|
922
|
-
return (n < 0) ? n : i - n - 1;
|
923
|
-
};
|
924
|
-
|
925
|
-
Array.prototype.toArray = Array.prototype.clone;
|
926
|
-
|
927
|
-
function $w(string) {
|
928
|
-
string = string.strip();
|
929
|
-
return string ? string.split(/\s+/) : [];
|
930
|
-
}
|
931
|
-
|
932
|
-
if (Prototype.Browser.Opera){
|
933
|
-
Array.prototype.concat = function() {
|
934
|
-
var array = [];
|
935
|
-
for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
|
936
|
-
for (var i = 0, length = arguments.length; i < length; i++) {
|
937
|
-
if (Object.isArray(arguments[i])) {
|
938
|
-
for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
|
939
|
-
array.push(arguments[i][j]);
|
940
|
-
} else {
|
941
|
-
array.push(arguments[i]);
|
942
|
-
}
|
943
|
-
}
|
944
|
-
return array;
|
945
|
-
};
|
946
|
-
}
|
947
|
-
Object.extend(Number.prototype, {
|
948
|
-
toColorPart: function() {
|
949
|
-
return this.toPaddedString(2, 16);
|
950
|
-
},
|
951
|
-
|
952
|
-
succ: function() {
|
953
|
-
return this + 1;
|
954
|
-
},
|
955
|
-
|
956
|
-
times: function(iterator) {
|
957
|
-
$R(0, this, true).each(iterator);
|
958
|
-
return this;
|
959
|
-
},
|
960
|
-
|
961
|
-
toPaddedString: function(length, radix) {
|
962
|
-
var string = this.toString(radix || 10);
|
963
|
-
return '0'.times(length - string.length) + string;
|
964
|
-
},
|
965
|
-
|
966
|
-
toJSON: function() {
|
967
|
-
return isFinite(this) ? this.toString() : 'null';
|
968
|
-
}
|
969
|
-
});
|
970
|
-
|
971
|
-
$w('abs round ceil floor').each(function(method){
|
972
|
-
Number.prototype[method] = Math[method].methodize();
|
973
|
-
});
|
974
|
-
var Hash = function(object) {
|
975
|
-
if (object instanceof Hash) this.merge(object);
|
976
|
-
else Object.extend(this, object || { });
|
977
|
-
};
|
978
|
-
|
979
|
-
Object.extend(Hash, {
|
980
|
-
toQueryString: function(obj) {
|
981
|
-
var parts = [];
|
982
|
-
parts.add = arguments.callee.addPair;
|
983
|
-
|
984
|
-
this.prototype._each.call(obj, function(pair) {
|
985
|
-
if (!pair.key) return;
|
986
|
-
var value = pair.value;
|
987
|
-
|
988
|
-
if (value && typeof value == 'object') {
|
989
|
-
if (Object.isArray(value)) value.each(function(value) {
|
990
|
-
parts.add(pair.key, value);
|
991
|
-
});
|
992
|
-
return;
|
993
|
-
}
|
994
|
-
parts.add(pair.key, value);
|
995
|
-
});
|
996
|
-
|
997
|
-
return parts.join('&');
|
998
|
-
},
|
999
|
-
|
1000
|
-
toJSON: function(object) {
|
1001
|
-
var results = [];
|
1002
|
-
this.prototype._each.call(object, function(pair) {
|
1003
|
-
var value = Object.toJSON(pair.value);
|
1004
|
-
if (value !== undefined) results.push(pair.key.toJSON() + ': ' + value);
|
1005
|
-
});
|
1006
|
-
return '{' + results.join(', ') + '}';
|
1007
|
-
}
|
1008
|
-
});
|
1009
|
-
|
1010
|
-
Hash.toQueryString.addPair = function(key, value, prefix) {
|
1011
|
-
key = encodeURIComponent(key);
|
1012
|
-
if (value === undefined) this.push(key);
|
1013
|
-
else this.push(key + '=' + (value == null ? '' : encodeURIComponent(value)));
|
1014
|
-
};
|
1015
|
-
|
1016
|
-
Object.extend(Hash.prototype, Enumerable);
|
1017
|
-
Object.extend(Hash.prototype, {
|
1018
|
-
_each: function(iterator) {
|
1019
|
-
for (var key in this) {
|
1020
|
-
var value = this[key];
|
1021
|
-
if (value && value == Hash.prototype[key]) continue;
|
1022
|
-
|
1023
|
-
var pair = [key, value];
|
1024
|
-
pair.key = key;
|
1025
|
-
pair.value = value;
|
1026
|
-
iterator(pair);
|
1027
|
-
}
|
1028
|
-
},
|
1029
|
-
|
1030
|
-
keys: function() {
|
1031
|
-
return this.pluck('key');
|
1032
|
-
},
|
1033
|
-
|
1034
|
-
values: function() {
|
1035
|
-
return this.pluck('value');
|
1036
|
-
},
|
1037
|
-
|
1038
|
-
index: function(value) {
|
1039
|
-
var match = this.detect(function(pair) {
|
1040
|
-
return pair.value === value;
|
1041
|
-
});
|
1042
|
-
return match && match.key;
|
1043
|
-
},
|
1044
|
-
|
1045
|
-
merge: function(hash) {
|
1046
|
-
return $H(hash).inject(this, function(mergedHash, pair) {
|
1047
|
-
mergedHash[pair.key] = pair.value;
|
1048
|
-
return mergedHash;
|
1049
|
-
});
|
1050
|
-
},
|
1051
|
-
|
1052
|
-
remove: function() {
|
1053
|
-
var result;
|
1054
|
-
for(var i = 0, length = arguments.length; i < length; i++) {
|
1055
|
-
var value = this[arguments[i]];
|
1056
|
-
if (value !== undefined){
|
1057
|
-
if (result === undefined) result = value;
|
1058
|
-
else {
|
1059
|
-
if (!Object.isArray(result)) result = [result];
|
1060
|
-
result.push(value);
|
1061
|
-
}
|
1062
|
-
}
|
1063
|
-
delete this[arguments[i]];
|
1064
|
-
}
|
1065
|
-
return result;
|
1066
|
-
},
|
1067
|
-
|
1068
|
-
toQueryString: function() {
|
1069
|
-
return Hash.toQueryString(this);
|
1070
|
-
},
|
1071
|
-
|
1072
|
-
inspect: function() {
|
1073
|
-
return '#<Hash:{' + this.map(function(pair) {
|
1074
|
-
return pair.map(Object.inspect).join(': ');
|
1075
|
-
}).join(', ') + '}>';
|
1076
|
-
},
|
1077
|
-
|
1078
|
-
toJSON: function() {
|
1079
|
-
return Hash.toJSON(this);
|
1080
|
-
}
|
1081
|
-
});
|
1082
|
-
|
1083
|
-
function $H(object) {
|
1084
|
-
if (object instanceof Hash) return object;
|
1085
|
-
return new Hash(object);
|
1086
|
-
};
|
1087
|
-
|
1088
|
-
// Safari iterates over shadowed properties
|
1089
|
-
if (function() {
|
1090
|
-
var i = 0, Test = function(value) { this.key = value };
|
1091
|
-
Test.prototype.key = 'foo';
|
1092
|
-
for (var property in new Test('bar')) i++;
|
1093
|
-
return i > 1;
|
1094
|
-
}()) Hash.prototype._each = function(iterator) {
|
1095
|
-
var cache = [];
|
1096
|
-
for (var key in this) {
|
1097
|
-
var value = this[key];
|
1098
|
-
if ((value && value == Hash.prototype[key]) || cache.include(key)) continue;
|
1099
|
-
cache.push(key);
|
1100
|
-
var pair = [key, value];
|
1101
|
-
pair.key = key;
|
1102
|
-
pair.value = value;
|
1103
|
-
iterator(pair);
|
1104
|
-
}
|
1105
|
-
};
|
1106
|
-
ObjectRange = Class.create({
|
1107
|
-
initialize: function(start, end, exclusive) {
|
1108
|
-
this.start = start;
|
1109
|
-
this.end = end;
|
1110
|
-
this.exclusive = exclusive;
|
1111
|
-
},
|
1112
|
-
|
1113
|
-
_each: function(iterator) {
|
1114
|
-
var value = this.start;
|
1115
|
-
while (this.include(value)) {
|
1116
|
-
iterator(value);
|
1117
|
-
value = value.succ();
|
1118
|
-
}
|
1119
|
-
}
|
1120
|
-
});
|
1121
|
-
|
1122
|
-
Object.extend(ObjectRange.prototype, Enumerable);
|
1123
|
-
|
1124
|
-
ObjectRange.prototype.include = function(value) {
|
1125
|
-
if (value < this.start)
|
1126
|
-
return false;
|
1127
|
-
if (this.exclusive)
|
1128
|
-
return value < this.end;
|
1129
|
-
return value <= this.end;
|
1130
|
-
};
|
1131
|
-
|
1132
|
-
var $R = function(start, end, exclusive) {
|
1133
|
-
return new ObjectRange(start, end, exclusive);
|
1134
|
-
};
|
1135
|
-
|
1136
|
-
var Ajax = {
|
1137
|
-
getTransport: function() {
|
1138
|
-
return Try.these(
|
1139
|
-
function() {return new XMLHttpRequest()},
|
1140
|
-
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
1141
|
-
function() {return new ActiveXObject('Microsoft.XMLHTTP')}
|
1142
|
-
) || false;
|
1143
|
-
},
|
1144
|
-
|
1145
|
-
activeRequestCount: 0
|
1146
|
-
};
|
1147
|
-
|
1148
|
-
Ajax.Responders = {
|
1149
|
-
responders: [],
|
1150
|
-
|
1151
|
-
_each: function(iterator) {
|
1152
|
-
this.responders._each(iterator);
|
1153
|
-
},
|
1154
|
-
|
1155
|
-
register: function(responder) {
|
1156
|
-
if (!this.include(responder))
|
1157
|
-
this.responders.push(responder);
|
1158
|
-
},
|
1159
|
-
|
1160
|
-
unregister: function(responder) {
|
1161
|
-
this.responders = this.responders.without(responder);
|
1162
|
-
},
|
1163
|
-
|
1164
|
-
dispatch: function(callback, request, transport, json) {
|
1165
|
-
this.each(function(responder) {
|
1166
|
-
if (Object.isFunction(responder[callback])) {
|
1167
|
-
try {
|
1168
|
-
responder[callback].apply(responder, [request, transport, json]);
|
1169
|
-
} catch (e) { }
|
1170
|
-
}
|
1171
|
-
});
|
1172
|
-
}
|
1173
|
-
};
|
1174
|
-
|
1175
|
-
Object.extend(Ajax.Responders, Enumerable);
|
1176
|
-
|
1177
|
-
Ajax.Responders.register({
|
1178
|
-
onCreate: function() { Ajax.activeRequestCount++ },
|
1179
|
-
onComplete: function() { Ajax.activeRequestCount-- }
|
1180
|
-
});
|
1181
|
-
|
1182
|
-
Ajax.Base = Class.create({
|
1183
|
-
initialize: function(options) {
|
1184
|
-
this.options = {
|
1185
|
-
method: 'post',
|
1186
|
-
asynchronous: true,
|
1187
|
-
contentType: 'application/x-www-form-urlencoded',
|
1188
|
-
encoding: 'UTF-8',
|
1189
|
-
parameters: '',
|
1190
|
-
evalJSON: true,
|
1191
|
-
evalJS: true
|
1192
|
-
};
|
1193
|
-
Object.extend(this.options, options || { });
|
1194
|
-
|
1195
|
-
this.options.method = this.options.method.toLowerCase();
|
1196
|
-
if (Object.isString(this.options.parameters))
|
1197
|
-
this.options.parameters = this.options.parameters.toQueryParams();
|
1198
|
-
}
|
1199
|
-
});
|
1200
|
-
|
1201
|
-
Ajax.Request = Class.create(Ajax.Base, {
|
1202
|
-
_complete: false,
|
1203
|
-
|
1204
|
-
initialize: function($super, url, options) {
|
1205
|
-
$super(options);
|
1206
|
-
this.transport = Ajax.getTransport();
|
1207
|
-
this.request(url);
|
1208
|
-
},
|
1209
|
-
|
1210
|
-
request: function(url) {
|
1211
|
-
this.url = url;
|
1212
|
-
this.method = this.options.method;
|
1213
|
-
var params = Object.clone(this.options.parameters);
|
1214
|
-
|
1215
|
-
if (!['get', 'post'].include(this.method)) {
|
1216
|
-
// simulate other verbs over post
|
1217
|
-
params['_method'] = this.method;
|
1218
|
-
this.method = 'post';
|
1219
|
-
}
|
1220
|
-
|
1221
|
-
this.parameters = params;
|
1222
|
-
|
1223
|
-
if (params = Hash.toQueryString(params)) {
|
1224
|
-
// when GET, append parameters to URL
|
1225
|
-
if (this.method == 'get')
|
1226
|
-
this.url += (this.url.include('?') ? '&' : '?') + params;
|
1227
|
-
else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
|
1228
|
-
params += '&_=';
|
1229
|
-
}
|
1230
|
-
|
1231
|
-
try {
|
1232
|
-
var response = new Ajax.Response(this);
|
1233
|
-
if (this.options.onCreate) this.options.onCreate(response);
|
1234
|
-
Ajax.Responders.dispatch('onCreate', this, response);
|
1235
|
-
|
1236
|
-
this.transport.open(this.method.toUpperCase(), this.url,
|
1237
|
-
this.options.asynchronous);
|
1238
|
-
|
1239
|
-
if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
|
1240
|
-
|
1241
|
-
this.transport.onreadystatechange = this.onStateChange.bind(this);
|
1242
|
-
this.setRequestHeaders();
|
1243
|
-
|
1244
|
-
this.body = this.method == 'post' ? (this.options.postBody || params) : null;
|
1245
|
-
this.transport.send(this.body);
|
1246
|
-
|
1247
|
-
/* Force Firefox to handle ready state 4 for synchronous requests */
|
1248
|
-
if (!this.options.asynchronous && this.transport.overrideMimeType)
|
1249
|
-
this.onStateChange();
|
1250
|
-
|
1251
|
-
}
|
1252
|
-
catch (e) {
|
1253
|
-
this.dispatchException(e);
|
1254
|
-
}
|
1255
|
-
},
|
1256
|
-
|
1257
|
-
onStateChange: function() {
|
1258
|
-
var readyState = this.transport.readyState;
|
1259
|
-
if (readyState > 1 && !((readyState == 4) && this._complete))
|
1260
|
-
this.respondToReadyState(this.transport.readyState);
|
1261
|
-
},
|
1262
|
-
|
1263
|
-
setRequestHeaders: function() {
|
1264
|
-
var headers = {
|
1265
|
-
'X-Requested-With': 'XMLHttpRequest',
|
1266
|
-
'X-Prototype-Version': Prototype.Version,
|
1267
|
-
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
|
1268
|
-
};
|
1269
|
-
|
1270
|
-
if (this.method == 'post') {
|
1271
|
-
headers['Content-type'] = this.options.contentType +
|
1272
|
-
(this.options.encoding ? '; charset=' + this.options.encoding : '');
|
1273
|
-
|
1274
|
-
/* Force "Connection: close" for older Mozilla browsers to work
|
1275
|
-
* around a bug where XMLHttpRequest sends an incorrect
|
1276
|
-
* Content-length header. See Mozilla Bugzilla #246651.
|
1277
|
-
*/
|
1278
|
-
if (this.transport.overrideMimeType &&
|
1279
|
-
(navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
|
1280
|
-
headers['Connection'] = 'close';
|
1281
|
-
}
|
1282
|
-
|
1283
|
-
// user-defined headers
|
1284
|
-
if (typeof this.options.requestHeaders == 'object') {
|
1285
|
-
var extras = this.options.requestHeaders;
|
1286
|
-
|
1287
|
-
if (Object.isFunction(extras.push))
|
1288
|
-
for (var i = 0, length = extras.length; i < length; i += 2)
|
1289
|
-
headers[extras[i]] = extras[i+1];
|
1290
|
-
else
|
1291
|
-
$H(extras).each(function(pair) { headers[pair.key] = pair.value });
|
1292
|
-
}
|
1293
|
-
|
1294
|
-
for (var name in headers)
|
1295
|
-
this.transport.setRequestHeader(name, headers[name]);
|
1296
|
-
},
|
1297
|
-
|
1298
|
-
success: function() {
|
1299
|
-
var status = this.getStatus();
|
1300
|
-
return !status || (status >= 200 && status < 300);
|
1301
|
-
},
|
1302
|
-
|
1303
|
-
getStatus: function() {
|
1304
|
-
try {
|
1305
|
-
return this.transport.status || 0;
|
1306
|
-
} catch (e) { return 0 }
|
1307
|
-
},
|
1308
|
-
|
1309
|
-
respondToReadyState: function(readyState) {
|
1310
|
-
var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
|
1311
|
-
|
1312
|
-
if (state == 'Complete') {
|
1313
|
-
try {
|
1314
|
-
this._complete = true;
|
1315
|
-
(this.options['on' + response.status]
|
1316
|
-
|| this.options['on' + (this.success() ? 'Success' : 'Failure')]
|
1317
|
-
|| Prototype.emptyFunction)(response, response.headerJSON);
|
1318
|
-
} catch (e) {
|
1319
|
-
this.dispatchException(e);
|
1320
|
-
}
|
1321
|
-
|
1322
|
-
var contentType = response.getHeader('Content-type');
|
1323
|
-
if (this.options.evalJS == 'force'
|
1324
|
-
|| (this.options.evalJS && contentType
|
1325
|
-
&& contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
|
1326
|
-
this.evalResponse();
|
1327
|
-
}
|
1328
|
-
|
1329
|
-
try {
|
1330
|
-
(this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
|
1331
|
-
Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
|
1332
|
-
} catch (e) {
|
1333
|
-
this.dispatchException(e);
|
1334
|
-
}
|
1335
|
-
|
1336
|
-
if (state == 'Complete') {
|
1337
|
-
// avoid memory leak in MSIE: clean up
|
1338
|
-
this.transport.onreadystatechange = Prototype.emptyFunction;
|
1339
|
-
}
|
1340
|
-
},
|
1341
|
-
|
1342
|
-
getHeader: function(name) {
|
1343
|
-
try {
|
1344
|
-
return this.transport.getResponseHeader(name);
|
1345
|
-
} catch (e) { return null }
|
1346
|
-
},
|
1347
|
-
|
1348
|
-
evalResponse: function() {
|
1349
|
-
try {
|
1350
|
-
return eval((this.transport.responseText || '').unfilterJSON());
|
1351
|
-
} catch (e) {
|
1352
|
-
this.dispatchException(e);
|
1353
|
-
}
|
1354
|
-
},
|
1355
|
-
|
1356
|
-
dispatchException: function(exception) {
|
1357
|
-
(this.options.onException || Prototype.emptyFunction)(this, exception);
|
1358
|
-
Ajax.Responders.dispatch('onException', this, exception);
|
1359
|
-
}
|
1360
|
-
});
|
1361
|
-
|
1362
|
-
Ajax.Request.Events =
|
1363
|
-
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
1364
|
-
|
1365
|
-
Ajax.Response = Class.create({
|
1366
|
-
initialize: function(request){
|
1367
|
-
this.request = request;
|
1368
|
-
var transport = this.transport = request.transport,
|
1369
|
-
readyState = this.readyState = transport.readyState;
|
1370
|
-
|
1371
|
-
if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
|
1372
|
-
this.status = this.getStatus();
|
1373
|
-
this.statusText = this.getStatusText();
|
1374
|
-
this.responseText = String.interpret(transport.responseText);
|
1375
|
-
this.headerJSON = this.getHeaderJSON();
|
1376
|
-
}
|
1377
|
-
|
1378
|
-
if(readyState == 4) {
|
1379
|
-
var xml = transport.responseXML;
|
1380
|
-
this.responseXML = xml === undefined ? null : xml;
|
1381
|
-
this.responseJSON = this.getResponseJSON();
|
1382
|
-
}
|
1383
|
-
},
|
1384
|
-
|
1385
|
-
status: 0,
|
1386
|
-
statusText: '',
|
1387
|
-
|
1388
|
-
getStatus: Ajax.Request.prototype.getStatus,
|
1389
|
-
|
1390
|
-
getStatusText: function() {
|
1391
|
-
try {
|
1392
|
-
return this.transport.statusText || '';
|
1393
|
-
} catch (e) { return '' }
|
1394
|
-
},
|
1395
|
-
|
1396
|
-
getHeader: Ajax.Request.prototype.getHeader,
|
1397
|
-
|
1398
|
-
getAllHeaders: function() {
|
1399
|
-
try {
|
1400
|
-
return this.getAllResponseHeaders();
|
1401
|
-
} catch (e) { return null }
|
1402
|
-
},
|
1403
|
-
|
1404
|
-
getResponseHeader: function(name) {
|
1405
|
-
return this.transport.getResponseHeader(name);
|
1406
|
-
},
|
1407
|
-
|
1408
|
-
getAllResponseHeaders: function() {
|
1409
|
-
return this.transport.getAllResponseHeaders();
|
1410
|
-
},
|
1411
|
-
|
1412
|
-
getHeaderJSON: function() {
|
1413
|
-
var json = this.getHeader('X-JSON');
|
1414
|
-
try {
|
1415
|
-
return json ? json.evalJSON(this.request.options.sanitizeJSON) : null;
|
1416
|
-
} catch (e) {
|
1417
|
-
this.request.dispatchException(e);
|
1418
|
-
}
|
1419
|
-
},
|
1420
|
-
|
1421
|
-
getResponseJSON: function() {
|
1422
|
-
var options = this.request.options;
|
1423
|
-
try {
|
1424
|
-
if (options.evalJSON == 'force' || (options.evalJSON &&
|
1425
|
-
(this.getHeader('Content-type') || '').include('application/json')))
|
1426
|
-
return this.transport.responseText.evalJSON(options.sanitizeJSON);
|
1427
|
-
return null;
|
1428
|
-
} catch (e) {
|
1429
|
-
this.request.dispatchException(e);
|
1430
|
-
}
|
1431
|
-
}
|
1432
|
-
});
|
1433
|
-
|
1434
|
-
Ajax.Updater = Class.create(Ajax.Request, {
|
1435
|
-
initialize: function($super, container, url, options) {
|
1436
|
-
this.container = {
|
1437
|
-
success: (container.success || container),
|
1438
|
-
failure: (container.failure || (container.success ? null : container))
|
1439
|
-
};
|
1440
|
-
|
1441
|
-
options = options || { };
|
1442
|
-
var onComplete = options.onComplete;
|
1443
|
-
options.onComplete = (function(response, param) {
|
1444
|
-
this.updateContent(response.responseText);
|
1445
|
-
if (Object.isFunction(onComplete)) onComplete(response, param);
|
1446
|
-
}).bind(this);
|
1447
|
-
|
1448
|
-
$super(url, options);
|
1449
|
-
},
|
1450
|
-
|
1451
|
-
updateContent: function(responseText) {
|
1452
|
-
var receiver = this.container[this.success() ? 'success' : 'failure'],
|
1453
|
-
options = this.options;
|
1454
|
-
|
1455
|
-
if (!options.evalScripts) responseText = responseText.stripScripts();
|
1456
|
-
|
1457
|
-
if (receiver = $(receiver)) {
|
1458
|
-
if (options.insertion) {
|
1459
|
-
if (Object.isString(options.insertion)) {
|
1460
|
-
var insertion = { }; insertion[options.insertion] = responseText;
|
1461
|
-
receiver.insert(insertion);
|
1462
|
-
}
|
1463
|
-
else options.insertion(receiver, responseText);
|
1464
|
-
}
|
1465
|
-
else receiver.update(responseText);
|
1466
|
-
}
|
1467
|
-
|
1468
|
-
if (this.success()) {
|
1469
|
-
if (this.onComplete) this.onComplete.bind(this).defer();
|
1470
|
-
}
|
1471
|
-
}
|
1472
|
-
});
|
1473
|
-
|
1474
|
-
Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
1475
|
-
initialize: function($super, container, url, options) {
|
1476
|
-
$super(options);
|
1477
|
-
this.onComplete = this.options.onComplete;
|
1478
|
-
|
1479
|
-
this.frequency = (this.options.frequency || 2);
|
1480
|
-
this.decay = (this.options.decay || 1);
|
1481
|
-
|
1482
|
-
this.updater = { };
|
1483
|
-
this.container = container;
|
1484
|
-
this.url = url;
|
1485
|
-
|
1486
|
-
this.start();
|
1487
|
-
},
|
1488
|
-
|
1489
|
-
start: function() {
|
1490
|
-
this.options.onComplete = this.updateComplete.bind(this);
|
1491
|
-
this.onTimerEvent();
|
1492
|
-
},
|
1493
|
-
|
1494
|
-
stop: function() {
|
1495
|
-
this.updater.options.onComplete = undefined;
|
1496
|
-
clearTimeout(this.timer);
|
1497
|
-
(this.onComplete || Prototype.emptyFunction).apply(this, arguments);
|
1498
|
-
},
|
1499
|
-
|
1500
|
-
updateComplete: function(response) {
|
1501
|
-
if (this.options.decay) {
|
1502
|
-
this.decay = (response.responseText == this.lastText ?
|
1503
|
-
this.decay * this.options.decay : 1);
|
1504
|
-
|
1505
|
-
this.lastText = response.responseText;
|
1506
|
-
}
|
1507
|
-
this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
|
1508
|
-
},
|
1509
|
-
|
1510
|
-
onTimerEvent: function() {
|
1511
|
-
this.updater = new Ajax.Updater(this.container, this.url, this.options);
|
1512
|
-
}
|
1513
|
-
});
|
1514
|
-
function $(element) {
|
1515
|
-
if (arguments.length > 1) {
|
1516
|
-
for (var i = 0, elements = [], length = arguments.length; i < length; i++)
|
1517
|
-
elements.push($(arguments[i]));
|
1518
|
-
return elements;
|
1519
|
-
}
|
1520
|
-
if (Object.isString(element))
|
1521
|
-
element = document.getElementById(element);
|
1522
|
-
return Element.extend(element);
|
1523
|
-
}
|
1524
|
-
|
1525
|
-
if (Prototype.BrowserFeatures.XPath) {
|
1526
|
-
document._getElementsByXPath = function(expression, parentElement) {
|
1527
|
-
var results = [];
|
1528
|
-
var query = document.evaluate(expression, $(parentElement) || document,
|
1529
|
-
null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
|
1530
|
-
for (var i = 0, length = query.snapshotLength; i < length; i++)
|
1531
|
-
results.push(Element.extend(query.snapshotItem(i)));
|
1532
|
-
return results;
|
1533
|
-
};
|
1534
|
-
}
|
1535
|
-
|
1536
|
-
/*--------------------------------------------------------------------------*/
|
1537
|
-
|
1538
|
-
if (!window.Node) var Node = { };
|
1539
|
-
|
1540
|
-
if (!Node.ELEMENT_NODE) {
|
1541
|
-
// DOM level 2 ECMAScript Language Binding
|
1542
|
-
Object.extend(Node, {
|
1543
|
-
ELEMENT_NODE: 1,
|
1544
|
-
ATTRIBUTE_NODE: 2,
|
1545
|
-
TEXT_NODE: 3,
|
1546
|
-
CDATA_SECTION_NODE: 4,
|
1547
|
-
ENTITY_REFERENCE_NODE: 5,
|
1548
|
-
ENTITY_NODE: 6,
|
1549
|
-
PROCESSING_INSTRUCTION_NODE: 7,
|
1550
|
-
COMMENT_NODE: 8,
|
1551
|
-
DOCUMENT_NODE: 9,
|
1552
|
-
DOCUMENT_TYPE_NODE: 10,
|
1553
|
-
DOCUMENT_FRAGMENT_NODE: 11,
|
1554
|
-
NOTATION_NODE: 12
|
1555
|
-
});
|
1556
|
-
}
|
1557
|
-
|
1558
|
-
(function() {
|
1559
|
-
var element = this.Element;
|
1560
|
-
this.Element = function(tagName, attributes) {
|
1561
|
-
attributes = attributes || { };
|
1562
|
-
tagName = tagName.toLowerCase();
|
1563
|
-
var cache = Element.cache;
|
1564
|
-
if (Prototype.Browser.IE && attributes.name) {
|
1565
|
-
tagName = '<' + tagName + ' name="' + attributes.name + '">';
|
1566
|
-
delete attributes.name;
|
1567
|
-
return Element.writeAttribute(document.createElement(tagName), attributes);
|
1568
|
-
}
|
1569
|
-
if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
|
1570
|
-
return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
|
1571
|
-
};
|
1572
|
-
Object.extend(this.Element, element || { });
|
1573
|
-
}).call(window);
|
1574
|
-
|
1575
|
-
Element.cache = { };
|
1576
|
-
|
1577
|
-
Element.Methods = {
|
1578
|
-
visible: function(element) {
|
1579
|
-
return $(element).style.display != 'none';
|
1580
|
-
},
|
1581
|
-
|
1582
|
-
toggle: function(element) {
|
1583
|
-
element = $(element);
|
1584
|
-
Element[Element.visible(element) ? 'hide' : 'show'](element);
|
1585
|
-
return element;
|
1586
|
-
},
|
1587
|
-
|
1588
|
-
hide: function(element) {
|
1589
|
-
$(element).style.display = 'none';
|
1590
|
-
return element;
|
1591
|
-
},
|
1592
|
-
|
1593
|
-
show: function(element) {
|
1594
|
-
$(element).style.display = '';
|
1595
|
-
return element;
|
1596
|
-
},
|
1597
|
-
|
1598
|
-
remove: function(element) {
|
1599
|
-
element = $(element);
|
1600
|
-
element.parentNode.removeChild(element);
|
1601
|
-
return element;
|
1602
|
-
},
|
1603
|
-
|
1604
|
-
update: function(element, content) {
|
1605
|
-
element = $(element);
|
1606
|
-
if (content && content.toElement) content = content.toElement();
|
1607
|
-
if (Object.isElement(content)) return element.update().insert(content);
|
1608
|
-
content = Object.toHTML(content);
|
1609
|
-
element.innerHTML = content.stripScripts();
|
1610
|
-
content.evalScripts.bind(content).defer();
|
1611
|
-
return element;
|
1612
|
-
},
|
1613
|
-
|
1614
|
-
replace: function(element, content) {
|
1615
|
-
element = $(element);
|
1616
|
-
if (content && content.toElement) content = content.toElement();
|
1617
|
-
else if (!Object.isElement(content)) {
|
1618
|
-
content = Object.toHTML(content);
|
1619
|
-
var range = element.ownerDocument.createRange();
|
1620
|
-
range.selectNode(element);
|
1621
|
-
content.evalScripts.bind(content).defer();
|
1622
|
-
content = range.createContextualFragment(content.stripScripts());
|
1623
|
-
}
|
1624
|
-
element.parentNode.replaceChild(content, element);
|
1625
|
-
return element;
|
1626
|
-
},
|
1627
|
-
|
1628
|
-
insert: function(element, insertions) {
|
1629
|
-
element = $(element);
|
1630
|
-
|
1631
|
-
if (Object.isString(insertions) || Object.isNumber(insertions) ||
|
1632
|
-
Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
|
1633
|
-
insertions = {bottom:insertions};
|
1634
|
-
|
1635
|
-
var content, t, range;
|
1636
|
-
|
1637
|
-
for (position in insertions) {
|
1638
|
-
content = insertions[position];
|
1639
|
-
position = position.toLowerCase();
|
1640
|
-
t = Element._insertionTranslations[position];
|
1641
|
-
|
1642
|
-
if (content && content.toElement) content = content.toElement();
|
1643
|
-
if (Object.isElement(content)) {
|
1644
|
-
t.insert(element, content);
|
1645
|
-
continue;
|
1646
|
-
}
|
1647
|
-
|
1648
|
-
content = Object.toHTML(content);
|
1649
|
-
|
1650
|
-
range = element.ownerDocument.createRange();
|
1651
|
-
t.initializeRange(element, range);
|
1652
|
-
t.insert(element, range.createContextualFragment(content.stripScripts()));
|
1653
|
-
|
1654
|
-
content.evalScripts.bind(content).defer();
|
1655
|
-
}
|
1656
|
-
|
1657
|
-
return element;
|
1658
|
-
},
|
1659
|
-
|
1660
|
-
wrap: function(element, wrapper, attributes) {
|
1661
|
-
element = $(element);
|
1662
|
-
if (Object.isElement(wrapper))
|
1663
|
-
$(wrapper).writeAttribute(attributes || { });
|
1664
|
-
else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
|
1665
|
-
else wrapper = new Element('div', wrapper);
|
1666
|
-
if (element.parentNode)
|
1667
|
-
element.parentNode.replaceChild(wrapper, element);
|
1668
|
-
wrapper.appendChild(element);
|
1669
|
-
return wrapper;
|
1670
|
-
},
|
1671
|
-
|
1672
|
-
inspect: function(element) {
|
1673
|
-
element = $(element);
|
1674
|
-
var result = '<' + element.tagName.toLowerCase();
|
1675
|
-
$H({'id': 'id', 'className': 'class'}).each(function(pair) {
|
1676
|
-
var property = pair.first(), attribute = pair.last();
|
1677
|
-
var value = (element[property] || '').toString();
|
1678
|
-
if (value) result += ' ' + attribute + '=' + value.inspect(true);
|
1679
|
-
});
|
1680
|
-
return result + '>';
|
1681
|
-
},
|
1682
|
-
|
1683
|
-
recursivelyCollect: function(element, property) {
|
1684
|
-
element = $(element);
|
1685
|
-
var elements = [];
|
1686
|
-
while (element = element[property])
|
1687
|
-
if (element.nodeType == 1)
|
1688
|
-
elements.push(Element.extend(element));
|
1689
|
-
return elements;
|
1690
|
-
},
|
1691
|
-
|
1692
|
-
ancestors: function(element) {
|
1693
|
-
return $(element).recursivelyCollect('parentNode');
|
1694
|
-
},
|
1695
|
-
|
1696
|
-
descendants: function(element) {
|
1697
|
-
return $A($(element).getElementsByTagName('*')).each(Element.extend);
|
1698
|
-
},
|
1699
|
-
|
1700
|
-
firstDescendant: function(element) {
|
1701
|
-
element = $(element).firstChild;
|
1702
|
-
while (element && element.nodeType != 1) element = element.nextSibling;
|
1703
|
-
return $(element);
|
1704
|
-
},
|
1705
|
-
|
1706
|
-
immediateDescendants: function(element) {
|
1707
|
-
if (!(element = $(element).firstChild)) return [];
|
1708
|
-
while (element && element.nodeType != 1) element = element.nextSibling;
|
1709
|
-
if (element) return [element].concat($(element).nextSiblings());
|
1710
|
-
return [];
|
1711
|
-
},
|
1712
|
-
|
1713
|
-
previousSiblings: function(element) {
|
1714
|
-
return $(element).recursivelyCollect('previousSibling');
|
1715
|
-
},
|
1716
|
-
|
1717
|
-
nextSiblings: function(element) {
|
1718
|
-
return $(element).recursivelyCollect('nextSibling');
|
1719
|
-
},
|
1720
|
-
|
1721
|
-
siblings: function(element) {
|
1722
|
-
element = $(element);
|
1723
|
-
return element.previousSiblings().reverse().concat(element.nextSiblings());
|
1724
|
-
},
|
1725
|
-
|
1726
|
-
match: function(element, selector) {
|
1727
|
-
if (Object.isString(selector))
|
1728
|
-
selector = new Selector(selector);
|
1729
|
-
return selector.match($(element));
|
1730
|
-
},
|
1731
|
-
|
1732
|
-
up: function(element, expression, index) {
|
1733
|
-
element = $(element);
|
1734
|
-
if (arguments.length == 1) return $(element.parentNode);
|
1735
|
-
var ancestors = element.ancestors();
|
1736
|
-
return expression ? Selector.findElement(ancestors, expression, index) :
|
1737
|
-
ancestors[index || 0];
|
1738
|
-
},
|
1739
|
-
|
1740
|
-
down: function(element, expression, index) {
|
1741
|
-
element = $(element);
|
1742
|
-
if (arguments.length == 1) return element.firstDescendant();
|
1743
|
-
var descendants = element.descendants();
|
1744
|
-
return expression ? Selector.findElement(descendants, expression, index) :
|
1745
|
-
descendants[index || 0];
|
1746
|
-
},
|
1747
|
-
|
1748
|
-
previous: function(element, expression, index) {
|
1749
|
-
element = $(element);
|
1750
|
-
if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
|
1751
|
-
var previousSiblings = element.previousSiblings();
|
1752
|
-
return expression ? Selector.findElement(previousSiblings, expression, index) :
|
1753
|
-
previousSiblings[index || 0];
|
1754
|
-
},
|
1755
|
-
|
1756
|
-
next: function(element, expression, index) {
|
1757
|
-
element = $(element);
|
1758
|
-
if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
|
1759
|
-
var nextSiblings = element.nextSiblings();
|
1760
|
-
return expression ? Selector.findElement(nextSiblings, expression, index) :
|
1761
|
-
nextSiblings[index || 0];
|
1762
|
-
},
|
1763
|
-
|
1764
|
-
select: function() {
|
1765
|
-
var args = $A(arguments), element = $(args.shift());
|
1766
|
-
return Selector.findChildElements(element, args);
|
1767
|
-
},
|
1768
|
-
|
1769
|
-
adjacent: function() {
|
1770
|
-
var args = $A(arguments), element = $(args.shift());
|
1771
|
-
return Selector.findChildElements(element.parentNode, args).without(element);
|
1772
|
-
},
|
1773
|
-
|
1774
|
-
identify: function(element) {
|
1775
|
-
element = $(element);
|
1776
|
-
var id = element.readAttribute('id'), self = arguments.callee;
|
1777
|
-
if (id) return id;
|
1778
|
-
do { id = 'anonymous_element_' + self.counter++ } while ($(id));
|
1779
|
-
element.writeAttribute('id', id);
|
1780
|
-
return id;
|
1781
|
-
},
|
1782
|
-
|
1783
|
-
readAttribute: function(element, name) {
|
1784
|
-
element = $(element);
|
1785
|
-
if (Prototype.Browser.IE) {
|
1786
|
-
var t = Element._attributeTranslations.read;
|
1787
|
-
if (t.values[name]) return t.values[name](element, name);
|
1788
|
-
if (t.names[name]) name = t.names[name];
|
1789
|
-
if (name.include(':')) {
|
1790
|
-
return (!element.attributes || !element.attributes[name]) ? null :
|
1791
|
-
element.attributes[name].value;
|
1792
|
-
}
|
1793
|
-
}
|
1794
|
-
return element.getAttribute(name);
|
1795
|
-
},
|
1796
|
-
|
1797
|
-
writeAttribute: function(element, name, value) {
|
1798
|
-
element = $(element);
|
1799
|
-
var attributes = { }, t = Element._attributeTranslations.write;
|
1800
|
-
|
1801
|
-
if (typeof name == 'object') attributes = name;
|
1802
|
-
else attributes[name] = value === undefined ? true : value;
|
1803
|
-
|
1804
|
-
for (var attr in attributes) {
|
1805
|
-
var name = t.names[attr] || attr, value = attributes[attr];
|
1806
|
-
if (t.values[attr]) name = t.values[attr](element, value);
|
1807
|
-
if (value === false || value === null)
|
1808
|
-
element.removeAttribute(name);
|
1809
|
-
else if (value === true)
|
1810
|
-
element.setAttribute(name, name);
|
1811
|
-
else element.setAttribute(name, value);
|
1812
|
-
}
|
1813
|
-
return element;
|
1814
|
-
},
|
1815
|
-
|
1816
|
-
getHeight: function(element) {
|
1817
|
-
return $(element).getDimensions().height;
|
1818
|
-
},
|
1819
|
-
|
1820
|
-
getWidth: function(element) {
|
1821
|
-
return $(element).getDimensions().width;
|
1822
|
-
},
|
1823
|
-
|
1824
|
-
classNames: function(element) {
|
1825
|
-
return new Element.ClassNames(element);
|
1826
|
-
},
|
1827
|
-
|
1828
|
-
hasClassName: function(element, className) {
|
1829
|
-
if (!(element = $(element))) return;
|
1830
|
-
var elementClassName = element.className;
|
1831
|
-
return (elementClassName.length > 0 && (elementClassName == className ||
|
1832
|
-
elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))));
|
1833
|
-
},
|
1834
|
-
|
1835
|
-
addClassName: function(element, className) {
|
1836
|
-
if (!(element = $(element))) return;
|
1837
|
-
if (!element.hasClassName(className))
|
1838
|
-
element.className += (element.className ? ' ' : '') + className;
|
1839
|
-
return element;
|
1840
|
-
},
|
1841
|
-
|
1842
|
-
removeClassName: function(element, className) {
|
1843
|
-
if (!(element = $(element))) return;
|
1844
|
-
element.className = element.className.replace(
|
1845
|
-
new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
|
1846
|
-
return element;
|
1847
|
-
},
|
1848
|
-
|
1849
|
-
toggleClassName: function(element, className) {
|
1850
|
-
if (!(element = $(element))) return;
|
1851
|
-
return element[element.hasClassName(className) ?
|
1852
|
-
'removeClassName' : 'addClassName'](className);
|
1853
|
-
},
|
1854
|
-
|
1855
|
-
// removes whitespace-only text node children
|
1856
|
-
cleanWhitespace: function(element) {
|
1857
|
-
element = $(element);
|
1858
|
-
var node = element.firstChild;
|
1859
|
-
while (node) {
|
1860
|
-
var nextNode = node.nextSibling;
|
1861
|
-
if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
|
1862
|
-
element.removeChild(node);
|
1863
|
-
node = nextNode;
|
1864
|
-
}
|
1865
|
-
return element;
|
1866
|
-
},
|
1867
|
-
|
1868
|
-
empty: function(element) {
|
1869
|
-
return $(element).innerHTML.blank();
|
1870
|
-
},
|
1871
|
-
|
1872
|
-
descendantOf: function(element, ancestor) {
|
1873
|
-
element = $(element), ancestor = $(ancestor);
|
1874
|
-
while (element = element.parentNode)
|
1875
|
-
if (element == ancestor) return true;
|
1876
|
-
return false;
|
1877
|
-
},
|
1878
|
-
|
1879
|
-
scrollTo: function(element) {
|
1880
|
-
element = $(element);
|
1881
|
-
var pos = element.cumulativeOffset();
|
1882
|
-
window.scrollTo(pos[0], pos[1]);
|
1883
|
-
return element;
|
1884
|
-
},
|
1885
|
-
|
1886
|
-
getStyle: function(element, style) {
|
1887
|
-
element = $(element);
|
1888
|
-
style = style == 'float' ? 'cssFloat' : style.camelize();
|
1889
|
-
var value = element.style[style];
|
1890
|
-
if (!value) {
|
1891
|
-
var css = document.defaultView.getComputedStyle(element, null);
|
1892
|
-
value = css ? css[style] : null;
|
1893
|
-
}
|
1894
|
-
if (style == 'opacity') return value ? parseFloat(value) : 1.0;
|
1895
|
-
return value == 'auto' ? null : value;
|
1896
|
-
},
|
1897
|
-
|
1898
|
-
getOpacity: function(element) {
|
1899
|
-
return $(element).getStyle('opacity');
|
1900
|
-
},
|
1901
|
-
|
1902
|
-
setStyle: function(element, styles) {
|
1903
|
-
element = $(element);
|
1904
|
-
var elementStyle = element.style, match;
|
1905
|
-
if (Object.isString(styles)) {
|
1906
|
-
element.style.cssText += ';' + styles;
|
1907
|
-
return styles.include('opacity') ?
|
1908
|
-
element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
|
1909
|
-
}
|
1910
|
-
for (var property in styles)
|
1911
|
-
if (property == 'opacity') element.setOpacity(styles[property]);
|
1912
|
-
else
|
1913
|
-
elementStyle[(property == 'float' || property == 'cssFloat') ?
|
1914
|
-
(elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
|
1915
|
-
property] = styles[property];
|
1916
|
-
|
1917
|
-
return element;
|
1918
|
-
},
|
1919
|
-
|
1920
|
-
setOpacity: function(element, value) {
|
1921
|
-
element = $(element);
|
1922
|
-
element.style.opacity = (value == 1 || value === '') ? '' :
|
1923
|
-
(value < 0.00001) ? 0 : value;
|
1924
|
-
return element;
|
1925
|
-
},
|
1926
|
-
|
1927
|
-
getDimensions: function(element) {
|
1928
|
-
element = $(element);
|
1929
|
-
var display = $(element).getStyle('display');
|
1930
|
-
if (display != 'none' && display != null) // Safari bug
|
1931
|
-
return {width: element.offsetWidth, height: element.offsetHeight};
|
1932
|
-
|
1933
|
-
// All *Width and *Height properties give 0 on elements with display none,
|
1934
|
-
// so enable the element temporarily
|
1935
|
-
var els = element.style;
|
1936
|
-
var originalVisibility = els.visibility;
|
1937
|
-
var originalPosition = els.position;
|
1938
|
-
var originalDisplay = els.display;
|
1939
|
-
els.visibility = 'hidden';
|
1940
|
-
els.position = 'absolute';
|
1941
|
-
els.display = 'block';
|
1942
|
-
var originalWidth = element.clientWidth;
|
1943
|
-
var originalHeight = element.clientHeight;
|
1944
|
-
els.display = originalDisplay;
|
1945
|
-
els.position = originalPosition;
|
1946
|
-
els.visibility = originalVisibility;
|
1947
|
-
return {width: originalWidth, height: originalHeight};
|
1948
|
-
},
|
1949
|
-
|
1950
|
-
makePositioned: function(element) {
|
1951
|
-
element = $(element);
|
1952
|
-
var pos = Element.getStyle(element, 'position');
|
1953
|
-
if (pos == 'static' || !pos) {
|
1954
|
-
element._madePositioned = true;
|
1955
|
-
element.style.position = 'relative';
|
1956
|
-
// Opera returns the offset relative to the positioning context, when an
|
1957
|
-
// element is position relative but top and left have not been defined
|
1958
|
-
if (window.opera) {
|
1959
|
-
element.style.top = 0;
|
1960
|
-
element.style.left = 0;
|
1961
|
-
}
|
1962
|
-
}
|
1963
|
-
return element;
|
1964
|
-
},
|
1965
|
-
|
1966
|
-
undoPositioned: function(element) {
|
1967
|
-
element = $(element);
|
1968
|
-
if (element._madePositioned) {
|
1969
|
-
element._madePositioned = undefined;
|
1970
|
-
element.style.position =
|
1971
|
-
element.style.top =
|
1972
|
-
element.style.left =
|
1973
|
-
element.style.bottom =
|
1974
|
-
element.style.right = '';
|
1975
|
-
}
|
1976
|
-
return element;
|
1977
|
-
},
|
1978
|
-
|
1979
|
-
makeClipping: function(element) {
|
1980
|
-
element = $(element);
|
1981
|
-
if (element._overflow) return element;
|
1982
|
-
element._overflow = element.style.overflow || 'auto';
|
1983
|
-
if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
|
1984
|
-
element.style.overflow = 'hidden';
|
1985
|
-
return element;
|
1986
|
-
},
|
1987
|
-
|
1988
|
-
undoClipping: function(element) {
|
1989
|
-
element = $(element);
|
1990
|
-
if (!element._overflow) return element;
|
1991
|
-
element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
|
1992
|
-
element._overflow = null;
|
1993
|
-
return element;
|
1994
|
-
},
|
1995
|
-
|
1996
|
-
cumulativeOffset: function(element) {
|
1997
|
-
var valueT = 0, valueL = 0;
|
1998
|
-
do {
|
1999
|
-
valueT += element.offsetTop || 0;
|
2000
|
-
valueL += element.offsetLeft || 0;
|
2001
|
-
element = element.offsetParent;
|
2002
|
-
} while (element);
|
2003
|
-
return Element._returnOffset(valueL, valueT);
|
2004
|
-
},
|
2005
|
-
|
2006
|
-
positionedOffset: function(element) {
|
2007
|
-
var valueT = 0, valueL = 0;
|
2008
|
-
do {
|
2009
|
-
valueT += element.offsetTop || 0;
|
2010
|
-
valueL += element.offsetLeft || 0;
|
2011
|
-
element = element.offsetParent;
|
2012
|
-
if (element) {
|
2013
|
-
if (element.tagName == 'BODY') break;
|
2014
|
-
var p = Element.getStyle(element, 'position');
|
2015
|
-
if (p == 'relative' || p == 'absolute') break;
|
2016
|
-
}
|
2017
|
-
} while (element);
|
2018
|
-
return Element._returnOffset(valueL, valueT);
|
2019
|
-
},
|
2020
|
-
|
2021
|
-
absolutize: function(element) {
|
2022
|
-
element = $(element);
|
2023
|
-
if (element.getStyle('position') == 'absolute') return;
|
2024
|
-
// Position.prepare(); // To be done manually by Scripty when it needs it.
|
2025
|
-
|
2026
|
-
var offsets = element.positionedOffset();
|
2027
|
-
var top = offsets[1];
|
2028
|
-
var left = offsets[0];
|
2029
|
-
var width = element.clientWidth;
|
2030
|
-
var height = element.clientHeight;
|
2031
|
-
|
2032
|
-
element._originalLeft = left - parseFloat(element.style.left || 0);
|
2033
|
-
element._originalTop = top - parseFloat(element.style.top || 0);
|
2034
|
-
element._originalWidth = element.style.width;
|
2035
|
-
element._originalHeight = element.style.height;
|
2036
|
-
|
2037
|
-
element.style.position = 'absolute';
|
2038
|
-
element.style.top = top + 'px';
|
2039
|
-
element.style.left = left + 'px';
|
2040
|
-
element.style.width = width + 'px';
|
2041
|
-
element.style.height = height + 'px';
|
2042
|
-
return element;
|
2043
|
-
},
|
2044
|
-
|
2045
|
-
relativize: function(element) {
|
2046
|
-
element = $(element);
|
2047
|
-
if (element.getStyle('position') == 'relative') return;
|
2048
|
-
// Position.prepare(); // To be done manually by Scripty when it needs it.
|
2049
|
-
|
2050
|
-
element.style.position = 'relative';
|
2051
|
-
var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
|
2052
|
-
var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
|
2053
|
-
|
2054
|
-
element.style.top = top + 'px';
|
2055
|
-
element.style.left = left + 'px';
|
2056
|
-
element.style.height = element._originalHeight;
|
2057
|
-
element.style.width = element._originalWidth;
|
2058
|
-
return element;
|
2059
|
-
},
|
2060
|
-
|
2061
|
-
cumulativeScrollOffset: function(element) {
|
2062
|
-
var valueT = 0, valueL = 0;
|
2063
|
-
do {
|
2064
|
-
valueT += element.scrollTop || 0;
|
2065
|
-
valueL += element.scrollLeft || 0;
|
2066
|
-
element = element.parentNode;
|
2067
|
-
} while (element);
|
2068
|
-
return Element._returnOffset(valueL, valueT);
|
2069
|
-
},
|
2070
|
-
|
2071
|
-
getOffsetParent: function(element) {
|
2072
|
-
if (element.offsetParent) return $(element.offsetParent);
|
2073
|
-
if (element == document.body) return $(element);
|
2074
|
-
|
2075
|
-
while ((element = element.parentNode) && element != document.body)
|
2076
|
-
if (Element.getStyle(element, 'position') != 'static')
|
2077
|
-
return $(element);
|
2078
|
-
|
2079
|
-
return $(document.body);
|
2080
|
-
},
|
2081
|
-
|
2082
|
-
viewportOffset: function(forElement) {
|
2083
|
-
var valueT = 0, valueL = 0;
|
2084
|
-
|
2085
|
-
var element = forElement;
|
2086
|
-
do {
|
2087
|
-
valueT += element.offsetTop || 0;
|
2088
|
-
valueL += element.offsetLeft || 0;
|
2089
|
-
|
2090
|
-
// Safari fix
|
2091
|
-
if (element.offsetParent == document.body &&
|
2092
|
-
Element.getStyle(element, 'position') == 'absolute') break;
|
2093
|
-
|
2094
|
-
} while (element = element.offsetParent);
|
2095
|
-
|
2096
|
-
element = forElement;
|
2097
|
-
do {
|
2098
|
-
if (!Prototype.Browser.Opera || element.tagName == 'BODY') {
|
2099
|
-
valueT -= element.scrollTop || 0;
|
2100
|
-
valueL -= element.scrollLeft || 0;
|
2101
|
-
}
|
2102
|
-
} while (element = element.parentNode);
|
2103
|
-
|
2104
|
-
return Element._returnOffset(valueL, valueT);
|
2105
|
-
},
|
2106
|
-
|
2107
|
-
clonePosition: function(element, source) {
|
2108
|
-
var options = Object.extend({
|
2109
|
-
setLeft: true,
|
2110
|
-
setTop: true,
|
2111
|
-
setWidth: true,
|
2112
|
-
setHeight: true,
|
2113
|
-
offsetTop: 0,
|
2114
|
-
offsetLeft: 0
|
2115
|
-
}, arguments[2] || { });
|
2116
|
-
|
2117
|
-
// find page position of source
|
2118
|
-
source = $(source);
|
2119
|
-
var p = source.viewportOffset();
|
2120
|
-
|
2121
|
-
// find coordinate system to use
|
2122
|
-
element = $(element);
|
2123
|
-
var delta = [0, 0];
|
2124
|
-
var parent = null;
|
2125
|
-
// delta [0,0] will do fine with position: fixed elements,
|
2126
|
-
// position:absolute needs offsetParent deltas
|
2127
|
-
if (Element.getStyle(element, 'position') == 'absolute') {
|
2128
|
-
parent = element.getOffsetParent();
|
2129
|
-
delta = parent.viewportOffset();
|
2130
|
-
}
|
2131
|
-
|
2132
|
-
// correct by body offsets (fixes Safari)
|
2133
|
-
if (parent == document.body) {
|
2134
|
-
delta[0] -= document.body.offsetLeft;
|
2135
|
-
delta[1] -= document.body.offsetTop;
|
2136
|
-
}
|
2137
|
-
|
2138
|
-
// set position
|
2139
|
-
if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
|
2140
|
-
if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
|
2141
|
-
if (options.setWidth) element.style.width = source.offsetWidth + 'px';
|
2142
|
-
if (options.setHeight) element.style.height = source.offsetHeight + 'px';
|
2143
|
-
return element;
|
2144
|
-
}
|
2145
|
-
};
|
2146
|
-
|
2147
|
-
Element.Methods.identify.counter = 1;
|
2148
|
-
|
2149
|
-
Object.extend(Element.Methods, {
|
2150
|
-
getElementsBySelector: Element.Methods.select,
|
2151
|
-
childElements: Element.Methods.immediateDescendants
|
2152
|
-
});
|
2153
|
-
|
2154
|
-
Element._attributeTranslations = {
|
2155
|
-
write: {
|
2156
|
-
names: {
|
2157
|
-
className: 'class',
|
2158
|
-
htmlFor: 'for'
|
2159
|
-
},
|
2160
|
-
values: { }
|
2161
|
-
}
|
2162
|
-
};
|
2163
|
-
|
2164
|
-
|
2165
|
-
if (!document.createRange || Prototype.Browser.Opera) {
|
2166
|
-
Element.Methods.insert = function(element, insertions) {
|
2167
|
-
element = $(element);
|
2168
|
-
|
2169
|
-
if (Object.isString(insertions) || Object.isNumber(insertions) ||
|
2170
|
-
Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
|
2171
|
-
insertions = { bottom: insertions };
|
2172
|
-
|
2173
|
-
var t = Element._insertionTranslations, content, position, pos, tagName;
|
2174
|
-
|
2175
|
-
for (position in insertions) {
|
2176
|
-
content = insertions[position];
|
2177
|
-
position = position.toLowerCase();
|
2178
|
-
pos = t[position];
|
2179
|
-
|
2180
|
-
if (content && content.toElement) content = content.toElement();
|
2181
|
-
if (Object.isElement(content)) {
|
2182
|
-
pos.insert(element, content);
|
2183
|
-
continue;
|
2184
|
-
}
|
2185
|
-
|
2186
|
-
content = Object.toHTML(content);
|
2187
|
-
tagName = ((position == 'before' || position == 'after')
|
2188
|
-
? element.parentNode : element).tagName.toUpperCase();
|
2189
|
-
|
2190
|
-
if (t.tags[tagName]) {
|
2191
|
-
var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
|
2192
|
-
if (position == 'top' || position == 'after') fragments.reverse();
|
2193
|
-
fragments.each(pos.insert.curry(element));
|
2194
|
-
}
|
2195
|
-
else element.insertAdjacentHTML(pos.adjacency, content.stripScripts());
|
2196
|
-
|
2197
|
-
content.evalScripts.bind(content).defer();
|
2198
|
-
}
|
2199
|
-
|
2200
|
-
return element;
|
2201
|
-
};
|
2202
|
-
}
|
2203
|
-
|
2204
|
-
if (Prototype.Browser.Opera) {
|
2205
|
-
Element.Methods._getStyle = Element.Methods.getStyle;
|
2206
|
-
Element.Methods.getStyle = function(element, style) {
|
2207
|
-
switch(style) {
|
2208
|
-
case 'left':
|
2209
|
-
case 'top':
|
2210
|
-
case 'right':
|
2211
|
-
case 'bottom':
|
2212
|
-
if (Element._getStyle(element, 'position') == 'static') return null;
|
2213
|
-
default: return Element._getStyle(element, style);
|
2214
|
-
}
|
2215
|
-
};
|
2216
|
-
Element.Methods._readAttribute = Element.Methods.readAttribute;
|
2217
|
-
Element.Methods.readAttribute = function(element, attribute) {
|
2218
|
-
if (attribute == 'title') return element.title;
|
2219
|
-
return Element._readAttribute(element, attribute);
|
2220
|
-
};
|
2221
|
-
}
|
2222
|
-
|
2223
|
-
else if (Prototype.Browser.IE) {
|
2224
|
-
$w('positionedOffset getOffsetParent viewportOffset').each(function(method) {
|
2225
|
-
Element.Methods[method] = Element.Methods[method].wrap(
|
2226
|
-
function(proceed, element) {
|
2227
|
-
element = $(element);
|
2228
|
-
var position = element.getStyle('position');
|
2229
|
-
if (position != 'static') return proceed(element);
|
2230
|
-
element.setStyle({ position: 'relative' });
|
2231
|
-
var value = proceed(element);
|
2232
|
-
element.setStyle({ position: position });
|
2233
|
-
return value;
|
2234
|
-
}
|
2235
|
-
);
|
2236
|
-
});
|
2237
|
-
|
2238
|
-
Element.Methods.getStyle = function(element, style) {
|
2239
|
-
element = $(element);
|
2240
|
-
style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
|
2241
|
-
var value = element.style[style];
|
2242
|
-
if (!value && element.currentStyle) value = element.currentStyle[style];
|
2243
|
-
|
2244
|
-
if (style == 'opacity') {
|
2245
|
-
if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
|
2246
|
-
if (value[1]) return parseFloat(value[1]) / 100;
|
2247
|
-
return 1.0;
|
2248
|
-
}
|
2249
|
-
|
2250
|
-
if (value == 'auto') {
|
2251
|
-
if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
|
2252
|
-
return element['offset' + style.capitalize()] + 'px';
|
2253
|
-
return null;
|
2254
|
-
}
|
2255
|
-
return value;
|
2256
|
-
};
|
2257
|
-
|
2258
|
-
Element.Methods.setOpacity = function(element, value) {
|
2259
|
-
function stripAlpha(filter){
|
2260
|
-
return filter.replace(/alpha\([^\)]*\)/gi,'');
|
2261
|
-
}
|
2262
|
-
element = $(element);
|
2263
|
-
if (!element.currentStyle.hasLayout) element.style.zoom = 1;
|
2264
|
-
var filter = element.getStyle('filter'), style = element.style;
|
2265
|
-
if (value == 1 || value === '') {
|
2266
|
-
(filter = stripAlpha(filter)) ?
|
2267
|
-
style.filter = filter : style.removeAttribute('filter');
|
2268
|
-
return element;
|
2269
|
-
} else if (value < 0.00001) value = 0;
|
2270
|
-
style.filter = stripAlpha(filter) +
|
2271
|
-
'alpha(opacity=' + (value * 100) + ')';
|
2272
|
-
return element;
|
2273
|
-
};
|
2274
|
-
|
2275
|
-
Element._attributeTranslations = {
|
2276
|
-
read: {
|
2277
|
-
names: {
|
2278
|
-
'class': 'className',
|
2279
|
-
'for': 'htmlFor'
|
2280
|
-
},
|
2281
|
-
values: {
|
2282
|
-
_getAttr: function(element, attribute) {
|
2283
|
-
return element.getAttribute(attribute, 2);
|
2284
|
-
},
|
2285
|
-
_getAttrNode: function(element, attribute) {
|
2286
|
-
var node = element.getAttributeNode(attribute);
|
2287
|
-
return node ? node.value : "";
|
2288
|
-
},
|
2289
|
-
_getEv: function(element, attribute) {
|
2290
|
-
var attribute = element.getAttribute(attribute);
|
2291
|
-
return attribute ? attribute.toString().slice(23, -2) : null;
|
2292
|
-
},
|
2293
|
-
_flag: function(element, attribute) {
|
2294
|
-
return $(element).hasAttribute(attribute) ? attribute : null;
|
2295
|
-
},
|
2296
|
-
style: function(element) {
|
2297
|
-
return element.style.cssText.toLowerCase();
|
2298
|
-
},
|
2299
|
-
title: function(element) {
|
2300
|
-
return element.title;
|
2301
|
-
}
|
2302
|
-
}
|
2303
|
-
}
|
2304
|
-
};
|
2305
|
-
|
2306
|
-
Element._attributeTranslations.write = {
|
2307
|
-
names: Object.clone(Element._attributeTranslations.read.names),
|
2308
|
-
values: {
|
2309
|
-
checked: function(element, value) {
|
2310
|
-
element.checked = !!value;
|
2311
|
-
},
|
2312
|
-
|
2313
|
-
style: function(element, value) {
|
2314
|
-
element.style.cssText = value ? value : '';
|
2315
|
-
}
|
2316
|
-
}
|
2317
|
-
};
|
2318
|
-
|
2319
|
-
Element._attributeTranslations.has = {};
|
2320
|
-
|
2321
|
-
$w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
|
2322
|
-
'encType maxLength readOnly longDesc').each(function(attr) {
|
2323
|
-
Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
|
2324
|
-
Element._attributeTranslations.has[attr.toLowerCase()] = attr;
|
2325
|
-
});
|
2326
|
-
|
2327
|
-
(function(v) {
|
2328
|
-
Object.extend(v, {
|
2329
|
-
href: v._getAttr,
|
2330
|
-
src: v._getAttr,
|
2331
|
-
type: v._getAttr,
|
2332
|
-
action: v._getAttrNode,
|
2333
|
-
disabled: v._flag,
|
2334
|
-
checked: v._flag,
|
2335
|
-
readonly: v._flag,
|
2336
|
-
multiple: v._flag,
|
2337
|
-
onload: v._getEv,
|
2338
|
-
onunload: v._getEv,
|
2339
|
-
onclick: v._getEv,
|
2340
|
-
ondblclick: v._getEv,
|
2341
|
-
onmousedown: v._getEv,
|
2342
|
-
onmouseup: v._getEv,
|
2343
|
-
onmouseover: v._getEv,
|
2344
|
-
onmousemove: v._getEv,
|
2345
|
-
onmouseout: v._getEv,
|
2346
|
-
onfocus: v._getEv,
|
2347
|
-
onblur: v._getEv,
|
2348
|
-
onkeypress: v._getEv,
|
2349
|
-
onkeydown: v._getEv,
|
2350
|
-
onkeyup: v._getEv,
|
2351
|
-
onsubmit: v._getEv,
|
2352
|
-
onreset: v._getEv,
|
2353
|
-
onselect: v._getEv,
|
2354
|
-
onchange: v._getEv
|
2355
|
-
});
|
2356
|
-
})(Element._attributeTranslations.read.values);
|
2357
|
-
}
|
2358
|
-
|
2359
|
-
else if (Prototype.Browser.Gecko) {
|
2360
|
-
Element.Methods.setOpacity = function(element, value) {
|
2361
|
-
element = $(element);
|
2362
|
-
element.style.opacity = (value == 1) ? 0.999999 :
|
2363
|
-
(value === '') ? '' : (value < 0.00001) ? 0 : value;
|
2364
|
-
return element;
|
2365
|
-
};
|
2366
|
-
}
|
2367
|
-
|
2368
|
-
else if (Prototype.Browser.WebKit) {
|
2369
|
-
Element.Methods.setOpacity = function(element, value) {
|
2370
|
-
element = $(element);
|
2371
|
-
element.style.opacity = (value == 1 || value === '') ? '' :
|
2372
|
-
(value < 0.00001) ? 0 : value;
|
2373
|
-
|
2374
|
-
if (value == 1)
|
2375
|
-
if(element.tagName == 'IMG' && element.width) {
|
2376
|
-
element.width++; element.width--;
|
2377
|
-
} else try {
|
2378
|
-
var n = document.createTextNode(' ');
|
2379
|
-
element.appendChild(n);
|
2380
|
-
element.removeChild(n);
|
2381
|
-
} catch (e) { }
|
2382
|
-
|
2383
|
-
return element;
|
2384
|
-
};
|
2385
|
-
|
2386
|
-
// Safari returns margins on body which is incorrect if the child is absolutely
|
2387
|
-
// positioned. For performance reasons, redefine Position.cumulativeOffset for
|
2388
|
-
// KHTML/WebKit only.
|
2389
|
-
Element.Methods.cumulativeOffset = function(element) {
|
2390
|
-
var valueT = 0, valueL = 0;
|
2391
|
-
do {
|
2392
|
-
valueT += element.offsetTop || 0;
|
2393
|
-
valueL += element.offsetLeft || 0;
|
2394
|
-
if (element.offsetParent == document.body)
|
2395
|
-
if (Element.getStyle(element, 'position') == 'absolute') break;
|
2396
|
-
|
2397
|
-
element = element.offsetParent;
|
2398
|
-
} while (element);
|
2399
|
-
|
2400
|
-
return Element._returnOffset(valueL, valueT);
|
2401
|
-
};
|
2402
|
-
}
|
2403
|
-
|
2404
|
-
if (Prototype.Browser.IE || Prototype.Browser.Opera) {
|
2405
|
-
// IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
|
2406
|
-
Element.Methods.update = function(element, content) {
|
2407
|
-
element = $(element);
|
2408
|
-
|
2409
|
-
if (content && content.toElement) content = content.toElement();
|
2410
|
-
if (Object.isElement(content)) return element.update().insert(content);
|
2411
|
-
|
2412
|
-
content = Object.toHTML(content);
|
2413
|
-
var tagName = element.tagName.toUpperCase();
|
2414
|
-
|
2415
|
-
if (tagName in Element._insertionTranslations.tags) {
|
2416
|
-
$A(element.childNodes).each(function(node) { element.removeChild(node) });
|
2417
|
-
Element._getContentFromAnonymousElement(tagName, content.stripScripts())
|
2418
|
-
.each(function(node) { element.appendChild(node) });
|
2419
|
-
}
|
2420
|
-
else element.innerHTML = content.stripScripts();
|
2421
|
-
|
2422
|
-
content.evalScripts.bind(content).defer();
|
2423
|
-
return element;
|
2424
|
-
};
|
2425
|
-
}
|
2426
|
-
|
2427
|
-
if (document.createElement('div').outerHTML) {
|
2428
|
-
Element.Methods.replace = function(element, content) {
|
2429
|
-
element = $(element);
|
2430
|
-
|
2431
|
-
if (content && content.toElement) content = content.toElement();
|
2432
|
-
if (Object.isElement(content)) {
|
2433
|
-
element.parentNode.replaceChild(content, element);
|
2434
|
-
return element;
|
2435
|
-
}
|
2436
|
-
|
2437
|
-
content = Object.toHTML(content);
|
2438
|
-
var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
|
2439
|
-
|
2440
|
-
if (Element._insertionTranslations.tags[tagName]) {
|
2441
|
-
var nextSibling = element.next();
|
2442
|
-
var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
|
2443
|
-
parent.removeChild(element);
|
2444
|
-
if (nextSibling)
|
2445
|
-
fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
|
2446
|
-
else
|
2447
|
-
fragments.each(function(node) { parent.appendChild(node) });
|
2448
|
-
}
|
2449
|
-
else element.outerHTML = content.stripScripts();
|
2450
|
-
|
2451
|
-
content.evalScripts.bind(content).defer();
|
2452
|
-
return element;
|
2453
|
-
};
|
2454
|
-
}
|
2455
|
-
|
2456
|
-
Element._returnOffset = function(l, t) {
|
2457
|
-
var result = [l, t];
|
2458
|
-
result.left = l;
|
2459
|
-
result.top = t;
|
2460
|
-
return result;
|
2461
|
-
};
|
2462
|
-
|
2463
|
-
Element._getContentFromAnonymousElement = function(tagName, html) {
|
2464
|
-
var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
|
2465
|
-
div.innerHTML = t[0] + html + t[1];
|
2466
|
-
t[2].times(function() { div = div.firstChild });
|
2467
|
-
return $A(div.childNodes);
|
2468
|
-
};
|
2469
|
-
|
2470
|
-
Element._insertionTranslations = {
|
2471
|
-
before: {
|
2472
|
-
adjacency: 'beforeBegin',
|
2473
|
-
insert: function(element, node) {
|
2474
|
-
element.parentNode.insertBefore(node, element);
|
2475
|
-
},
|
2476
|
-
initializeRange: function(element, range) {
|
2477
|
-
range.setStartBefore(element);
|
2478
|
-
}
|
2479
|
-
},
|
2480
|
-
top: {
|
2481
|
-
adjacency: 'afterBegin',
|
2482
|
-
insert: function(element, node) {
|
2483
|
-
element.insertBefore(node, element.firstChild);
|
2484
|
-
},
|
2485
|
-
initializeRange: function(element, range) {
|
2486
|
-
range.selectNodeContents(element);
|
2487
|
-
range.collapse(true);
|
2488
|
-
}
|
2489
|
-
},
|
2490
|
-
bottom: {
|
2491
|
-
adjacency: 'beforeEnd',
|
2492
|
-
insert: function(element, node) {
|
2493
|
-
element.appendChild(node);
|
2494
|
-
}
|
2495
|
-
},
|
2496
|
-
after: {
|
2497
|
-
adjacency: 'afterEnd',
|
2498
|
-
insert: function(element, node) {
|
2499
|
-
element.parentNode.insertBefore(node, element.nextSibling);
|
2500
|
-
},
|
2501
|
-
initializeRange: function(element, range) {
|
2502
|
-
range.setStartAfter(element);
|
2503
|
-
}
|
2504
|
-
},
|
2505
|
-
tags: {
|
2506
|
-
TABLE: ['<table>', '</table>', 1],
|
2507
|
-
TBODY: ['<table><tbody>', '</tbody></table>', 2],
|
2508
|
-
TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
|
2509
|
-
TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
|
2510
|
-
SELECT: ['<select>', '</select>', 1]
|
2511
|
-
}
|
2512
|
-
};
|
2513
|
-
|
2514
|
-
(function() {
|
2515
|
-
this.bottom.initializeRange = this.top.initializeRange;
|
2516
|
-
Object.extend(this.tags, {
|
2517
|
-
THEAD: this.tags.TBODY,
|
2518
|
-
TFOOT: this.tags.TBODY,
|
2519
|
-
TH: this.tags.TD
|
2520
|
-
});
|
2521
|
-
}).call(Element._insertionTranslations);
|
2522
|
-
|
2523
|
-
Element.Methods.Simulated = {
|
2524
|
-
hasAttribute: function(element, attribute) {
|
2525
|
-
attribute = Element._attributeTranslations.has[attribute] || attribute;
|
2526
|
-
var node = $(element).getAttributeNode(attribute);
|
2527
|
-
return node && node.specified;
|
2528
|
-
}
|
2529
|
-
};
|
2530
|
-
|
2531
|
-
Element.Methods.ByTag = { };
|
2532
|
-
|
2533
|
-
Object.extend(Element, Element.Methods);
|
2534
|
-
|
2535
|
-
if (!Prototype.BrowserFeatures.ElementExtensions &&
|
2536
|
-
document.createElement('div').__proto__) {
|
2537
|
-
window.HTMLElement = { };
|
2538
|
-
window.HTMLElement.prototype = document.createElement('div').__proto__;
|
2539
|
-
Prototype.BrowserFeatures.ElementExtensions = true;
|
2540
|
-
}
|
2541
|
-
|
2542
|
-
Element.extend = (function() {
|
2543
|
-
if (Prototype.BrowserFeatures.SpecificElementExtensions)
|
2544
|
-
return Prototype.K;
|
2545
|
-
|
2546
|
-
var Methods = { }, ByTag = Element.Methods.ByTag;
|
2547
|
-
|
2548
|
-
var extend = Object.extend(function(element) {
|
2549
|
-
if (!element || element._extendedByPrototype ||
|
2550
|
-
element.nodeType != 1 || element == window) return element;
|
2551
|
-
|
2552
|
-
var methods = Object.clone(Methods),
|
2553
|
-
tagName = element.tagName, property, value;
|
2554
|
-
|
2555
|
-
// extend methods for specific tags
|
2556
|
-
if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
|
2557
|
-
|
2558
|
-
for (property in methods) {
|
2559
|
-
value = methods[property];
|
2560
|
-
if (Object.isFunction(value) && !(property in element))
|
2561
|
-
element[property] = value.methodize();
|
2562
|
-
}
|
2563
|
-
|
2564
|
-
element._extendedByPrototype = Prototype.emptyFunction;
|
2565
|
-
return element;
|
2566
|
-
|
2567
|
-
}, {
|
2568
|
-
refresh: function() {
|
2569
|
-
// extend methods for all tags (Safari doesn't need this)
|
2570
|
-
if (!Prototype.BrowserFeatures.ElementExtensions) {
|
2571
|
-
Object.extend(Methods, Element.Methods);
|
2572
|
-
Object.extend(Methods, Element.Methods.Simulated);
|
2573
|
-
}
|
2574
|
-
}
|
2575
|
-
});
|
2576
|
-
|
2577
|
-
extend.refresh();
|
2578
|
-
return extend;
|
2579
|
-
})();
|
2580
|
-
|
2581
|
-
Element.hasAttribute = function(element, attribute) {
|
2582
|
-
if (element.hasAttribute) return element.hasAttribute(attribute);
|
2583
|
-
return Element.Methods.Simulated.hasAttribute(element, attribute);
|
2584
|
-
};
|
2585
|
-
|
2586
|
-
Element.addMethods = function(methods) {
|
2587
|
-
var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
|
2588
|
-
|
2589
|
-
if (!methods) {
|
2590
|
-
Object.extend(Form, Form.Methods);
|
2591
|
-
Object.extend(Form.Element, Form.Element.Methods);
|
2592
|
-
Object.extend(Element.Methods.ByTag, {
|
2593
|
-
"FORM": Object.clone(Form.Methods),
|
2594
|
-
"INPUT": Object.clone(Form.Element.Methods),
|
2595
|
-
"SELECT": Object.clone(Form.Element.Methods),
|
2596
|
-
"TEXTAREA": Object.clone(Form.Element.Methods)
|
2597
|
-
});
|
2598
|
-
}
|
2599
|
-
|
2600
|
-
if (arguments.length == 2) {
|
2601
|
-
var tagName = methods;
|
2602
|
-
methods = arguments[1];
|
2603
|
-
}
|
2604
|
-
|
2605
|
-
if (!tagName) Object.extend(Element.Methods, methods || { });
|
2606
|
-
else {
|
2607
|
-
if (Object.isArray(tagName)) tagName.each(extend);
|
2608
|
-
else extend(tagName);
|
2609
|
-
}
|
2610
|
-
|
2611
|
-
function extend(tagName) {
|
2612
|
-
tagName = tagName.toUpperCase();
|
2613
|
-
if (!Element.Methods.ByTag[tagName])
|
2614
|
-
Element.Methods.ByTag[tagName] = { };
|
2615
|
-
Object.extend(Element.Methods.ByTag[tagName], methods);
|
2616
|
-
}
|
2617
|
-
|
2618
|
-
function copy(methods, destination, onlyIfAbsent) {
|
2619
|
-
onlyIfAbsent = onlyIfAbsent || false;
|
2620
|
-
for (var property in methods) {
|
2621
|
-
var value = methods[property];
|
2622
|
-
if (!Object.isFunction(value)) continue;
|
2623
|
-
if (!onlyIfAbsent || !(property in destination))
|
2624
|
-
destination[property] = value.methodize();
|
2625
|
-
}
|
2626
|
-
}
|
2627
|
-
|
2628
|
-
function findDOMClass(tagName) {
|
2629
|
-
var klass;
|
2630
|
-
var trans = {
|
2631
|
-
"OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
|
2632
|
-
"FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
|
2633
|
-
"DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
|
2634
|
-
"H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
|
2635
|
-
"INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
|
2636
|
-
"TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
|
2637
|
-
"TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
|
2638
|
-
"TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
|
2639
|
-
"FrameSet", "IFRAME": "IFrame"
|
2640
|
-
};
|
2641
|
-
if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
|
2642
|
-
if (window[klass]) return window[klass];
|
2643
|
-
klass = 'HTML' + tagName + 'Element';
|
2644
|
-
if (window[klass]) return window[klass];
|
2645
|
-
klass = 'HTML' + tagName.capitalize() + 'Element';
|
2646
|
-
if (window[klass]) return window[klass];
|
2647
|
-
|
2648
|
-
window[klass] = { };
|
2649
|
-
window[klass].prototype = document.createElement(tagName).__proto__;
|
2650
|
-
return window[klass];
|
2651
|
-
}
|
2652
|
-
|
2653
|
-
if (F.ElementExtensions) {
|
2654
|
-
copy(Element.Methods, HTMLElement.prototype);
|
2655
|
-
copy(Element.Methods.Simulated, HTMLElement.prototype, true);
|
2656
|
-
}
|
2657
|
-
|
2658
|
-
if (F.SpecificElementExtensions) {
|
2659
|
-
for (var tag in Element.Methods.ByTag) {
|
2660
|
-
var klass = findDOMClass(tag);
|
2661
|
-
if (Object.isUndefined(klass)) continue;
|
2662
|
-
copy(T[tag], klass.prototype);
|
2663
|
-
}
|
2664
|
-
}
|
2665
|
-
|
2666
|
-
Object.extend(Element, Element.Methods);
|
2667
|
-
delete Element.ByTag;
|
2668
|
-
|
2669
|
-
if (Element.extend.refresh) Element.extend.refresh();
|
2670
|
-
Element.cache = { };
|
2671
|
-
};
|
2672
|
-
|
2673
|
-
document.viewport = {
|
2674
|
-
getDimensions: function() {
|
2675
|
-
var dimensions = { };
|
2676
|
-
$w('width height').each(function(d) {
|
2677
|
-
var D = d.capitalize();
|
2678
|
-
dimensions[d] = self['inner' + D] ||
|
2679
|
-
(document.documentElement['client' + D] || document.body['client' + D]);
|
2680
|
-
});
|
2681
|
-
return dimensions;
|
2682
|
-
},
|
2683
|
-
|
2684
|
-
getWidth: function() {
|
2685
|
-
return this.getDimensions().width;
|
2686
|
-
},
|
2687
|
-
|
2688
|
-
getHeight: function() {
|
2689
|
-
return this.getDimensions().height;
|
2690
|
-
},
|
2691
|
-
|
2692
|
-
getScrollOffsets: function() {
|
2693
|
-
return Element._returnOffset(
|
2694
|
-
window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
|
2695
|
-
window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
|
2696
|
-
}
|
2697
|
-
};
|
2698
|
-
/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
|
2699
|
-
* part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
|
2700
|
-
* license. Please see http://www.yui-ext.com/ for more information. */
|
2701
|
-
|
2702
|
-
var Selector = Class.create({
|
2703
|
-
initialize: function(expression) {
|
2704
|
-
this.expression = expression.strip();
|
2705
|
-
this.compileMatcher();
|
2706
|
-
},
|
2707
|
-
|
2708
|
-
compileMatcher: function() {
|
2709
|
-
// Selectors with namespaced attributes can't use the XPath version
|
2710
|
-
if (Prototype.BrowserFeatures.XPath && !(/\[[\w-]*?:/).test(this.expression))
|
2711
|
-
return this.compileXPathMatcher();
|
2712
|
-
|
2713
|
-
var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
|
2714
|
-
c = Selector.criteria, le, p, m;
|
2715
|
-
|
2716
|
-
if (Selector._cache[e]) {
|
2717
|
-
this.matcher = Selector._cache[e];
|
2718
|
-
return;
|
2719
|
-
}
|
2720
|
-
|
2721
|
-
this.matcher = ["this.matcher = function(root) {",
|
2722
|
-
"var r = root, h = Selector.handlers, c = false, n;"];
|
2723
|
-
|
2724
|
-
while (e && le != e && (/\S/).test(e)) {
|
2725
|
-
le = e;
|
2726
|
-
for (var i in ps) {
|
2727
|
-
p = ps[i];
|
2728
|
-
if (m = e.match(p)) {
|
2729
|
-
this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
|
2730
|
-
new Template(c[i]).evaluate(m));
|
2731
|
-
e = e.replace(m[0], '');
|
2732
|
-
break;
|
2733
|
-
}
|
2734
|
-
}
|
2735
|
-
}
|
2736
|
-
|
2737
|
-
this.matcher.push("return h.unique(n);\n}");
|
2738
|
-
eval(this.matcher.join('\n'));
|
2739
|
-
Selector._cache[this.expression] = this.matcher;
|
2740
|
-
},
|
2741
|
-
|
2742
|
-
compileXPathMatcher: function() {
|
2743
|
-
var e = this.expression, ps = Selector.patterns,
|
2744
|
-
x = Selector.xpath, le, m;
|
2745
|
-
|
2746
|
-
if (Selector._cache[e]) {
|
2747
|
-
this.xpath = Selector._cache[e]; return;
|
2748
|
-
}
|
2749
|
-
|
2750
|
-
this.matcher = ['.//*'];
|
2751
|
-
while (e && le != e && (/\S/).test(e)) {
|
2752
|
-
le = e;
|
2753
|
-
for (var i in ps) {
|
2754
|
-
if (m = e.match(ps[i])) {
|
2755
|
-
this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
|
2756
|
-
new Template(x[i]).evaluate(m));
|
2757
|
-
e = e.replace(m[0], '');
|
2758
|
-
break;
|
2759
|
-
}
|
2760
|
-
}
|
2761
|
-
}
|
2762
|
-
|
2763
|
-
this.xpath = this.matcher.join('');
|
2764
|
-
Selector._cache[this.expression] = this.xpath;
|
2765
|
-
},
|
2766
|
-
|
2767
|
-
findElements: function(root) {
|
2768
|
-
root = root || document;
|
2769
|
-
if (this.xpath) return document._getElementsByXPath(this.xpath, root);
|
2770
|
-
return this.matcher(root);
|
2771
|
-
},
|
2772
|
-
|
2773
|
-
match: function(element) {
|
2774
|
-
this.tokens = [];
|
2775
|
-
|
2776
|
-
var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
|
2777
|
-
var le, p, m;
|
2778
|
-
|
2779
|
-
while (e && le !== e && (/\S/).test(e)) {
|
2780
|
-
le = e;
|
2781
|
-
for (var i in ps) {
|
2782
|
-
p = ps[i];
|
2783
|
-
if (m = e.match(p)) {
|
2784
|
-
// use the Selector.assertions methods unless the selector
|
2785
|
-
// is too complex.
|
2786
|
-
if (as[i]) {
|
2787
|
-
this.tokens.push([i, Object.clone(m)]);
|
2788
|
-
e = e.replace(m[0], '');
|
2789
|
-
} else {
|
2790
|
-
// reluctantly do a document-wide search
|
2791
|
-
// and look for a match in the array
|
2792
|
-
return this.findElements(document).include(element);
|
2793
|
-
}
|
2794
|
-
}
|
2795
|
-
}
|
2796
|
-
}
|
2797
|
-
|
2798
|
-
var match = true, name, matches;
|
2799
|
-
for (var i = 0, token; token = this.tokens[i]; i++) {
|
2800
|
-
name = token[0], matches = token[1];
|
2801
|
-
if (!Selector.assertions[name](element, matches)) {
|
2802
|
-
match = false; break;
|
2803
|
-
}
|
2804
|
-
}
|
2805
|
-
|
2806
|
-
return match;
|
2807
|
-
},
|
2808
|
-
|
2809
|
-
toString: function() {
|
2810
|
-
return this.expression;
|
2811
|
-
},
|
2812
|
-
|
2813
|
-
inspect: function() {
|
2814
|
-
return "#<Selector:" + this.expression.inspect() + ">";
|
2815
|
-
}
|
2816
|
-
});
|
2817
|
-
|
2818
|
-
Object.extend(Selector, {
|
2819
|
-
_cache: { },
|
2820
|
-
|
2821
|
-
xpath: {
|
2822
|
-
descendant: "//*",
|
2823
|
-
child: "/*",
|
2824
|
-
adjacent: "/following-sibling::*[1]",
|
2825
|
-
laterSibling: '/following-sibling::*',
|
2826
|
-
tagName: function(m) {
|
2827
|
-
if (m[1] == '*') return '';
|
2828
|
-
return "[local-name()='" + m[1].toLowerCase() +
|
2829
|
-
"' or local-name()='" + m[1].toUpperCase() + "']";
|
2830
|
-
},
|
2831
|
-
className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",
|
2832
|
-
id: "[@id='#{1}']",
|
2833
|
-
attrPresence: "[@#{1}]",
|
2834
|
-
attr: function(m) {
|
2835
|
-
m[3] = m[5] || m[6];
|
2836
|
-
return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
|
2837
|
-
},
|
2838
|
-
pseudo: function(m) {
|
2839
|
-
var h = Selector.xpath.pseudos[m[1]];
|
2840
|
-
if (!h) return '';
|
2841
|
-
if (Object.isFunction(h)) return h(m);
|
2842
|
-
return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
|
2843
|
-
},
|
2844
|
-
operators: {
|
2845
|
-
'=': "[@#{1}='#{3}']",
|
2846
|
-
'!=': "[@#{1}!='#{3}']",
|
2847
|
-
'^=': "[starts-with(@#{1}, '#{3}')]",
|
2848
|
-
'$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
|
2849
|
-
'*=': "[contains(@#{1}, '#{3}')]",
|
2850
|
-
'~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
|
2851
|
-
'|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
|
2852
|
-
},
|
2853
|
-
pseudos: {
|
2854
|
-
'first-child': '[not(preceding-sibling::*)]',
|
2855
|
-
'last-child': '[not(following-sibling::*)]',
|
2856
|
-
'only-child': '[not(preceding-sibling::* or following-sibling::*)]',
|
2857
|
-
'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
|
2858
|
-
'checked': "[@checked]",
|
2859
|
-
'disabled': "[@disabled]",
|
2860
|
-
'enabled': "[not(@disabled)]",
|
2861
|
-
'not': function(m) {
|
2862
|
-
var e = m[6], p = Selector.patterns,
|
2863
|
-
x = Selector.xpath, le, m, v;
|
2864
|
-
|
2865
|
-
var exclusion = [];
|
2866
|
-
while (e && le != e && (/\S/).test(e)) {
|
2867
|
-
le = e;
|
2868
|
-
for (var i in p) {
|
2869
|
-
if (m = e.match(p[i])) {
|
2870
|
-
v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m);
|
2871
|
-
exclusion.push("(" + v.substring(1, v.length - 1) + ")");
|
2872
|
-
e = e.replace(m[0], '');
|
2873
|
-
break;
|
2874
|
-
}
|
2875
|
-
}
|
2876
|
-
}
|
2877
|
-
return "[not(" + exclusion.join(" and ") + ")]";
|
2878
|
-
},
|
2879
|
-
'nth-child': function(m) {
|
2880
|
-
return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
|
2881
|
-
},
|
2882
|
-
'nth-last-child': function(m) {
|
2883
|
-
return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
|
2884
|
-
},
|
2885
|
-
'nth-of-type': function(m) {
|
2886
|
-
return Selector.xpath.pseudos.nth("position() ", m);
|
2887
|
-
},
|
2888
|
-
'nth-last-of-type': function(m) {
|
2889
|
-
return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
|
2890
|
-
},
|
2891
|
-
'first-of-type': function(m) {
|
2892
|
-
m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
|
2893
|
-
},
|
2894
|
-
'last-of-type': function(m) {
|
2895
|
-
m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
|
2896
|
-
},
|
2897
|
-
'only-of-type': function(m) {
|
2898
|
-
var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
|
2899
|
-
},
|
2900
|
-
nth: function(fragment, m) {
|
2901
|
-
var mm, formula = m[6], predicate;
|
2902
|
-
if (formula == 'even') formula = '2n+0';
|
2903
|
-
if (formula == 'odd') formula = '2n+1';
|
2904
|
-
if (mm = formula.match(/^(\d+)$/)) // digit only
|
2905
|
-
return '[' + fragment + "= " + mm[1] + ']';
|
2906
|
-
if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
|
2907
|
-
if (mm[1] == "-") mm[1] = -1;
|
2908
|
-
var a = mm[1] ? Number(mm[1]) : 1;
|
2909
|
-
var b = mm[2] ? Number(mm[2]) : 0;
|
2910
|
-
predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
|
2911
|
-
"((#{fragment} - #{b}) div #{a} >= 0)]";
|
2912
|
-
return new Template(predicate).evaluate({
|
2913
|
-
fragment: fragment, a: a, b: b });
|
2914
|
-
}
|
2915
|
-
}
|
2916
|
-
}
|
2917
|
-
},
|
2918
|
-
|
2919
|
-
criteria: {
|
2920
|
-
tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',
|
2921
|
-
className: 'n = h.className(n, r, "#{1}", c); c = false;',
|
2922
|
-
id: 'n = h.id(n, r, "#{1}", c); c = false;',
|
2923
|
-
attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;',
|
2924
|
-
attr: function(m) {
|
2925
|
-
m[3] = (m[5] || m[6]);
|
2926
|
-
return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);
|
2927
|
-
},
|
2928
|
-
pseudo: function(m) {
|
2929
|
-
if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
|
2930
|
-
return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
|
2931
|
-
},
|
2932
|
-
descendant: 'c = "descendant";',
|
2933
|
-
child: 'c = "child";',
|
2934
|
-
adjacent: 'c = "adjacent";',
|
2935
|
-
laterSibling: 'c = "laterSibling";'
|
2936
|
-
},
|
2937
|
-
|
2938
|
-
patterns: {
|
2939
|
-
// combinators must be listed first
|
2940
|
-
// (and descendant needs to be last combinator)
|
2941
|
-
laterSibling: /^\s*~\s*/,
|
2942
|
-
child: /^\s*>\s*/,
|
2943
|
-
adjacent: /^\s*\+\s*/,
|
2944
|
-
descendant: /^\s/,
|
2945
|
-
|
2946
|
-
// selectors follow
|
2947
|
-
tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,
|
2948
|
-
id: /^#([\w\-\*]+)(\b|$)/,
|
2949
|
-
className: /^\.([\w\-\*]+)(\b|$)/,
|
2950
|
-
pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/,
|
2951
|
-
attrPresence: /^\[([\w]+)\]/,
|
2952
|
-
attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
|
2953
|
-
},
|
2954
|
-
|
2955
|
-
// for Selector.match and Element#match
|
2956
|
-
assertions: {
|
2957
|
-
tagName: function(element, matches) {
|
2958
|
-
return matches[1].toUpperCase() == element.tagName.toUpperCase();
|
2959
|
-
},
|
2960
|
-
|
2961
|
-
className: function(element, matches) {
|
2962
|
-
return Element.hasClassName(element, matches[1]);
|
2963
|
-
},
|
2964
|
-
|
2965
|
-
id: function(element, matches) {
|
2966
|
-
return element.id === matches[1];
|
2967
|
-
},
|
2968
|
-
|
2969
|
-
attrPresence: function(element, matches) {
|
2970
|
-
return Element.hasAttribute(element, matches[1]);
|
2971
|
-
},
|
2972
|
-
|
2973
|
-
attr: function(element, matches) {
|
2974
|
-
var nodeValue = Element.readAttribute(element, matches[1]);
|
2975
|
-
return Selector.operators[matches[2]](nodeValue, matches[3]);
|
2976
|
-
}
|
2977
|
-
},
|
2978
|
-
|
2979
|
-
handlers: {
|
2980
|
-
// UTILITY FUNCTIONS
|
2981
|
-
// joins two collections
|
2982
|
-
concat: function(a, b) {
|
2983
|
-
for (var i = 0, node; node = b[i]; i++)
|
2984
|
-
a.push(node);
|
2985
|
-
return a;
|
2986
|
-
},
|
2987
|
-
|
2988
|
-
// marks an array of nodes for counting
|
2989
|
-
mark: function(nodes) {
|
2990
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
2991
|
-
node._counted = true;
|
2992
|
-
return nodes;
|
2993
|
-
},
|
2994
|
-
|
2995
|
-
unmark: function(nodes) {
|
2996
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
2997
|
-
node._counted = undefined;
|
2998
|
-
return nodes;
|
2999
|
-
},
|
3000
|
-
|
3001
|
-
// mark each child node with its position (for nth calls)
|
3002
|
-
// "ofType" flag indicates whether we're indexing for nth-of-type
|
3003
|
-
// rather than nth-child
|
3004
|
-
index: function(parentNode, reverse, ofType) {
|
3005
|
-
parentNode._counted = true;
|
3006
|
-
if (reverse) {
|
3007
|
-
for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
|
3008
|
-
var node = nodes[i];
|
3009
|
-
if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
|
3010
|
-
}
|
3011
|
-
} else {
|
3012
|
-
for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
|
3013
|
-
if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
|
3014
|
-
}
|
3015
|
-
},
|
3016
|
-
|
3017
|
-
// filters out duplicates and extends all nodes
|
3018
|
-
unique: function(nodes) {
|
3019
|
-
if (nodes.length == 0) return nodes;
|
3020
|
-
var results = [], n;
|
3021
|
-
for (var i = 0, l = nodes.length; i < l; i++)
|
3022
|
-
if (!(n = nodes[i])._counted) {
|
3023
|
-
n._counted = true;
|
3024
|
-
results.push(Element.extend(n));
|
3025
|
-
}
|
3026
|
-
return Selector.handlers.unmark(results);
|
3027
|
-
},
|
3028
|
-
|
3029
|
-
// COMBINATOR FUNCTIONS
|
3030
|
-
descendant: function(nodes) {
|
3031
|
-
var h = Selector.handlers;
|
3032
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
3033
|
-
h.concat(results, node.getElementsByTagName('*'));
|
3034
|
-
return results;
|
3035
|
-
},
|
3036
|
-
|
3037
|
-
child: function(nodes) {
|
3038
|
-
var h = Selector.handlers;
|
3039
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++) {
|
3040
|
-
for (var j = 0, children = [], child; child = node.childNodes[j]; j++)
|
3041
|
-
if (child.nodeType == 1 && child.tagName != '!') results.push(child);
|
3042
|
-
}
|
3043
|
-
return results;
|
3044
|
-
},
|
3045
|
-
|
3046
|
-
adjacent: function(nodes) {
|
3047
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++) {
|
3048
|
-
var next = this.nextElementSibling(node);
|
3049
|
-
if (next) results.push(next);
|
3050
|
-
}
|
3051
|
-
return results;
|
3052
|
-
},
|
3053
|
-
|
3054
|
-
laterSibling: function(nodes) {
|
3055
|
-
var h = Selector.handlers;
|
3056
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
3057
|
-
h.concat(results, Element.nextSiblings(node));
|
3058
|
-
return results;
|
3059
|
-
},
|
3060
|
-
|
3061
|
-
nextElementSibling: function(node) {
|
3062
|
-
while (node = node.nextSibling)
|
3063
|
-
if (node.nodeType == 1) return node;
|
3064
|
-
return null;
|
3065
|
-
},
|
3066
|
-
|
3067
|
-
previousElementSibling: function(node) {
|
3068
|
-
while (node = node.previousSibling)
|
3069
|
-
if (node.nodeType == 1) return node;
|
3070
|
-
return null;
|
3071
|
-
},
|
3072
|
-
|
3073
|
-
// TOKEN FUNCTIONS
|
3074
|
-
tagName: function(nodes, root, tagName, combinator) {
|
3075
|
-
tagName = tagName.toUpperCase();
|
3076
|
-
var results = [], h = Selector.handlers;
|
3077
|
-
if (nodes) {
|
3078
|
-
if (combinator) {
|
3079
|
-
// fastlane for ordinary descendant combinators
|
3080
|
-
if (combinator == "descendant") {
|
3081
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3082
|
-
h.concat(results, node.getElementsByTagName(tagName));
|
3083
|
-
return results;
|
3084
|
-
} else nodes = this[combinator](nodes);
|
3085
|
-
if (tagName == "*") return nodes;
|
3086
|
-
}
|
3087
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3088
|
-
if (node.tagName.toUpperCase() == tagName) results.push(node);
|
3089
|
-
return results;
|
3090
|
-
} else return root.getElementsByTagName(tagName);
|
3091
|
-
},
|
3092
|
-
|
3093
|
-
id: function(nodes, root, id, combinator) {
|
3094
|
-
var targetNode = $(id), h = Selector.handlers;
|
3095
|
-
if (!targetNode) return [];
|
3096
|
-
if (!nodes && root == document) return [targetNode];
|
3097
|
-
if (nodes) {
|
3098
|
-
if (combinator) {
|
3099
|
-
if (combinator == 'child') {
|
3100
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3101
|
-
if (targetNode.parentNode == node) return [targetNode];
|
3102
|
-
} else if (combinator == 'descendant') {
|
3103
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3104
|
-
if (Element.descendantOf(targetNode, node)) return [targetNode];
|
3105
|
-
} else if (combinator == 'adjacent') {
|
3106
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3107
|
-
if (Selector.handlers.previousElementSibling(targetNode) == node)
|
3108
|
-
return [targetNode];
|
3109
|
-
} else nodes = h[combinator](nodes);
|
3110
|
-
}
|
3111
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3112
|
-
if (node == targetNode) return [targetNode];
|
3113
|
-
return [];
|
3114
|
-
}
|
3115
|
-
return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
|
3116
|
-
},
|
3117
|
-
|
3118
|
-
className: function(nodes, root, className, combinator) {
|
3119
|
-
if (nodes && combinator) nodes = this[combinator](nodes);
|
3120
|
-
return Selector.handlers.byClassName(nodes, root, className);
|
3121
|
-
},
|
3122
|
-
|
3123
|
-
byClassName: function(nodes, root, className) {
|
3124
|
-
if (!nodes) nodes = Selector.handlers.descendant([root]);
|
3125
|
-
var needle = ' ' + className + ' ';
|
3126
|
-
for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
|
3127
|
-
nodeClassName = node.className;
|
3128
|
-
if (nodeClassName.length == 0) continue;
|
3129
|
-
if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
|
3130
|
-
results.push(node);
|
3131
|
-
}
|
3132
|
-
return results;
|
3133
|
-
},
|
3134
|
-
|
3135
|
-
attrPresence: function(nodes, root, attr) {
|
3136
|
-
var results = [];
|
3137
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3138
|
-
if (Element.hasAttribute(node, attr)) results.push(node);
|
3139
|
-
return results;
|
3140
|
-
},
|
3141
|
-
|
3142
|
-
attr: function(nodes, root, attr, value, operator) {
|
3143
|
-
if (!nodes) nodes = root.getElementsByTagName("*");
|
3144
|
-
var handler = Selector.operators[operator], results = [];
|
3145
|
-
for (var i = 0, node; node = nodes[i]; i++) {
|
3146
|
-
var nodeValue = Element.readAttribute(node, attr);
|
3147
|
-
if (nodeValue === null) continue;
|
3148
|
-
if (handler(nodeValue, value)) results.push(node);
|
3149
|
-
}
|
3150
|
-
return results;
|
3151
|
-
},
|
3152
|
-
|
3153
|
-
pseudo: function(nodes, name, value, root, combinator) {
|
3154
|
-
if (nodes && combinator) nodes = this[combinator](nodes);
|
3155
|
-
if (!nodes) nodes = root.getElementsByTagName("*");
|
3156
|
-
return Selector.pseudos[name](nodes, value, root);
|
3157
|
-
}
|
3158
|
-
},
|
3159
|
-
|
3160
|
-
pseudos: {
|
3161
|
-
'first-child': function(nodes, value, root) {
|
3162
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++) {
|
3163
|
-
if (Selector.handlers.previousElementSibling(node)) continue;
|
3164
|
-
results.push(node);
|
3165
|
-
}
|
3166
|
-
return results;
|
3167
|
-
},
|
3168
|
-
'last-child': function(nodes, value, root) {
|
3169
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++) {
|
3170
|
-
if (Selector.handlers.nextElementSibling(node)) continue;
|
3171
|
-
results.push(node);
|
3172
|
-
}
|
3173
|
-
return results;
|
3174
|
-
},
|
3175
|
-
'only-child': function(nodes, value, root) {
|
3176
|
-
var h = Selector.handlers;
|
3177
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
3178
|
-
if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
|
3179
|
-
results.push(node);
|
3180
|
-
return results;
|
3181
|
-
},
|
3182
|
-
'nth-child': function(nodes, formula, root) {
|
3183
|
-
return Selector.pseudos.nth(nodes, formula, root);
|
3184
|
-
},
|
3185
|
-
'nth-last-child': function(nodes, formula, root) {
|
3186
|
-
return Selector.pseudos.nth(nodes, formula, root, true);
|
3187
|
-
},
|
3188
|
-
'nth-of-type': function(nodes, formula, root) {
|
3189
|
-
return Selector.pseudos.nth(nodes, formula, root, false, true);
|
3190
|
-
},
|
3191
|
-
'nth-last-of-type': function(nodes, formula, root) {
|
3192
|
-
return Selector.pseudos.nth(nodes, formula, root, true, true);
|
3193
|
-
},
|
3194
|
-
'first-of-type': function(nodes, formula, root) {
|
3195
|
-
return Selector.pseudos.nth(nodes, "1", root, false, true);
|
3196
|
-
},
|
3197
|
-
'last-of-type': function(nodes, formula, root) {
|
3198
|
-
return Selector.pseudos.nth(nodes, "1", root, true, true);
|
3199
|
-
},
|
3200
|
-
'only-of-type': function(nodes, formula, root) {
|
3201
|
-
var p = Selector.pseudos;
|
3202
|
-
return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
|
3203
|
-
},
|
3204
|
-
|
3205
|
-
// handles the an+b logic
|
3206
|
-
getIndices: function(a, b, total) {
|
3207
|
-
if (a == 0) return b > 0 ? [b] : [];
|
3208
|
-
return $R(1, total).inject([], function(memo, i) {
|
3209
|
-
if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
|
3210
|
-
return memo;
|
3211
|
-
});
|
3212
|
-
},
|
3213
|
-
|
3214
|
-
// handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
|
3215
|
-
nth: function(nodes, formula, root, reverse, ofType) {
|
3216
|
-
if (nodes.length == 0) return [];
|
3217
|
-
if (formula == 'even') formula = '2n+0';
|
3218
|
-
if (formula == 'odd') formula = '2n+1';
|
3219
|
-
var h = Selector.handlers, results = [], indexed = [], m;
|
3220
|
-
h.mark(nodes);
|
3221
|
-
for (var i = 0, node; node = nodes[i]; i++) {
|
3222
|
-
if (!node.parentNode._counted) {
|
3223
|
-
h.index(node.parentNode, reverse, ofType);
|
3224
|
-
indexed.push(node.parentNode);
|
3225
|
-
}
|
3226
|
-
}
|
3227
|
-
if (formula.match(/^\d+$/)) { // just a number
|
3228
|
-
formula = Number(formula);
|
3229
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3230
|
-
if (node.nodeIndex == formula) results.push(node);
|
3231
|
-
} else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
|
3232
|
-
if (m[1] == "-") m[1] = -1;
|
3233
|
-
var a = m[1] ? Number(m[1]) : 1;
|
3234
|
-
var b = m[2] ? Number(m[2]) : 0;
|
3235
|
-
var indices = Selector.pseudos.getIndices(a, b, nodes.length);
|
3236
|
-
for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
|
3237
|
-
for (var j = 0; j < l; j++)
|
3238
|
-
if (node.nodeIndex == indices[j]) results.push(node);
|
3239
|
-
}
|
3240
|
-
}
|
3241
|
-
h.unmark(nodes);
|
3242
|
-
h.unmark(indexed);
|
3243
|
-
return results;
|
3244
|
-
},
|
3245
|
-
|
3246
|
-
'empty': function(nodes, value, root) {
|
3247
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++) {
|
3248
|
-
// IE treats comments as element nodes
|
3249
|
-
if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue;
|
3250
|
-
results.push(node);
|
3251
|
-
}
|
3252
|
-
return results;
|
3253
|
-
},
|
3254
|
-
|
3255
|
-
'not': function(nodes, selector, root) {
|
3256
|
-
var h = Selector.handlers, selectorType, m;
|
3257
|
-
var exclusions = new Selector(selector).findElements(root);
|
3258
|
-
h.mark(exclusions);
|
3259
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
3260
|
-
if (!node._counted) results.push(node);
|
3261
|
-
h.unmark(exclusions);
|
3262
|
-
return results;
|
3263
|
-
},
|
3264
|
-
|
3265
|
-
'enabled': function(nodes, value, root) {
|
3266
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
3267
|
-
if (!node.disabled) results.push(node);
|
3268
|
-
return results;
|
3269
|
-
},
|
3270
|
-
|
3271
|
-
'disabled': function(nodes, value, root) {
|
3272
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
3273
|
-
if (node.disabled) results.push(node);
|
3274
|
-
return results;
|
3275
|
-
},
|
3276
|
-
|
3277
|
-
'checked': function(nodes, value, root) {
|
3278
|
-
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
3279
|
-
if (node.checked) results.push(node);
|
3280
|
-
return results;
|
3281
|
-
}
|
3282
|
-
},
|
3283
|
-
|
3284
|
-
operators: {
|
3285
|
-
'=': function(nv, v) { return nv == v; },
|
3286
|
-
'!=': function(nv, v) { return nv != v; },
|
3287
|
-
'^=': function(nv, v) { return nv.startsWith(v); },
|
3288
|
-
'$=': function(nv, v) { return nv.endsWith(v); },
|
3289
|
-
'*=': function(nv, v) { return nv.include(v); },
|
3290
|
-
'~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
|
3291
|
-
'|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); }
|
3292
|
-
},
|
3293
|
-
|
3294
|
-
matchElements: function(elements, expression) {
|
3295
|
-
var matches = new Selector(expression).findElements(), h = Selector.handlers;
|
3296
|
-
h.mark(matches);
|
3297
|
-
for (var i = 0, results = [], element; element = elements[i]; i++)
|
3298
|
-
if (element._counted) results.push(element);
|
3299
|
-
h.unmark(matches);
|
3300
|
-
return results;
|
3301
|
-
},
|
3302
|
-
|
3303
|
-
findElement: function(elements, expression, index) {
|
3304
|
-
if (Object.isNumber(expression)) {
|
3305
|
-
index = expression; expression = false;
|
3306
|
-
}
|
3307
|
-
return Selector.matchElements(elements, expression || '*')[index || 0];
|
3308
|
-
},
|
3309
|
-
|
3310
|
-
findChildElements: function(element, expressions) {
|
3311
|
-
var exprs = expressions.join(','), expressions = [];
|
3312
|
-
exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
|
3313
|
-
expressions.push(m[1].strip());
|
3314
|
-
});
|
3315
|
-
var results = [], h = Selector.handlers;
|
3316
|
-
for (var i = 0, l = expressions.length, selector; i < l; i++) {
|
3317
|
-
selector = new Selector(expressions[i].strip());
|
3318
|
-
h.concat(results, selector.findElements(element));
|
3319
|
-
}
|
3320
|
-
return (l > 1) ? h.unique(results) : results;
|
3321
|
-
}
|
3322
|
-
});
|
3323
|
-
|
3324
|
-
function $$() {
|
3325
|
-
return Selector.findChildElements(document, $A(arguments));
|
3326
|
-
}
|
3327
|
-
var Form = {
|
3328
|
-
reset: function(form) {
|
3329
|
-
$(form).reset();
|
3330
|
-
return form;
|
3331
|
-
},
|
3332
|
-
|
3333
|
-
serializeElements: function(elements, options) {
|
3334
|
-
if (typeof options != 'object') options = { hash: !!options };
|
3335
|
-
else if (options.hash === undefined) options.hash = true;
|
3336
|
-
var key, value, submitted = false, submit = options.submit;
|
3337
|
-
|
3338
|
-
var data = elements.inject({ }, function(result, element) {
|
3339
|
-
if (!element.disabled && element.name) {
|
3340
|
-
key = element.name; value = $(element).getValue();
|
3341
|
-
if (value != null && (element.type != 'submit' || (!submitted &&
|
3342
|
-
submit !== false && (!submit || key == submit) && (submitted = true)))) {
|
3343
|
-
if (key in result) {
|
3344
|
-
// a key is already present; construct an array of values
|
3345
|
-
if (!Object.isArray(result[key])) result[key] = [result[key]];
|
3346
|
-
result[key].push(value);
|
3347
|
-
}
|
3348
|
-
else result[key] = value;
|
3349
|
-
}
|
3350
|
-
}
|
3351
|
-
return result;
|
3352
|
-
});
|
3353
|
-
|
3354
|
-
return options.hash ? data : Hash.toQueryString(data);
|
3355
|
-
}
|
3356
|
-
};
|
3357
|
-
|
3358
|
-
Form.Methods = {
|
3359
|
-
serialize: function(form, options) {
|
3360
|
-
return Form.serializeElements(Form.getElements(form), options);
|
3361
|
-
},
|
3362
|
-
|
3363
|
-
getElements: function(form) {
|
3364
|
-
return $A($(form).getElementsByTagName('*')).inject([],
|
3365
|
-
function(elements, child) {
|
3366
|
-
if (Form.Element.Serializers[child.tagName.toLowerCase()])
|
3367
|
-
elements.push(Element.extend(child));
|
3368
|
-
return elements;
|
3369
|
-
}
|
3370
|
-
);
|
3371
|
-
},
|
3372
|
-
|
3373
|
-
getInputs: function(form, typeName, name) {
|
3374
|
-
form = $(form);
|
3375
|
-
var inputs = form.getElementsByTagName('input');
|
3376
|
-
|
3377
|
-
if (!typeName && !name) return $A(inputs).map(Element.extend);
|
3378
|
-
|
3379
|
-
for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
|
3380
|
-
var input = inputs[i];
|
3381
|
-
if ((typeName && input.type != typeName) || (name && input.name != name))
|
3382
|
-
continue;
|
3383
|
-
matchingInputs.push(Element.extend(input));
|
3384
|
-
}
|
3385
|
-
|
3386
|
-
return matchingInputs;
|
3387
|
-
},
|
3388
|
-
|
3389
|
-
disable: function(form) {
|
3390
|
-
form = $(form);
|
3391
|
-
Form.getElements(form).invoke('disable');
|
3392
|
-
return form;
|
3393
|
-
},
|
3394
|
-
|
3395
|
-
enable: function(form) {
|
3396
|
-
form = $(form);
|
3397
|
-
Form.getElements(form).invoke('enable');
|
3398
|
-
return form;
|
3399
|
-
},
|
3400
|
-
|
3401
|
-
findFirstElement: function(form) {
|
3402
|
-
var elements = $(form).getElements().findAll(function(element) {
|
3403
|
-
return 'hidden' != element.type && !element.disabled;
|
3404
|
-
});
|
3405
|
-
var firstByIndex = elements.findAll(function(element) {
|
3406
|
-
return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
|
3407
|
-
}).sortBy(function(element) { return element.tabIndex }).first();
|
3408
|
-
|
3409
|
-
return firstByIndex ? firstByIndex : elements.find(function(element) {
|
3410
|
-
return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
|
3411
|
-
});
|
3412
|
-
},
|
3413
|
-
|
3414
|
-
focusFirstElement: function(form) {
|
3415
|
-
form = $(form);
|
3416
|
-
form.findFirstElement().activate();
|
3417
|
-
return form;
|
3418
|
-
},
|
3419
|
-
|
3420
|
-
request: function(form, options) {
|
3421
|
-
form = $(form), options = Object.clone(options || { });
|
3422
|
-
|
3423
|
-
var params = options.parameters, action = form.readAttribute('action') || '';
|
3424
|
-
if (action.blank()) action = window.location.href;
|
3425
|
-
options.parameters = form.serialize(true);
|
3426
|
-
|
3427
|
-
if (params) {
|
3428
|
-
if (Object.isString(params)) params = params.toQueryParams();
|
3429
|
-
Object.extend(options.parameters, params);
|
3430
|
-
}
|
3431
|
-
|
3432
|
-
if (form.hasAttribute('method') && !options.method)
|
3433
|
-
options.method = form.method;
|
3434
|
-
|
3435
|
-
return new Ajax.Request(action, options);
|
3436
|
-
}
|
3437
|
-
};
|
3438
|
-
|
3439
|
-
/*--------------------------------------------------------------------------*/
|
3440
|
-
|
3441
|
-
Form.Element = {
|
3442
|
-
focus: function(element) {
|
3443
|
-
$(element).focus();
|
3444
|
-
return element;
|
3445
|
-
},
|
3446
|
-
|
3447
|
-
select: function(element) {
|
3448
|
-
$(element).select();
|
3449
|
-
return element;
|
3450
|
-
}
|
3451
|
-
};
|
3452
|
-
|
3453
|
-
Form.Element.Methods = {
|
3454
|
-
serialize: function(element) {
|
3455
|
-
element = $(element);
|
3456
|
-
if (!element.disabled && element.name) {
|
3457
|
-
var value = element.getValue();
|
3458
|
-
if (value != undefined) {
|
3459
|
-
var pair = { };
|
3460
|
-
pair[element.name] = value;
|
3461
|
-
return Hash.toQueryString(pair);
|
3462
|
-
}
|
3463
|
-
}
|
3464
|
-
return '';
|
3465
|
-
},
|
3466
|
-
|
3467
|
-
getValue: function(element) {
|
3468
|
-
element = $(element);
|
3469
|
-
var method = element.tagName.toLowerCase();
|
3470
|
-
return Form.Element.Serializers[method](element);
|
3471
|
-
},
|
3472
|
-
|
3473
|
-
setValue: function(element, value) {
|
3474
|
-
element = $(element);
|
3475
|
-
var method = element.tagName.toLowerCase();
|
3476
|
-
Form.Element.Serializers[method](element, value);
|
3477
|
-
return element;
|
3478
|
-
},
|
3479
|
-
|
3480
|
-
clear: function(element) {
|
3481
|
-
$(element).value = '';
|
3482
|
-
return element;
|
3483
|
-
},
|
3484
|
-
|
3485
|
-
present: function(element) {
|
3486
|
-
return $(element).value != '';
|
3487
|
-
},
|
3488
|
-
|
3489
|
-
activate: function(element) {
|
3490
|
-
element = $(element);
|
3491
|
-
try {
|
3492
|
-
element.focus();
|
3493
|
-
if (element.select && (element.tagName.toLowerCase() != 'input' ||
|
3494
|
-
!['button', 'reset', 'submit'].include(element.type)))
|
3495
|
-
element.select();
|
3496
|
-
} catch (e) { }
|
3497
|
-
return element;
|
3498
|
-
},
|
3499
|
-
|
3500
|
-
disable: function(element) {
|
3501
|
-
element = $(element);
|
3502
|
-
element.blur();
|
3503
|
-
element.disabled = true;
|
3504
|
-
return element;
|
3505
|
-
},
|
3506
|
-
|
3507
|
-
enable: function(element) {
|
3508
|
-
element = $(element);
|
3509
|
-
element.disabled = false;
|
3510
|
-
return element;
|
3511
|
-
}
|
3512
|
-
};
|
3513
|
-
|
3514
|
-
/*--------------------------------------------------------------------------*/
|
3515
|
-
|
3516
|
-
var Field = Form.Element;
|
3517
|
-
var $F = Form.Element.Methods.getValue;
|
3518
|
-
|
3519
|
-
/*--------------------------------------------------------------------------*/
|
3520
|
-
|
3521
|
-
Form.Element.Serializers = {
|
3522
|
-
input: function(element, value) {
|
3523
|
-
switch (element.type.toLowerCase()) {
|
3524
|
-
case 'checkbox':
|
3525
|
-
case 'radio':
|
3526
|
-
return Form.Element.Serializers.inputSelector(element, value);
|
3527
|
-
default:
|
3528
|
-
return Form.Element.Serializers.textarea(element, value);
|
3529
|
-
}
|
3530
|
-
},
|
3531
|
-
|
3532
|
-
inputSelector: function(element, value) {
|
3533
|
-
if (value === undefined) return element.checked ? element.value : null;
|
3534
|
-
else element.checked = !!value;
|
3535
|
-
},
|
3536
|
-
|
3537
|
-
textarea: function(element, value) {
|
3538
|
-
if (value === undefined) return element.value;
|
3539
|
-
else element.value = value;
|
3540
|
-
},
|
3541
|
-
|
3542
|
-
select: function(element, index) {
|
3543
|
-
if (index === undefined)
|
3544
|
-
return this[element.type == 'select-one' ?
|
3545
|
-
'selectOne' : 'selectMany'](element);
|
3546
|
-
else {
|
3547
|
-
var opt, value, single = !Object.isArray(index);
|
3548
|
-
for (var i = 0, length = element.length; i < length; i++) {
|
3549
|
-
opt = element.options[i];
|
3550
|
-
value = this.optionValue(opt);
|
3551
|
-
if (single) {
|
3552
|
-
if (value == index) {
|
3553
|
-
opt.selected = true;
|
3554
|
-
return;
|
3555
|
-
}
|
3556
|
-
}
|
3557
|
-
else opt.selected = index.include(value);
|
3558
|
-
}
|
3559
|
-
}
|
3560
|
-
},
|
3561
|
-
|
3562
|
-
selectOne: function(element) {
|
3563
|
-
var index = element.selectedIndex;
|
3564
|
-
return index >= 0 ? this.optionValue(element.options[index]) : null;
|
3565
|
-
},
|
3566
|
-
|
3567
|
-
selectMany: function(element) {
|
3568
|
-
var values, length = element.length;
|
3569
|
-
if (!length) return null;
|
3570
|
-
|
3571
|
-
for (var i = 0, values = []; i < length; i++) {
|
3572
|
-
var opt = element.options[i];
|
3573
|
-
if (opt.selected) values.push(this.optionValue(opt));
|
3574
|
-
}
|
3575
|
-
return values;
|
3576
|
-
},
|
3577
|
-
|
3578
|
-
optionValue: function(opt) {
|
3579
|
-
// extend element because hasAttribute may not be native
|
3580
|
-
return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
|
3581
|
-
}
|
3582
|
-
};
|
3583
|
-
|
3584
|
-
/*--------------------------------------------------------------------------*/
|
3585
|
-
|
3586
|
-
Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
|
3587
|
-
initialize: function($super, element, frequency, callback) {
|
3588
|
-
$super(callback, frequency);
|
3589
|
-
this.element = $(element);
|
3590
|
-
this.lastValue = this.getValue();
|
3591
|
-
},
|
3592
|
-
|
3593
|
-
execute: function() {
|
3594
|
-
var value = this.getValue();
|
3595
|
-
if (Object.isString(this.lastValue) && Object.isString(value) ?
|
3596
|
-
this.lastValue != value : String(this.lastValue) != String(value)) {
|
3597
|
-
this.callback(this.element, value);
|
3598
|
-
this.lastValue = value;
|
3599
|
-
}
|
3600
|
-
}
|
3601
|
-
});
|
3602
|
-
|
3603
|
-
Form.Element.Observer = Class.create(Abstract.TimedObserver, {
|
3604
|
-
getValue: function() {
|
3605
|
-
return Form.Element.getValue(this.element);
|
3606
|
-
}
|
3607
|
-
});
|
3608
|
-
|
3609
|
-
Form.Observer = Class.create(Abstract.TimedObserver, {
|
3610
|
-
getValue: function() {
|
3611
|
-
return Form.serialize(this.element);
|
3612
|
-
}
|
3613
|
-
});
|
3614
|
-
|
3615
|
-
/*--------------------------------------------------------------------------*/
|
3616
|
-
|
3617
|
-
Abstract.EventObserver = Class.create({
|
3618
|
-
initialize: function(element, callback) {
|
3619
|
-
this.element = $(element);
|
3620
|
-
this.callback = callback;
|
3621
|
-
|
3622
|
-
this.lastValue = this.getValue();
|
3623
|
-
if (this.element.tagName.toLowerCase() == 'form')
|
3624
|
-
this.registerFormCallbacks();
|
3625
|
-
else
|
3626
|
-
this.registerCallback(this.element);
|
3627
|
-
},
|
3628
|
-
|
3629
|
-
onElementEvent: function() {
|
3630
|
-
var value = this.getValue();
|
3631
|
-
if (this.lastValue != value) {
|
3632
|
-
this.callback(this.element, value);
|
3633
|
-
this.lastValue = value;
|
3634
|
-
}
|
3635
|
-
},
|
3636
|
-
|
3637
|
-
registerFormCallbacks: function() {
|
3638
|
-
Form.getElements(this.element).each(this.registerCallback, this);
|
3639
|
-
},
|
3640
|
-
|
3641
|
-
registerCallback: function(element) {
|
3642
|
-
if (element.type) {
|
3643
|
-
switch (element.type.toLowerCase()) {
|
3644
|
-
case 'checkbox':
|
3645
|
-
case 'radio':
|
3646
|
-
Event.observe(element, 'click', this.onElementEvent.bind(this));
|
3647
|
-
break;
|
3648
|
-
default:
|
3649
|
-
Event.observe(element, 'change', this.onElementEvent.bind(this));
|
3650
|
-
break;
|
3651
|
-
}
|
3652
|
-
}
|
3653
|
-
}
|
3654
|
-
});
|
3655
|
-
|
3656
|
-
Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
|
3657
|
-
getValue: function() {
|
3658
|
-
return Form.Element.getValue(this.element);
|
3659
|
-
}
|
3660
|
-
});
|
3661
|
-
|
3662
|
-
Form.EventObserver = Class.create(Abstract.EventObserver, {
|
3663
|
-
getValue: function() {
|
3664
|
-
return Form.serialize(this.element);
|
3665
|
-
}
|
3666
|
-
});
|
3667
|
-
if (!window.Event) var Event = { };
|
3668
|
-
|
3669
|
-
Object.extend(Event, {
|
3670
|
-
KEY_BACKSPACE: 8,
|
3671
|
-
KEY_TAB: 9,
|
3672
|
-
KEY_RETURN: 13,
|
3673
|
-
KEY_ESC: 27,
|
3674
|
-
KEY_LEFT: 37,
|
3675
|
-
KEY_UP: 38,
|
3676
|
-
KEY_RIGHT: 39,
|
3677
|
-
KEY_DOWN: 40,
|
3678
|
-
KEY_DELETE: 46,
|
3679
|
-
KEY_HOME: 36,
|
3680
|
-
KEY_END: 35,
|
3681
|
-
KEY_PAGEUP: 33,
|
3682
|
-
KEY_PAGEDOWN: 34,
|
3683
|
-
KEY_INSERT: 45,
|
3684
|
-
|
3685
|
-
cache: { },
|
3686
|
-
|
3687
|
-
relatedTarget: function(event) {
|
3688
|
-
var element;
|
3689
|
-
switch(event.type) {
|
3690
|
-
case 'mouseover': element = event.fromElement; break;
|
3691
|
-
case 'mouseout': element = event.toElement; break;
|
3692
|
-
default: return null;
|
3693
|
-
}
|
3694
|
-
return Element.extend(element);
|
3695
|
-
}
|
3696
|
-
});
|
3697
|
-
|
3698
|
-
Event.Methods = {
|
3699
|
-
element: function(event) {
|
3700
|
-
var node = event.target;
|
3701
|
-
return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node);
|
3702
|
-
},
|
3703
|
-
|
3704
|
-
findElement: function(event, expression) {
|
3705
|
-
var element = Event.element(event);
|
3706
|
-
return element.match(expression) ? element : element.up(expression);
|
3707
|
-
},
|
3708
|
-
|
3709
|
-
isLeftClick: function(event) {
|
3710
|
-
return (((event.which) && (event.which == 1)) ||
|
3711
|
-
((event.button) && (event.button == 1)));
|
3712
|
-
},
|
3713
|
-
|
3714
|
-
pointer: function(event) {
|
3715
|
-
return {
|
3716
|
-
x: event.pageX || (event.clientX +
|
3717
|
-
(document.documentElement.scrollLeft || document.body.scrollLeft)),
|
3718
|
-
y: event.pageY || (event.clientY +
|
3719
|
-
(document.documentElement.scrollTop || document.body.scrollTop))
|
3720
|
-
};
|
3721
|
-
},
|
3722
|
-
|
3723
|
-
pointerX: function(event) { return Event.pointer(event).x },
|
3724
|
-
pointerY: function(event) { return Event.pointer(event).y },
|
3725
|
-
|
3726
|
-
stop: function(event) {
|
3727
|
-
event.preventDefault();
|
3728
|
-
event.stopPropagation();
|
3729
|
-
}
|
3730
|
-
};
|
3731
|
-
|
3732
|
-
Event.extend = (function() {
|
3733
|
-
var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
|
3734
|
-
m[name] = Event.Methods[name].methodize();
|
3735
|
-
return m;
|
3736
|
-
});
|
3737
|
-
|
3738
|
-
if (Prototype.Browser.IE) {
|
3739
|
-
Object.extend(methods, {
|
3740
|
-
stopPropagation: function() { this.cancelBubble = true },
|
3741
|
-
preventDefault: function() { this.returnValue = false },
|
3742
|
-
inspect: function() { return "[object Event]" }
|
3743
|
-
});
|
3744
|
-
|
3745
|
-
return function(event) {
|
3746
|
-
if (!event) return false;
|
3747
|
-
if (event._extendedByPrototype) return event;
|
3748
|
-
|
3749
|
-
event._extendedByPrototype = Prototype.emptyFunction;
|
3750
|
-
var pointer = Event.pointer(event);
|
3751
|
-
Object.extend(event, {
|
3752
|
-
target: event.srcElement,
|
3753
|
-
relatedTarget: Event.relatedTarget(event),
|
3754
|
-
pageX: pointer.x,
|
3755
|
-
pageY: pointer.y
|
3756
|
-
});
|
3757
|
-
return Object.extend(event, methods);
|
3758
|
-
};
|
3759
|
-
|
3760
|
-
} else {
|
3761
|
-
Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__;
|
3762
|
-
Object.extend(Event.prototype, methods);
|
3763
|
-
return Prototype.K;
|
3764
|
-
}
|
3765
|
-
})();
|
3766
|
-
|
3767
|
-
Object.extend(Event, (function() {
|
3768
|
-
var cache = Event.cache;
|
3769
|
-
|
3770
|
-
function getEventID(element) {
|
3771
|
-
if (element._eventID) return element._eventID;
|
3772
|
-
arguments.callee.id = arguments.callee.id || 1;
|
3773
|
-
return element._eventID = ++arguments.callee.id;
|
3774
|
-
}
|
3775
|
-
|
3776
|
-
function getDOMEventName(eventName) {
|
3777
|
-
if (eventName && eventName.match(/:/)) return "dataavailable";
|
3778
|
-
return { keypress: "keydown" }[eventName] || eventName;
|
3779
|
-
}
|
3780
|
-
|
3781
|
-
function getCacheForID(id) {
|
3782
|
-
return cache[id] = cache[id] || { };
|
3783
|
-
}
|
3784
|
-
|
3785
|
-
function getWrappersForEventName(id, eventName) {
|
3786
|
-
var c = getCacheForID(id);
|
3787
|
-
return c[eventName] = c[eventName] || [];
|
3788
|
-
}
|
3789
|
-
|
3790
|
-
function createWrapper(element, eventName, handler) {
|
3791
|
-
var id = getEventID(element);
|
3792
|
-
var c = getWrappersForEventName(id, eventName);
|
3793
|
-
if (c.pluck("handler").include(handler)) return false;
|
3794
|
-
|
3795
|
-
var wrapper = function(event) {
|
3796
|
-
if (event.eventName && event.eventName != eventName)
|
3797
|
-
return false;
|
3798
|
-
|
3799
|
-
Event.extend(event);
|
3800
|
-
handler.call(element, event)
|
3801
|
-
};
|
3802
|
-
|
3803
|
-
wrapper.handler = handler;
|
3804
|
-
c.push(wrapper);
|
3805
|
-
return wrapper;
|
3806
|
-
}
|
3807
|
-
|
3808
|
-
function findWrapper(id, eventName, handler) {
|
3809
|
-
var c = getWrappersForEventName(id, eventName);
|
3810
|
-
return c.find(function(wrapper) { return wrapper.handler == handler });
|
3811
|
-
}
|
3812
|
-
|
3813
|
-
function destroyWrapper(id, eventName, handler) {
|
3814
|
-
var c = getCacheForID(id);
|
3815
|
-
if (!c[eventName]) return false;
|
3816
|
-
c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
|
3817
|
-
}
|
3818
|
-
|
3819
|
-
function destroyCache() {
|
3820
|
-
for (var id in cache)
|
3821
|
-
for (var eventName in cache[id])
|
3822
|
-
cache[id][eventName] = null;
|
3823
|
-
}
|
3824
|
-
|
3825
|
-
if (window.attachEvent) {
|
3826
|
-
window.attachEvent("onunload", destroyCache);
|
3827
|
-
}
|
3828
|
-
|
3829
|
-
return {
|
3830
|
-
observe: function(element, eventName, handler) {
|
3831
|
-
element = $(element);
|
3832
|
-
var name = getDOMEventName(eventName);
|
3833
|
-
|
3834
|
-
var wrapper = createWrapper(element, eventName, handler);
|
3835
|
-
if (!wrapper) return element;
|
3836
|
-
|
3837
|
-
if (element.addEventListener) {
|
3838
|
-
element.addEventListener(name, wrapper, false);
|
3839
|
-
} else {
|
3840
|
-
element.attachEvent("on" + name, wrapper);
|
3841
|
-
}
|
3842
|
-
|
3843
|
-
return element;
|
3844
|
-
},
|
3845
|
-
|
3846
|
-
stopObserving: function(element, eventName, handler) {
|
3847
|
-
element = $(element);
|
3848
|
-
var id = getEventID(element), name = getDOMEventName(eventName);
|
3849
|
-
|
3850
|
-
if (!handler && eventName) {
|
3851
|
-
getWrappersForEventName(id, eventName).each(function(wrapper) {
|
3852
|
-
element.stopObserving(eventName, wrapper.handler);
|
3853
|
-
});
|
3854
|
-
return element;
|
3855
|
-
|
3856
|
-
} else if (!eventName) {
|
3857
|
-
Object.keys(getCacheForID(id)).each(function(eventName) {
|
3858
|
-
element.stopObserving(eventName);
|
3859
|
-
});
|
3860
|
-
return element;
|
3861
|
-
}
|
3862
|
-
|
3863
|
-
var wrapper = findWrapper(id, eventName, handler);
|
3864
|
-
if (!wrapper) return element;
|
3865
|
-
|
3866
|
-
if (element.removeEventListener) {
|
3867
|
-
element.removeEventListener(name, wrapper, false);
|
3868
|
-
} else {
|
3869
|
-
element.detachEvent("on" + name, wrapper);
|
3870
|
-
}
|
3871
|
-
|
3872
|
-
destroyWrapper(id, eventName, handler);
|
3873
|
-
|
3874
|
-
return element;
|
3875
|
-
},
|
3876
|
-
|
3877
|
-
fire: function(element, eventName, memo) {
|
3878
|
-
element = $(element);
|
3879
|
-
if (element == document && document.createEvent && !element.dispatchEvent)
|
3880
|
-
element = document.documentElement;
|
3881
|
-
|
3882
|
-
if (document.createEvent) {
|
3883
|
-
var event = document.createEvent("HTMLEvents");
|
3884
|
-
event.initEvent("dataavailable", true, true);
|
3885
|
-
} else {
|
3886
|
-
var event = document.createEventObject();
|
3887
|
-
event.eventType = "ondataavailable";
|
3888
|
-
}
|
3889
|
-
|
3890
|
-
event.eventName = eventName;
|
3891
|
-
event.memo = memo || { };
|
3892
|
-
|
3893
|
-
if (document.createEvent) {
|
3894
|
-
element.dispatchEvent(event);
|
3895
|
-
} else {
|
3896
|
-
element.fireEvent(event.eventType, event);
|
3897
|
-
}
|
3898
|
-
|
3899
|
-
return event;
|
3900
|
-
}
|
3901
|
-
};
|
3902
|
-
})());
|
3903
|
-
|
3904
|
-
Object.extend(Event, Event.Methods);
|
3905
|
-
|
3906
|
-
Element.addMethods({
|
3907
|
-
fire: Event.fire,
|
3908
|
-
observe: Event.observe,
|
3909
|
-
stopObserving: Event.stopObserving
|
3910
|
-
});
|
3911
|
-
|
3912
|
-
Object.extend(document, {
|
3913
|
-
fire: Element.Methods.fire.methodize(),
|
3914
|
-
observe: Element.Methods.observe.methodize(),
|
3915
|
-
stopObserving: Element.Methods.stopObserving.methodize()
|
3916
|
-
});
|
3917
|
-
|
3918
|
-
(function() {
|
3919
|
-
/* Support for the DOMContentLoaded event is based on work by Dan Webb,
|
3920
|
-
Matthias Miller, Dean Edwards and John Resig. */
|
3921
|
-
|
3922
|
-
var timer, fired = false;
|
3923
|
-
|
3924
|
-
function fireContentLoadedEvent() {
|
3925
|
-
if (fired) return;
|
3926
|
-
if (timer) window.clearInterval(timer);
|
3927
|
-
document.fire("dom:loaded");
|
3928
|
-
fired = true;
|
3929
|
-
}
|
3930
|
-
|
3931
|
-
if (document.addEventListener) {
|
3932
|
-
if (Prototype.Browser.WebKit) {
|
3933
|
-
timer = window.setInterval(function() {
|
3934
|
-
if (/loaded|complete/.test(document.readyState))
|
3935
|
-
fireContentLoadedEvent();
|
3936
|
-
}, 0);
|
3937
|
-
|
3938
|
-
Event.observe(window, "load", fireContentLoadedEvent);
|
3939
|
-
|
3940
|
-
} else {
|
3941
|
-
document.addEventListener("DOMContentLoaded",
|
3942
|
-
fireContentLoadedEvent, false);
|
3943
|
-
}
|
3944
|
-
|
3945
|
-
} else {
|
3946
|
-
document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
|
3947
|
-
$("__onDOMContentLoaded").onreadystatechange = function() {
|
3948
|
-
if (this.readyState == "complete") {
|
3949
|
-
this.onreadystatechange = null;
|
3950
|
-
fireContentLoadedEvent();
|
3951
|
-
}
|
3952
|
-
};
|
3953
|
-
}
|
3954
|
-
})();
|
3955
|
-
/*------------------------------- DEPRECATED -------------------------------*/
|
3956
|
-
|
3957
|
-
var Toggle = { display: Element.toggle };
|
3958
|
-
|
3959
|
-
Element.Methods.childOf = Element.Methods.descendantOf;
|
3960
|
-
|
3961
|
-
var Insertion = {
|
3962
|
-
Before: function(element, content) {
|
3963
|
-
return Element.insert(element, {before:content});
|
3964
|
-
},
|
3965
|
-
|
3966
|
-
Top: function(element, content) {
|
3967
|
-
return Element.insert(element, {top:content});
|
3968
|
-
},
|
3969
|
-
|
3970
|
-
Bottom: function(element, content) {
|
3971
|
-
return Element.insert(element, {bottom:content});
|
3972
|
-
},
|
3973
|
-
|
3974
|
-
After: function(element, content) {
|
3975
|
-
return Element.insert(element, {after:content});
|
3976
|
-
}
|
3977
|
-
};
|
3978
|
-
|
3979
|
-
var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
|
3980
|
-
|
3981
|
-
// This should be moved to script.aculo.us; notice the deprecated methods
|
3982
|
-
// further below, that map to the newer Element methods.
|
3983
|
-
var Position = {
|
3984
|
-
// set to true if needed, warning: firefox performance problems
|
3985
|
-
// NOT neeeded for page scrolling, only if draggable contained in
|
3986
|
-
// scrollable elements
|
3987
|
-
includeScrollOffsets: false,
|
3988
|
-
|
3989
|
-
// must be called before calling withinIncludingScrolloffset, every time the
|
3990
|
-
// page is scrolled
|
3991
|
-
prepare: function() {
|
3992
|
-
this.deltaX = window.pageXOffset
|
3993
|
-
|| document.documentElement.scrollLeft
|
3994
|
-
|| document.body.scrollLeft
|
3995
|
-
|| 0;
|
3996
|
-
this.deltaY = window.pageYOffset
|
3997
|
-
|| document.documentElement.scrollTop
|
3998
|
-
|| document.body.scrollTop
|
3999
|
-
|| 0;
|
4000
|
-
},
|
4001
|
-
|
4002
|
-
// caches x/y coordinate pair to use with overlap
|
4003
|
-
within: function(element, x, y) {
|
4004
|
-
if (this.includeScrollOffsets)
|
4005
|
-
return this.withinIncludingScrolloffsets(element, x, y);
|
4006
|
-
this.xcomp = x;
|
4007
|
-
this.ycomp = y;
|
4008
|
-
this.offset = Element.cumulativeOffset(element);
|
4009
|
-
|
4010
|
-
return (y >= this.offset[1] &&
|
4011
|
-
y < this.offset[1] + element.offsetHeight &&
|
4012
|
-
x >= this.offset[0] &&
|
4013
|
-
x < this.offset[0] + element.offsetWidth);
|
4014
|
-
},
|
4015
|
-
|
4016
|
-
withinIncludingScrolloffsets: function(element, x, y) {
|
4017
|
-
var offsetcache = Element.cumulativeScrollOffset(element);
|
4018
|
-
|
4019
|
-
this.xcomp = x + offsetcache[0] - this.deltaX;
|
4020
|
-
this.ycomp = y + offsetcache[1] - this.deltaY;
|
4021
|
-
this.offset = Element.cumulativeOffset(element);
|
4022
|
-
|
4023
|
-
return (this.ycomp >= this.offset[1] &&
|
4024
|
-
this.ycomp < this.offset[1] + element.offsetHeight &&
|
4025
|
-
this.xcomp >= this.offset[0] &&
|
4026
|
-
this.xcomp < this.offset[0] + element.offsetWidth);
|
4027
|
-
},
|
4028
|
-
|
4029
|
-
// within must be called directly before
|
4030
|
-
overlap: function(mode, element) {
|
4031
|
-
if (!mode) return 0;
|
4032
|
-
if (mode == 'vertical')
|
4033
|
-
return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
|
4034
|
-
element.offsetHeight;
|
4035
|
-
if (mode == 'horizontal')
|
4036
|
-
return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
|
4037
|
-
element.offsetWidth;
|
4038
|
-
},
|
4039
|
-
|
4040
|
-
// Deprecation layer -- use newer Element methods now (1.5.2).
|
4041
|
-
|
4042
|
-
cumulativeOffset: Element.Methods.cumulativeOffset,
|
4043
|
-
|
4044
|
-
positionedOffset: Element.Methods.positionedOffset,
|
4045
|
-
|
4046
|
-
absolutize: function(element) {
|
4047
|
-
Position.prepare();
|
4048
|
-
return Element.absolutize(element);
|
4049
|
-
},
|
4050
|
-
|
4051
|
-
relativize: function(element) {
|
4052
|
-
Position.prepare();
|
4053
|
-
return Element.relativize(element);
|
4054
|
-
},
|
4055
|
-
|
4056
|
-
realOffset: Element.Methods.cumulativeScrollOffset,
|
4057
|
-
|
4058
|
-
offsetParent: Element.Methods.getOffsetParent,
|
4059
|
-
|
4060
|
-
page: Element.Methods.viewportOffset,
|
4061
|
-
|
4062
|
-
clone: function(source, target, options) {
|
4063
|
-
options = options || { };
|
4064
|
-
return Element.clonePosition(target, source, options);
|
4065
|
-
}
|
4066
|
-
};
|
4067
|
-
|
4068
|
-
/*--------------------------------------------------------------------------*/
|
4069
|
-
|
4070
|
-
if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
|
4071
|
-
function iter(name) {
|
4072
|
-
return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
|
4073
|
-
}
|
4074
|
-
|
4075
|
-
instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
|
4076
|
-
function(element, className) {
|
4077
|
-
className = className.toString().strip();
|
4078
|
-
var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
|
4079
|
-
return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
|
4080
|
-
} : function(element, className) {
|
4081
|
-
className = className.toString().strip();
|
4082
|
-
var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
|
4083
|
-
if (!classNames && !className) return elements;
|
4084
|
-
|
4085
|
-
var nodes = $(element).getElementsByTagName('*');
|
4086
|
-
className = ' ' + className + ' ';
|
4087
|
-
|
4088
|
-
for (var i = 0, child, cn; child = nodes[i]; i++) {
|
4089
|
-
if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
|
4090
|
-
(classNames && classNames.all(function(name) {
|
4091
|
-
return !name.toString().blank() && cn.include(' ' + name + ' ');
|
4092
|
-
}))))
|
4093
|
-
elements.push(Element.extend(child));
|
4094
|
-
}
|
4095
|
-
return elements;
|
4096
|
-
};
|
4097
|
-
|
4098
|
-
return function(className, parentElement) {
|
4099
|
-
return $(parentElement || document.body).getElementsByClassName(className);
|
4100
|
-
};
|
4101
|
-
}(Element.Methods);
|
4102
|
-
|
4103
|
-
/*--------------------------------------------------------------------------*/
|
4104
|
-
|
4105
|
-
Element.ClassNames = Class.create();
|
4106
|
-
Element.ClassNames.prototype = {
|
4107
|
-
initialize: function(element) {
|
4108
|
-
this.element = $(element);
|
4109
|
-
},
|
4110
|
-
|
4111
|
-
_each: function(iterator) {
|
4112
|
-
this.element.className.split(/\s+/).select(function(name) {
|
4113
|
-
return name.length > 0;
|
4114
|
-
})._each(iterator);
|
4115
|
-
},
|
4116
|
-
|
4117
|
-
set: function(className) {
|
4118
|
-
this.element.className = className;
|
4119
|
-
},
|
4120
|
-
|
4121
|
-
add: function(classNameToAdd) {
|
4122
|
-
if (this.include(classNameToAdd)) return;
|
4123
|
-
this.set($A(this).concat(classNameToAdd).join(' '));
|
4124
|
-
},
|
4125
|
-
|
4126
|
-
remove: function(classNameToRemove) {
|
4127
|
-
if (!this.include(classNameToRemove)) return;
|
4128
|
-
this.set($A(this).without(classNameToRemove).join(' '));
|
4129
|
-
},
|
4130
|
-
|
4131
|
-
toString: function() {
|
4132
|
-
return $A(this).join(' ');
|
4133
|
-
}
|
4134
|
-
};
|
4135
|
-
|
4136
|
-
Object.extend(Element.ClassNames.prototype, Enumerable);
|
4137
|
-
|
4138
|
-
/*--------------------------------------------------------------------------*/
|
4139
|
-
|
4140
|
-
Element.addMethods();
|