radiant 0.8.2 → 0.9.0.rc2
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 +258 -389
- data/CONTRIBUTORS +21 -0
- data/app/controllers/admin/layouts_controller.rb +2 -8
- data/app/controllers/admin/pages_controller.rb +0 -19
- data/app/controllers/admin/preferences_controller.rb +3 -4
- data/app/controllers/admin/references_controller.rb +1 -1
- data/app/controllers/admin/resource_controller.rb +11 -10
- data/app/controllers/admin/snippets_controller.rb +5 -6
- data/app/controllers/admin/users_controller.rb +15 -1
- data/app/controllers/admin/welcome_controller.rb +5 -5
- data/app/controllers/application_controller.rb +34 -2
- data/app/controllers/site_controller.rb +20 -6
- data/app/helpers/admin/layouts_helper.rb +19 -0
- data/app/helpers/admin/node_helper.rb +10 -10
- data/app/helpers/admin/pages_helper.rb +82 -22
- data/app/helpers/admin/references_helper.rb +6 -3
- data/app/helpers/admin/snippets_helper.rb +39 -0
- data/app/helpers/admin/users_helper.rb +2 -2
- data/app/helpers/application_helper.rb +93 -27
- data/app/models/layout.rb +3 -4
- data/app/models/page.rb +35 -20
- data/app/models/page_part.rb +4 -4
- data/app/models/radiant/config.rb +11 -7
- data/app/models/snippet.rb +5 -5
- data/app/models/standard_tags.rb +116 -20
- data/app/models/status.rb +3 -1
- data/app/models/user.rb +37 -33
- data/app/views/admin/extensions/index.html.haml +26 -25
- data/app/views/admin/layouts/_form.html.haml +26 -23
- data/app/views/admin/layouts/edit.html.haml +5 -3
- data/app/views/admin/layouts/index.html.haml +31 -32
- data/app/views/admin/layouts/new.html.haml +4 -2
- data/app/views/admin/layouts/remove.html.haml +9 -9
- data/app/views/admin/page_parts/_page_part.html.haml +11 -10
- data/app/views/admin/pages/_fields.html.haml +42 -48
- data/app/views/admin/pages/_meta_row.html.haml +2 -4
- data/app/views/admin/pages/_node.html.haml +5 -5
- data/app/views/admin/pages/_popups.html.haml +12 -29
- data/app/views/admin/pages/edit.html.haml +6 -3
- data/app/views/admin/pages/index.html.haml +22 -24
- data/app/views/admin/pages/new.html.haml +4 -3
- data/app/views/admin/pages/remove.html.haml +14 -17
- data/app/views/admin/preferences/edit.html.haml +36 -28
- data/app/views/admin/references/_tag_reference.haml +2 -2
- data/app/views/admin/references/filters.haml +6 -0
- data/app/views/admin/references/tags.haml +30 -0
- data/app/views/admin/snippets/_form.html.haml +22 -18
- data/app/views/admin/snippets/edit.html.haml +6 -2
- data/app/views/admin/snippets/index.html.haml +29 -29
- data/app/views/admin/snippets/new.html.haml +4 -2
- data/app/views/admin/snippets/remove.html.haml +9 -11
- data/app/views/admin/users/_avatar.html.haml +3 -0
- data/app/views/admin/users/_form.html.haml +47 -67
- data/app/views/admin/users/_password_fields.html.haml +18 -0
- data/app/views/admin/users/edit.html.haml +5 -1
- data/app/views/admin/users/index.html.haml +33 -30
- data/app/views/admin/users/new.html.haml +2 -1
- data/app/views/admin/users/remove.html.haml +8 -10
- data/app/views/admin/welcome/login.html.haml +19 -58
- data/app/views/layouts/application.html.haml +30 -29
- data/config/boot.rb +1 -1
- data/config/cucumber.yml +7 -0
- data/config/database.db2.yml +4 -1
- data/config/database.mysql.yml +5 -2
- data/config/database.postgresql.yml +5 -2
- data/config/database.sqlite.yml +4 -1
- data/config/database.sqlserver.yml +5 -2
- data/config/environment.rb +14 -2
- data/config/environments/cucumber.rb +29 -0
- data/config/environments/production.rb +6 -1
- data/config/environments/test.rb +6 -3
- data/config/initializers/haml.rb +2 -0
- data/config/initializers/pagination.rb +1 -0
- data/config/locales/en.yml +190 -0
- data/config/locales/en_available_tags.yml +454 -0
- data/config/routes.rb +2 -2
- data/db/migrate/20090226140109_add_user_language.rb +9 -0
- data/db/migrate/20090929164633_rename_developer_role_to_designer.rb +9 -0
- data/db/migrate/20091003095744_change_user_language_to_locale.rb +9 -0
- data/db/schema.rb +3 -2
- data/features/admin/content_negotiation.feature +4 -4
- data/features/admin/layouts_management.feature +2 -2
- data/features/admin/pages_management.feature +31 -17
- data/features/admin/snippets_management.feature +19 -17
- data/features/admin/user_permissions.feature +49 -41
- data/features/admin/user_preferences.feature +6 -6
- data/features/admin/users_management.feature +8 -9
- data/features/page_serving.feature +8 -8
- data/features/step_definitions/admin/admin_steps.rb +8 -2
- data/features/step_definitions/admin/content_negotiation_steps.rb +14 -5
- data/features/step_definitions/admin/pages_management_steps.rb +1 -1
- data/features/step_definitions/admin/users_management_steps.rb +3 -0
- data/features/step_definitions/page_serving_steps.rb +0 -19
- data/features/step_definitions/web_steps.rb +263 -0
- data/features/support/dataset.rb +9 -0
- data/features/support/env.rb +44 -14
- data/features/support/paths.rb +57 -12
- data/lib/generators/extension/extension_generator.rb +29 -1
- data/lib/generators/extension/templates/RSpecRakefile +14 -1
- data/lib/generators/extension/templates/Rakefile +17 -0
- data/lib/generators/extension/templates/en.yml +3 -0
- data/lib/generators/extension/templates/extension.rb +10 -10
- data/lib/generators/extension/templates/routes.rb +5 -0
- data/lib/generators/extension/templates/tasks.rake +27 -0
- data/lib/generators/extension/templates/test_helper.rb +1 -1
- data/lib/generators/instance/instance_generator.rb +3 -2
- data/lib/generators/instance/templates/databases/sqlserver.yml +2 -1
- data/lib/generators/instance/templates/instance_boot.rb +1 -1
- data/lib/generators/instance/templates/instance_environment.rb +8 -1
- data/lib/generators/language_extension/USAGE +27 -0
- data/lib/generators/language_extension/language_extension_generator.rb +49 -0
- data/lib/generators/language_extension/templates/README +3 -0
- data/lib/generators/language_extension/templates/RSpecRakefile +123 -0
- data/lib/generators/language_extension/templates/Rakefile +25 -0
- data/lib/generators/language_extension/templates/available_tags.yml +553 -0
- data/lib/generators/language_extension/templates/cucumber.yml +1 -0
- data/lib/generators/language_extension/templates/cucumber_env.rb +16 -0
- data/lib/generators/language_extension/templates/cucumber_paths.rb +14 -0
- data/lib/generators/language_extension/templates/extension.rb +8 -0
- data/lib/generators/language_extension/templates/functional_test.rb +15 -0
- data/lib/generators/language_extension/templates/lang.yml +181 -0
- data/lib/generators/language_extension/templates/spec.opts +6 -0
- data/lib/generators/language_extension/templates/spec_helper.rb +36 -0
- data/lib/generators/language_extension/templates/tasks.rake +28 -0
- data/lib/generators/language_extension/templates/test_helper.rb +26 -0
- data/lib/login_system.rb +14 -17
- data/lib/radiant.rb +4 -3
- data/lib/radiant/admin_ui.rb +114 -58
- data/lib/radiant/available_locales.rb +31 -0
- data/lib/radiant/cache.rb +12 -0
- data/lib/radiant/extension.rb +29 -3
- data/lib/radiant/extension/script.rb +44 -13
- data/lib/radiant/extension_loader.rb +21 -7
- data/lib/radiant/initializer.rb +23 -23
- data/lib/radiant/pagination/link_renderer.rb +31 -0
- data/lib/radiant/setup.rb +1 -0
- data/lib/radiant/taggable.rb +2 -1
- data/lib/task_support.rb +21 -1
- data/lib/tasks/ci.rake +17 -0
- data/lib/tasks/cucumber.rake +39 -13
- data/lib/tasks/extensions.rake +12 -1
- data/lib/tasks/framework.rake +44 -8
- data/lib/tasks/prototype.rake +34 -0
- data/lib/tasks/release.rake +6 -4
- data/lib/tasks/rspec.rake +7 -7
- data/lib/tasks/translate.rake +59 -0
- data/lib/tasks/undefine.rake +4 -0
- data/lib/translation_support.rb +54 -0
- data/public/images/admin/add_tab.png +0 -0
- data/public/images/admin/avatar_32x32.png +0 -0
- data/public/images/admin/avatar_96x96.png +0 -0
- data/public/images/admin/{brown-bottom-line.gif → brown_bottom_line.gif} +0 -0
- data/public/images/admin/buttons_background.png +0 -0
- data/public/images/admin/calendar_down.gif +0 -0
- data/public/images/admin/collapse.png +0 -0
- data/public/images/admin/draft_page.png +0 -0
- data/public/images/admin/expand.png +0 -0
- data/public/images/admin/layout.png +0 -0
- data/public/images/admin/login_shadow.png +0 -0
- data/public/images/admin/metadata_toggle.png +0 -0
- data/public/images/admin/minus_disabled.png +0 -0
- data/public/images/admin/minus_grey.png +0 -0
- data/public/images/admin/navigation_background.gif +0 -0
- data/public/images/admin/navigation_secondary_background.png +0 -0
- data/public/images/admin/navigation_secondary_separator.gif +0 -0
- data/public/images/admin/navigation_shadow.png +0 -0
- data/public/images/admin/navigation_tabs.png +0 -0
- data/public/images/admin/{new-homepage.png → new_homepage.png} +0 -0
- data/public/images/admin/{new-layout.png → new_layout.png} +0 -0
- data/public/images/admin/{new-snippet.png → new_snippet.png} +0 -0
- data/public/images/admin/{new-user.png → new_user.png} +0 -0
- data/public/images/admin/page.png +0 -0
- data/public/images/admin/plus_grey.png +0 -0
- data/public/images/admin/popup_border_background.png +0 -0
- data/public/images/admin/popup_border_bottom_left.png +0 -0
- data/public/images/admin/popup_border_bottom_right.png +0 -0
- data/public/images/admin/popup_border_top_left.png +0 -0
- data/public/images/admin/popup_border_top_right.png +0 -0
- data/public/images/admin/single_form_shadow.png +0 -0
- data/public/images/admin/snippet.png +0 -0
- data/public/images/admin/spacer.gif +0 -0
- data/public/images/admin/status_background.png +0 -0
- data/public/images/admin/status_bottom_left.png +0 -0
- data/public/images/admin/status_bottom_right.png +0 -0
- data/public/images/admin/status_spinner.gif +0 -0
- data/public/images/admin/status_top_left.png +0 -0
- data/public/images/admin/status_top_right.png +0 -0
- data/public/images/admin/tab_close.png +0 -0
- data/public/images/admin/vertical_tan_gradient.png +0 -0
- data/public/images/admin/view_site.png +0 -0
- data/public/images/admin/virtual_page.png +0 -0
- data/public/images/radiant-badge-color.png +0 -0
- data/public/javascripts/admin/application.js +82 -0
- data/public/javascripts/admin/codearea.js +165 -0
- data/public/javascripts/{controls.js → admin/controls.js} +78 -76
- data/public/javascripts/admin/cookie.js +80 -0
- data/public/javascripts/admin/dateinput.js +402 -0
- data/public/javascripts/{dragdrop.js → admin/dragdrop.js} +167 -166
- data/public/javascripts/{effects.js → admin/effects.js} +168 -174
- data/public/javascripts/admin/lowpro.js +340 -0
- data/public/javascripts/admin/overrides.js +1 -0
- data/public/javascripts/admin/pagestatus.js +17 -0
- data/public/javascripts/admin/popup.js +216 -0
- data/public/javascripts/{prototype.js → admin/prototype.js} +1574 -1020
- data/public/javascripts/admin/ruledtable.js +5 -5
- data/public/javascripts/admin/shortcuts.js +27 -0
- data/public/javascripts/admin/sitemap.js +37 -20
- data/public/javascripts/admin/status.js +233 -0
- data/public/javascripts/admin/tabcontrol.js +88 -100
- data/public/javascripts/admin/toggle.js +430 -0
- data/public/javascripts/admin/utility.js +52 -0
- data/public/stylesheets/admin/main.css +1088 -588
- data/public/stylesheets/admin/overrides.css +1 -0
- data/public/stylesheets/sass/admin/main.sass +26 -0
- data/public/stylesheets/sass/admin/modules/_links.sass +15 -0
- data/public/stylesheets/sass/admin/modules/_opacity.sass +7 -0
- data/public/stylesheets/sass/admin/modules/_rounded.sass +41 -0
- data/public/stylesheets/sass/admin/modules/_shadow.sass +9 -0
- data/public/stylesheets/sass/admin/overrides.sass +2 -0
- data/public/stylesheets/sass/admin/partials/_actions.sass +43 -0
- data/public/stylesheets/sass/admin/partials/_avatars.sass +10 -0
- data/public/stylesheets/sass/admin/partials/_base.sass +59 -0
- data/public/stylesheets/sass/admin/partials/_content.sass +199 -0
- data/public/stylesheets/sass/admin/partials/_dateinput.sass +62 -0
- data/public/stylesheets/sass/admin/partials/_depreciated.sass +26 -0
- data/public/stylesheets/sass/admin/partials/_footer.sass +12 -0
- data/public/stylesheets/sass/admin/partials/_forms.sass +309 -0
- data/public/stylesheets/sass/admin/partials/_header.sass +112 -0
- data/public/stylesheets/sass/admin/partials/_layout.sass +10 -0
- data/public/stylesheets/sass/admin/partials/_messages.sass +10 -0
- data/public/stylesheets/sass/admin/partials/_popup.sass +117 -0
- data/public/stylesheets/sass/admin/partials/_reset.sass +36 -0
- data/public/stylesheets/sass/admin/partials/_tabcontrol.sass +70 -0
- data/public/stylesheets/sass/admin/partials/_toolbar.sass +31 -0
- data/rerun.txt +1 -0
- data/script/cucumber +9 -7
- data/spec/controllers/admin/export_controller_spec.rb +1 -1
- data/spec/controllers/admin/layouts_controller_spec.rb +5 -5
- data/spec/controllers/admin/pages_controller_spec.rb +26 -7
- data/spec/controllers/admin/preferences_controller_spec.rb +5 -6
- data/spec/controllers/admin/references_controller_spec.rb +1 -1
- data/spec/controllers/admin/snippets_controller_spec.rb +6 -6
- data/spec/controllers/admin/users_controller_spec.rb +10 -1
- data/spec/controllers/admin/welcome_controller_spec.rb +3 -3
- data/spec/controllers/application_controller_spec.rb +14 -0
- data/spec/controllers/site_controller_spec.rb +48 -1
- data/spec/datasets/pages_dataset.rb +5 -1
- data/spec/datasets/users_dataset.rb +23 -10
- data/spec/generators/extension_controller_generator_spec.rb +16 -6
- data/spec/generators/extension_generator_spec.rb +49 -18
- data/spec/generators/extension_generators_spec_helper.rb +53 -26
- data/spec/generators/extension_mailer_generator_spec.rb +3 -3
- data/spec/generators/instance_generator_spec.rb +152 -0
- data/spec/helpers/admin/node_helper_spec.rb +8 -8
- data/spec/helpers/admin/references_helper_spec.rb +4 -4
- data/spec/helpers/admin/users_helper_spec.rb +2 -2
- data/spec/helpers/application_helper_spec.rb +68 -32
- data/spec/lib/login_system_spec.rb +1 -1
- data/spec/lib/radiant/admin_ui/nav_tabs_spec.rb +139 -0
- data/spec/lib/radiant/admin_ui_spec.rb +30 -131
- data/spec/lib/radiant/available_locales_spec.rb +13 -0
- data/spec/lib/radiant/extension/script_spec.rb +24 -11
- data/spec/lib/radiant/extension_loader_spec.rb +37 -7
- data/spec/lib/radiant/extension_spec.rb +32 -1
- data/spec/lib/radiant/initializer_spec.rb +32 -2
- data/spec/lib/radiant/taggable_spec.rb +10 -8
- data/spec/lib/radiant_spec.rb +5 -1
- data/spec/lib/task_support_spec.rb +31 -0
- data/spec/lib/translation_support_spec.rb +16 -0
- data/spec/matchers/generator_matchers.rb +145 -147
- data/spec/matchers/render_form_errors_matcher.rb +1 -1
- data/spec/models/page_spec.rb +36 -0
- data/spec/models/radiant/config_spec.rb +2 -2
- data/spec/models/standard_tags_spec.rb +96 -26
- data/spec/models/user_spec.rb +32 -8
- data/test/fixtures/extensions/{01_basic → basic}/app/controllers/basic_extension_controller.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/app/metal/basic_metal.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/app/models/basic_extension_mailer.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/app/models/basic_extension_model.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/app/views/basic_extension/index.html.erb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/app/views/basic_extension/override.html.erb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/app/views/basic_extension_mailer/message.text.html.erb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/basic_extension.rb +3 -4
- data/test/fixtures/extensions/{01_basic → basic}/db/migrate/200812131420_create_initial_schema.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/db/migrate/200812131421_modify_initial_schema.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/lib/new_module.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/vendor/plugins/multiple/init.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/vendor/plugins/multiple/lib/multiple.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/vendor/plugins/plugin_normal/init.rb +0 -0
- data/test/fixtures/extensions/{01_basic → basic}/vendor/plugins/plugin_normal/lib/normal_plugin.rb +0 -0
- data/test/fixtures/extensions/load_order_blue/load_order_blue_extension.rb +0 -3
- data/test/fixtures/extensions/load_order_green/load_order_green_extension.rb +0 -3
- data/test/fixtures/extensions/load_order_red/load_order_red_extension.rb +0 -3
- data/test/fixtures/extensions/locale/config/locales/en-uk.yml +3 -0
- data/test/fixtures/extensions/locale/config/locales/en.yml +3 -0
- data/test/fixtures/extensions/locale/locale_extension.rb +5 -0
- data/test/fixtures/extensions/{02_overriding → overriding}/app/metal/basic_metal.rb +0 -0
- data/test/fixtures/extensions/{02_overriding → overriding}/app/views/basic_extension/override.html.erb +0 -0
- data/test/fixtures/extensions/{02_overriding → overriding}/overriding_extension.rb +0 -3
- data/test/fixtures/extensions/{02_overriding → overriding}/vendor/plugins/multiple/init.rb +0 -0
- data/test/fixtures/extensions/{02_overriding → overriding}/vendor/plugins/multiple/lib/multiple.rb +0 -0
- data/test/fixtures/extensions/routed/config/routes.rb +1 -0
- data/test/fixtures/extensions/routed/routed_extension.rb +2 -0
- data/test/fixtures/extensions/{03_upgrading → upgrading}/db/migrate/01_first.rb +0 -0
- data/test/fixtures/extensions/{03_upgrading → upgrading}/db/migrate/02_second.rb +0 -0
- data/test/fixtures/extensions/{03_upgrading → upgrading}/db/migrate/03_pending.rb +0 -0
- data/test/fixtures/extensions/{03_upgrading → upgrading}/db/migrate/04_dont_run.rb +0 -0
- data/test/fixtures/extensions/{03_upgrading → upgrading}/upgrading_extension.rb +0 -0
- data/test/fixtures/gems/misnamed_ext-0.0.0/misnamed_ext_extension.rb +2 -0
- data/test/fixtures/gems/radiant-gem_ext-extension-0.0.0/gem_ext_extension.rb +2 -0
- data/test/fixtures/gems/radiant-gem_ext-extension-0.0.0/lib/gem_ext.rb +3 -0
- data/test/test_helper.rb +1 -1
- data/vendor/extensions/archive/archive_extension.rb +1 -1
- data/vendor/extensions/dutch_language_pack/README +3 -0
- data/vendor/extensions/dutch_language_pack/Rakefile +123 -0
- data/vendor/extensions/dutch_language_pack/config/locales/nl.yml +187 -0
- data/vendor/extensions/dutch_language_pack/config/locales/nl_available_tags.yml +553 -0
- data/vendor/extensions/dutch_language_pack/dutch_language_pack_extension.rb +9 -0
- data/vendor/extensions/dutch_language_pack/lib/tasks/i18n_nl_extension_tasks.rake +28 -0
- data/vendor/extensions/french_language_pack/README +3 -0
- data/vendor/extensions/french_language_pack/Rakefile +123 -0
- data/vendor/extensions/french_language_pack/config/locales/fr.yml +184 -0
- data/vendor/extensions/french_language_pack/config/locales/fr_available_tags.yml +553 -0
- data/vendor/extensions/french_language_pack/french_language_pack_extension.rb +9 -0
- data/vendor/extensions/french_language_pack/lib/tasks/i18n_fr_extension_tasks.rake +28 -0
- data/vendor/extensions/german_language_pack/README +3 -0
- data/vendor/extensions/german_language_pack/Rakefile +123 -0
- data/vendor/extensions/german_language_pack/config/locales/de.yml +184 -0
- data/vendor/extensions/german_language_pack/config/locales/de_available_tags.yml +553 -0
- data/vendor/extensions/german_language_pack/german_language_pack_extension.rb +9 -0
- data/vendor/extensions/german_language_pack/lib/tasks/i18n_de_extension_tasks.rake +28 -0
- data/vendor/extensions/italian_language_pack/README +3 -0
- data/vendor/extensions/italian_language_pack/Rakefile +123 -0
- data/vendor/extensions/italian_language_pack/config/locales/it.yml +184 -0
- data/vendor/extensions/italian_language_pack/config/locales/it_available_tags.yml +553 -0
- data/vendor/extensions/italian_language_pack/italian_language_pack_extension.rb +8 -0
- data/vendor/extensions/italian_language_pack/lib/tasks/i18n_it_extension_tasks.rake +28 -0
- data/vendor/extensions/japanese_language_pack/README +3 -0
- data/vendor/extensions/japanese_language_pack/Rakefile +123 -0
- data/vendor/extensions/japanese_language_pack/config/locales/ja.yml +184 -0
- data/vendor/extensions/japanese_language_pack/config/locales/ja_available_tags.yml +553 -0
- data/vendor/extensions/japanese_language_pack/japanese_language_pack_extension.rb +9 -0
- data/vendor/extensions/japanese_language_pack/lib/tasks/i18n_ja_extension_tasks.rake +28 -0
- data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +5 -1
- data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +4 -4
- data/vendor/extensions/markdown_filter/markdown.html +122 -122
- data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +2 -2
- data/vendor/extensions/markdown_filter/smartypants.html +47 -47
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/AUTHORS +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/COPYING +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/ChangeLog +2624 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/GPL +674 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/README +20 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/Rakefile +283 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/VERSION +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/benchmark.rb +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/generate_data.rb +110 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-jruby-1.4.0.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.6.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.7.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.1p243.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.2dev.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/mdbasics.text +306 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/mdsyntax.text +888 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-jruby-1.4.0.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.8.6.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.8.7.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.9.1p243.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.9.2dev.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/testing.sh +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/timing.sh +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/bin/kramdown +71 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.css +293 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.template +78 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/index.page +91 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/installation.page +90 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/news.feed +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/news.page +27 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/quickref.page +551 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/syntax.page +1451 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/tests.page +51 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/virtual +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown.rb +23 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/compatibility.rb +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter.rb +36 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/base.rb +75 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/html.rb +325 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/latex.rb +516 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/document.rb +145 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/error.rb +27 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/options.rb +262 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser.rb +33 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown.rb +292 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/attribute_list.rb +102 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/autolink.rb +42 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blank_line.rb +43 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blockquote.rb +42 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codeblock.rb +58 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codespan.rb +57 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/emphasis.rb +69 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/eob.rb +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/escaped_chars.rb +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/extension.rb +109 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/footnote.rb +73 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/header.rb +81 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/horizontal_rule.rb +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html.rb +253 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html_entity.rb +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/line_break.rb +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/link.rb +153 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/list.rb +225 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/paragraph.rb +44 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/smart_quotes.rb +213 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/table.rb +125 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/typographic_symbol.rb +48 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/version.rb +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/setup.rb +1585 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/run_tests.rb +58 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/test_files.rb +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/spaces.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/spaces.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/tabs.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/tabs.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/beginning.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/beginning.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/end.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/end.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/middle.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/middle.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/indented.html +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/indented.text +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/no_newline_at_end.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/no_newline_at_end.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/one_para.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/one_para.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/two_para.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/two_para.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header.html +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header.text +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header_no_newline_at_end.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header_no_newline_at_end.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header.html +31 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header.text +36 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header_no_newline_at_end.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header_no_newline_at_end.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_ids.html +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_ids.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_ids.text +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/indented.html +25 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/indented.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/nested.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/nested.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/no_newline_at_end.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/no_newline_at_end.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/only_first_quoted.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/only_first_quoted.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/with_code_blocks.html +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/with_code_blocks.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/error.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/error.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/no_newline_at_end.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/no_newline_at_end.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/normal.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/normal.text +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/tilde_syntax.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/tilde_syntax.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/whitespace.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/whitespace.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_blank_line.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_blank_line.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_eob_marker.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_eob_marker.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/error.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/error.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/normal.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/normal.text +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/sepspaces.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/sepspaces.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/septabs.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/septabs.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/escaping.html +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/escaping.text +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_hr.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_hr.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_others.html +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_others.text +25 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/mixed.html +111 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/mixed.text +66 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/nested.html +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/nested.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/other_first_element.html +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/other_first_element.text +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ol.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ol.text +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ul.html +61 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ul.text +43 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/single_item.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/single_item.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.html +29 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.text +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/deflists.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/deflists.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/deflists.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.html +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/filtered_html.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/filtered_html.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/filtered_html.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_and_codeblocks.html +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_and_codeblocks.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_and_codeblocks.text +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_1.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_1.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_2.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_2.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/markdown_attr.html +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/markdown_attr.text +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/not_parsed.html +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/not_parsed.text +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.html +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.text +30 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_span.html +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_span.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_span.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_block_html.html +21 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_block_html.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_block_html.text +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/processing_instruction.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/processing_instruction.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/simple.html +62 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/simple.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/simple.text +57 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/10_ald/simple.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/10_ald/simple.text +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.html +20 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.text +27 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/comment.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/comment.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/nomarkdown.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/nomarkdown.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.html +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.text +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options2.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options2.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options3.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options3.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/definition_at_beginning.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/definition_at_beginning.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/multiple_terms.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/multiple_terms.text +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/no_def_list.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/no_def_list.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/para_wrapping.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/para_wrapping.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/separated_by_eob.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/separated_by_eob.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/simple.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/simple.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/styled_terms.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/styled_terms.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/too_much_space.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/too_much_space.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/with_blocks.html +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/with_blocks.text +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/errors.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/errors.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/footer.html +65 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/footer.text +25 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/header.html +103 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/header.text +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/no_table.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/no_table.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/simple.html +61 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/simple.text +16 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/encoding.html +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/encoding.text +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/empty.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/empty.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/image_in_a.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/image_in_a.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/imagelinks.html +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/imagelinks.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/inline.html +40 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/inline.text +42 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/link_defs.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/link_defs.text +22 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/links_with_angle_brackets.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/links_with_angle_brackets.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/reference.html +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/reference.text +42 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/empty.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/empty.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/errors.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/errors.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.html +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.text +30 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/normal.html +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/normal.text +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/empty.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/empty.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/errors.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/errors.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/normal.html +16 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/normal.text +16 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/definitions.html +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/definitions.text +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.html +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/markers.html +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/markers.text +26 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/across_lines.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/across_lines.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/link_with_mailto.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/link_with_mailto.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/markdown_attr.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/markdown_attr.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/normal.html +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/normal.text +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/escaped_chars/normal.html +41 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/escaped_chars/normal.text +41 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/line_breaks/normal.html +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/line_breaks/normal.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/entities.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/entities.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/greaterthan.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/greaterthan.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/lowerthan.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/lowerthan.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.html +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.text +15 -0
- data/vendor/extensions/russian_language_pack/README +3 -0
- data/vendor/extensions/russian_language_pack/Rakefile +123 -0
- data/vendor/extensions/russian_language_pack/config/locales/ru.yml +180 -0
- data/vendor/extensions/russian_language_pack/config/locales/ru_available_tags.yml +553 -0
- data/vendor/extensions/russian_language_pack/lib/tasks/i18n_ru_extension_tasks.rake +28 -0
- data/vendor/extensions/russian_language_pack/russian_language_pack_extension.rb +9 -0
- data/vendor/extensions/textile_filter/textile.html +114 -114
- data/vendor/plugins/dataset/lib/dataset/extensions/cucumber.rb +5 -4
- data/vendor/plugins/dataset/lib/dataset/load.rb +0 -10
- data/vendor/plugins/dataset/lib/dataset/session.rb +4 -20
- data/vendor/plugins/dataset/lib/dataset/session_binding.rb +5 -15
- data/vendor/plugins/haml/CONTRIBUTING +4 -0
- data/vendor/plugins/haml/MIT-LICENSE +1 -1
- data/vendor/plugins/haml/README.md +357 -0
- data/vendor/plugins/haml/Rakefile +233 -26
- data/vendor/plugins/haml/TODO +47 -0
- data/vendor/plugins/haml/VERSION +1 -1
- data/vendor/plugins/haml/VERSION_NAME +1 -0
- data/vendor/plugins/haml/doc-src/FAQ.md +175 -0
- data/vendor/plugins/haml/doc-src/HAML_CHANGELOG.md +479 -0
- data/vendor/plugins/haml/doc-src/HAML_REFERENCE.md +1184 -0
- data/vendor/plugins/haml/doc-src/SASS_CHANGELOG.md +695 -0
- data/vendor/plugins/haml/doc-src/SASS_REFERENCE.md +1150 -0
- data/vendor/plugins/haml/extra/haml-mode.el +514 -97
- data/vendor/plugins/haml/extra/sass-mode.el +155 -38
- data/vendor/plugins/haml/extra/update_watch.rb +13 -0
- data/vendor/plugins/haml/haml.gemspec +51 -0
- data/vendor/plugins/haml/init.rb +11 -3
- data/vendor/plugins/haml/lib/haml.rb +15 -993
- data/vendor/plugins/haml/lib/haml/buffer.rb +147 -85
- data/vendor/plugins/haml/lib/haml/engine.rb +137 -103
- data/vendor/plugins/haml/lib/haml/error.rb +7 -7
- data/vendor/plugins/haml/lib/haml/exec.rb +141 -45
- data/vendor/plugins/haml/lib/haml/filters.rb +108 -43
- data/vendor/plugins/haml/lib/haml/helpers.rb +267 -168
- data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb +48 -38
- data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +135 -138
- data/vendor/plugins/haml/lib/haml/helpers/xss_mods.rb +125 -0
- data/vendor/plugins/haml/lib/haml/html.rb +146 -100
- data/vendor/plugins/haml/lib/haml/precompiler.rb +528 -277
- data/vendor/plugins/haml/lib/haml/shared.rb +78 -0
- data/vendor/plugins/haml/lib/haml/template.rb +49 -15
- data/vendor/plugins/haml/lib/haml/template/patch.rb +2 -2
- data/vendor/plugins/haml/lib/haml/template/plugin.rb +9 -6
- data/vendor/plugins/haml/lib/haml/util.rb +299 -6
- data/vendor/plugins/haml/lib/haml/version.rb +30 -13
- data/vendor/plugins/haml/lib/sass.rb +7 -856
- data/vendor/plugins/haml/lib/sass/css.rb +171 -161
- data/vendor/plugins/haml/lib/sass/engine.rb +365 -316
- data/vendor/plugins/haml/lib/sass/environment.rb +79 -0
- data/vendor/plugins/haml/lib/sass/error.rb +33 -11
- data/vendor/plugins/haml/lib/sass/files.rb +147 -0
- data/vendor/plugins/haml/lib/sass/plugin.rb +177 -123
- data/vendor/plugins/haml/lib/sass/plugin/merb.rb +9 -16
- data/vendor/plugins/haml/lib/sass/plugin/rack.rb +65 -0
- data/vendor/plugins/haml/lib/sass/plugin/rails.rb +15 -15
- data/vendor/plugins/haml/lib/sass/repl.rb +58 -0
- data/vendor/plugins/haml/lib/sass/script.rb +62 -0
- data/vendor/plugins/haml/lib/sass/script/bool.rb +17 -0
- data/vendor/plugins/haml/lib/sass/script/color.rb +222 -0
- data/vendor/plugins/haml/lib/sass/script/funcall.rb +50 -0
- data/vendor/plugins/haml/lib/sass/script/functions.rb +257 -0
- data/vendor/plugins/haml/lib/sass/script/lexer.rb +194 -0
- data/vendor/plugins/haml/lib/sass/script/literal.rb +177 -0
- data/vendor/plugins/haml/lib/sass/script/node.rb +14 -0
- data/vendor/plugins/haml/lib/sass/script/number.rb +383 -0
- data/vendor/plugins/haml/lib/sass/script/operation.rb +45 -0
- data/vendor/plugins/haml/lib/sass/script/parser.rb +222 -0
- data/vendor/plugins/haml/lib/sass/script/string.rb +12 -0
- data/vendor/plugins/haml/lib/sass/script/unary_operation.rb +34 -0
- data/vendor/plugins/haml/lib/sass/script/variable.rb +31 -0
- data/vendor/plugins/haml/lib/sass/tree/comment_node.rb +74 -10
- data/vendor/plugins/haml/lib/sass/tree/debug_node.rb +30 -0
- data/vendor/plugins/haml/lib/sass/tree/directive_node.rb +39 -17
- data/vendor/plugins/haml/lib/sass/tree/for_node.rb +48 -0
- data/vendor/plugins/haml/lib/sass/tree/if_node.rb +54 -0
- data/vendor/plugins/haml/lib/sass/tree/import_node.rb +65 -0
- data/vendor/plugins/haml/lib/sass/tree/mixin_def_node.rb +29 -0
- data/vendor/plugins/haml/lib/sass/tree/mixin_node.rb +48 -0
- data/vendor/plugins/haml/lib/sass/tree/node.rb +216 -11
- data/vendor/plugins/haml/lib/sass/tree/prop_node.rb +121 -0
- data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +182 -51
- data/vendor/plugins/haml/lib/sass/tree/variable_node.rb +34 -0
- data/vendor/plugins/haml/lib/sass/tree/while_node.rb +31 -0
- data/vendor/plugins/haml/test/haml/engine_test.rb +659 -44
- data/vendor/plugins/haml/test/haml/helper_test.rb +60 -2
- data/vendor/plugins/haml/test/haml/html2haml_test.rb +60 -0
- data/vendor/plugins/haml/test/haml/results/content_for_layout.xhtml +0 -3
- data/vendor/plugins/haml/test/haml/results/filters.xhtml +2 -0
- data/vendor/plugins/haml/test/haml/results/just_stuff.xhtml +3 -3
- data/vendor/plugins/haml/test/haml/results/list.xhtml +1 -1
- data/vendor/plugins/haml/test/haml/results/standard.xhtml +120 -0
- data/vendor/plugins/haml/test/haml/rhtml/standard.rhtml +2 -2
- data/vendor/plugins/haml/test/haml/template_test.rb +117 -11
- data/vendor/plugins/haml/test/haml/templates/content_for_layout.haml +0 -2
- data/vendor/plugins/haml/test/haml/templates/list.haml +1 -1
- data/vendor/plugins/haml/test/haml/templates/standard.haml +2 -2
- data/vendor/plugins/haml/test/haml/templates/standard_ugly.haml +2 -2
- data/vendor/plugins/haml/test/haml/util_test.rb +107 -0
- data/vendor/plugins/haml/test/linked_rails.rb +11 -2
- data/vendor/plugins/haml/test/sass/css2sass_test.rb +83 -24
- data/vendor/plugins/haml/test/sass/engine_test.rb +743 -67
- data/vendor/plugins/haml/test/sass/functions_test.rb +174 -0
- data/vendor/plugins/haml/test/sass/more_results/more1.css +9 -0
- data/vendor/plugins/haml/test/sass/more_results/more1_with_line_comments.css +26 -0
- data/vendor/plugins/haml/test/sass/more_results/more_import.css +29 -0
- data/vendor/plugins/haml/test/sass/more_templates/_more_partial.sass +2 -0
- data/vendor/plugins/haml/test/sass/more_templates/more1.sass +23 -0
- data/vendor/plugins/haml/test/sass/more_templates/more_import.sass +11 -0
- data/vendor/plugins/haml/test/sass/plugin_test.rb +130 -48
- data/vendor/plugins/haml/test/sass/results/line_numbers.css +49 -0
- data/vendor/plugins/haml/test/sass/results/script.css +16 -0
- data/vendor/plugins/haml/test/sass/results/subdir/subdir.css +2 -0
- data/vendor/plugins/haml/test/sass/results/units.css +11 -0
- data/vendor/plugins/haml/test/sass/script_test.rb +267 -0
- data/vendor/plugins/haml/test/sass/templates/complex.sass +0 -3
- data/vendor/plugins/haml/test/sass/templates/import.sass +2 -2
- data/vendor/plugins/haml/test/sass/templates/importee.sass +7 -2
- data/vendor/plugins/haml/test/sass/templates/line_numbers.sass +13 -0
- data/vendor/plugins/haml/test/sass/templates/script.sass +101 -0
- data/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass +2 -2
- data/vendor/plugins/haml/test/sass/templates/units.sass +11 -0
- data/vendor/plugins/haml/test/test_helper.rb +26 -4
- data/vendor/plugins/haml/yard/default/fulldoc/html/css/common.sass +22 -0
- data/vendor/plugins/haml/yard/default/layout/html/footer.erb +12 -0
- data/vendor/plugins/haml/yard/inherited_hash.rb +41 -0
- data/vendor/radius/CHANGELOG +8 -0
- data/vendor/radius/Manifest.txt +21 -0
- data/vendor/radius/{QUICKSTART → QUICKSTART.rdoc} +11 -12
- data/vendor/radius/{README → README.rdoc} +38 -17
- data/vendor/radius/Rakefile +31 -86
- data/vendor/radius/lib/radius.rb +10 -502
- data/vendor/radius/lib/radius/context.rb +139 -0
- data/vendor/radius/lib/radius/delegating_open_struct.rb +31 -0
- data/vendor/radius/lib/radius/error.rb +43 -0
- data/vendor/radius/lib/radius/parse_tag.rb +24 -0
- data/vendor/radius/lib/radius/parser.rb +65 -0
- data/vendor/radius/lib/radius/parser/scan.rb +1247 -0
- data/vendor/radius/lib/radius/parser/scan.rl +123 -0
- data/vendor/radius/lib/radius/tag_binding.rb +71 -0
- data/vendor/radius/lib/radius/tag_definitions.rb +78 -0
- data/vendor/radius/lib/radius/utility.rb +30 -0
- data/vendor/radius/lib/radius/version.rb +14 -0
- data/vendor/radius/radius.gemspec +38 -0
- data/vendor/radius/tasks/scan.rake +27 -0
- data/vendor/radius/test/context_test.rb +61 -0
- data/vendor/radius/test/{radius_test.rb → parser_test.rb} +45 -82
- data/vendor/radius/test/quickstart_test.rb +153 -0
- data/vendor/radius/test/test_helper.rb +28 -0
- data/vendor/rails/Rakefile +81 -0
- data/vendor/rails/actionmailer/CHANGELOG +4 -0
- data/vendor/rails/actionmailer/Rakefile +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +2 -0
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionmailer/lib/actionmailer.rb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_service_test.rb +3 -1
- data/vendor/rails/actionpack/CHANGELOG +12 -0
- data/vendor/rails/actionpack/Rakefile +1 -1
- data/vendor/rails/actionpack/lib/action_controller.rb +3 -1
- data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +19 -3
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +16 -10
- data/vendor/rails/actionpack/lib/action_controller/base.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +2 -1
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +3 -2
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +15 -3
- data/vendor/rails/actionpack/lib/action_controller/layout.rb +6 -1
- data/vendor/rails/actionpack/lib/action_controller/middlewares.rb +2 -0
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +6 -21
- data/vendor/rails/actionpack/lib/action_controller/rack_lint_patch.rb +36 -0
- data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +6 -2
- data/vendor/rails/actionpack/lib/action_controller/response.rb +2 -1
- data/vendor/rails/actionpack/lib/action_controller/string_coercion.rb +29 -0
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +6 -1
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/translation.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/uploaded_file.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/base.rb +6 -1
- data/vendor/rails/actionpack/lib/action_view/erb/util.rb +6 -0
- data/vendor/rails/actionpack/lib/action_view/helpers.rb +2 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +27 -15
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +32 -11
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +6 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/raw_output_helper.rb +9 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +10 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +4 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/locale/en.yml +3 -0
- data/vendor/rails/actionpack/lib/action_view/partials.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/safe_buffer.rb +28 -0
- data/vendor/rails/actionpack/lib/action_view/template.rb +8 -2
- data/vendor/rails/actionpack/lib/action_view/test_case.rb +102 -27
- data/vendor/rails/actionpack/lib/actionpack.rb +1 -0
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +7 -0
- data/vendor/rails/actionpack/test/controller/dom_assertions_test.rb +53 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +1 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +1 -0
- data/vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb +22 -0
- data/vendor/rails/actionpack/test/controller/integration_test.rb +38 -0
- data/vendor/rails/actionpack/test/controller/layout_test.rb +11 -0
- data/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +4 -0
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +19 -1
- data/vendor/rails/actionpack/test/controller/routing_test.rb +23 -15
- data/vendor/rails/actionpack/test/controller/session/test_session_test.rb +2 -2
- data/vendor/rails/actionpack/test/fixtures/layout_tests/abs_path_layout.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_from_helper.erb +1 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +1 -1
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +12 -0
- data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +6 -6
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +2 -1
- data/vendor/rails/actionpack/test/template/date_helper_i18n_test.rb +10 -9
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +29 -13
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +90 -10
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +4 -0
- data/vendor/rails/actionpack/test/template/raw_output_helper_test.rb +21 -0
- data/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +10 -1
- data/vendor/rails/actionpack/test/template/tag_helper_test.rb +1 -0
- data/vendor/rails/actionpack/test/view/safe_buffer_test.rb +36 -0
- data/vendor/rails/actionpack/test/view/test_case_test.rb +173 -5
- data/vendor/rails/activemodel/CHANGES +12 -0
- data/vendor/rails/activemodel/README +21 -0
- data/vendor/rails/activemodel/Rakefile +24 -0
- data/vendor/rails/activemodel/lib/active_model.rb +5 -0
- data/vendor/rails/activemodel/lib/active_model/base.rb +8 -0
- data/vendor/rails/activemodel/lib/active_model/callbacks.rb +7 -0
- data/vendor/rails/activemodel/lib/active_model/core.rb +7 -0
- data/vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb +38 -0
- data/vendor/rails/activemodel/lib/active_model/errors.rb +82 -0
- data/vendor/rails/activemodel/lib/active_model/observing.rb +98 -0
- data/vendor/rails/activemodel/lib/active_model/state_machine.rb +68 -0
- data/vendor/rails/activemodel/lib/active_model/state_machine/event.rb +64 -0
- data/vendor/rails/activemodel/lib/active_model/state_machine/machine.rb +78 -0
- data/vendor/rails/activemodel/lib/active_model/state_machine/state.rb +47 -0
- data/vendor/rails/activemodel/lib/active_model/state_machine/state_transition.rb +40 -0
- data/vendor/rails/activemodel/lib/active_model/validations.rb +126 -0
- data/vendor/rails/activemodel/lib/active_model/validations/acceptance.rb +45 -0
- data/vendor/rails/activemodel/lib/active_model/validations/associated.rb +46 -0
- data/vendor/rails/activemodel/lib/active_model/validations/confirmation.rb +44 -0
- data/vendor/rails/activemodel/lib/active_model/validations/exclusion.rb +37 -0
- data/vendor/rails/activemodel/lib/active_model/validations/format.rb +39 -0
- data/vendor/rails/activemodel/lib/active_model/validations/inclusion.rb +37 -0
- data/vendor/rails/activemodel/lib/active_model/validations/length.rb +95 -0
- data/vendor/rails/activemodel/lib/active_model/validations/numericality.rb +80 -0
- data/vendor/rails/activemodel/lib/active_model/validations/presence.rb +42 -0
- data/vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb +104 -0
- data/vendor/rails/activemodel/test/observing_test.rb +121 -0
- data/vendor/rails/activemodel/test/state_machine/event_test.rb +49 -0
- data/vendor/rails/activemodel/test/state_machine/machine_test.rb +43 -0
- data/vendor/rails/activemodel/test/state_machine/state_test.rb +72 -0
- data/vendor/rails/activemodel/test/state_machine/state_transition_test.rb +84 -0
- data/vendor/rails/activemodel/test/state_machine_test.rb +312 -0
- data/vendor/rails/activemodel/test/test_helper.rb +21 -0
- data/vendor/rails/activerecord/CHANGELOG +8 -0
- data/vendor/rails/activerecord/MIT-LICENSE +20 -0
- data/vendor/rails/activerecord/Rakefile +1 -1
- data/vendor/rails/activerecord/lib/active_record/associations.rb +10 -7
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +7 -8
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +9 -0
- data/vendor/rails/activerecord/lib/active_record/autosave_association.rb +32 -23
- data/vendor/rails/activerecord/lib/active_record/base.rb +7 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +6 -2
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +0 -33
- data/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +0 -22
- data/vendor/rails/activerecord/lib/active_record/nested_attributes.rb +101 -38
- data/vendor/rails/activerecord/lib/active_record/validations.rb +35 -35
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/lib/activerecord.rb +1 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +12 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +22 -0
- data/vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb +21 -0
- data/vendor/rails/activerecord/test/cases/autosave_association_test.rb +230 -11
- data/vendor/rails/activerecord/test/cases/base_test.rb +2 -0
- data/vendor/rails/activerecord/test/cases/connection_test_mysql.rb +8 -0
- data/vendor/rails/activerecord/test/cases/fixtures_test.rb +2 -2
- data/vendor/rails/activerecord/test/cases/locking_test.rb +0 -18
- data/vendor/rails/activerecord/test/cases/nested_attributes_test.rb +109 -37
- data/vendor/rails/activerecord/test/cases/reflection_test.rb +3 -3
- data/vendor/rails/activerecord/test/cases/validations_i18n_test.rb +8 -0
- data/vendor/rails/activerecord/test/cases/validations_test.rb +37 -9
- data/vendor/rails/activerecord/test/fixtures/accounts.yml +1 -0
- data/vendor/rails/activerecord/test/models/company.rb +10 -0
- data/vendor/rails/activerecord/test/models/pirate.rb +9 -2
- data/vendor/rails/activerecord/test/models/treasure.rb +2 -0
- data/vendor/rails/activerecord/test/schema/mysql_specific_schema.rb +12 -0
- data/vendor/rails/activerecord/test/schema/schema.rb +1 -0
- data/vendor/rails/activeresource/CHANGELOG +9 -0
- data/vendor/rails/activeresource/MIT-LICENSE +20 -0
- data/vendor/rails/activeresource/Rakefile +1 -1
- 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/lib/activeresource.rb +1 -0
- data/vendor/rails/activeresource/test/base_errors_test.rb +2 -2
- data/vendor/rails/activesupport/CHANGELOG +8 -0
- data/vendor/rails/activesupport/MIT-LICENSE +20 -0
- data/vendor/rails/activesupport/Rakefile +175 -0
- data/vendor/rails/activesupport/bin/generate_tables +147 -0
- data/vendor/rails/activesupport/install.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/cache.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb +5 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext.rb +7 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +2 -58
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/blank.rb +58 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb +48 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/json/backends/jsongem.rb +2 -3
- data/vendor/rails/activesupport/lib/active_support/json/backends/yaml.rb +1 -5
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/message_verifier.rb +30 -10
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/multibyte/utils.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +8 -2
- data/vendor/rails/activesupport/lib/active_support/xml_mini/nokogiri.rb +13 -21
- data/vendor/rails/activesupport/lib/activesupport.rb +1 -0
- data/vendor/rails/activesupport/test/abstract_unit.rb +36 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +1 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +3 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +3 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +7 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +1 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +5 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +4 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +1 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +2 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +3 -0
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +3 -0
- data/vendor/rails/activesupport/test/buffered_logger_test.rb +146 -0
- data/vendor/rails/activesupport/test/caching_test.rb +348 -0
- data/vendor/rails/activesupport/test/callbacks_test.rb +188 -0
- data/vendor/rails/activesupport/test/clean_backtrace_test.rb +47 -0
- data/vendor/rails/activesupport/test/clean_logger_test.rb +57 -0
- data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +363 -0
- data/vendor/rails/activesupport/test/core_ext/base64_ext_test.rb +8 -0
- data/vendor/rails/activesupport/test/core_ext/bigdecimal.rb +10 -0
- data/vendor/rails/activesupport/test/core_ext/blank_test.rb +24 -0
- data/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +14 -0
- data/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +31 -0
- data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +224 -0
- data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +115 -0
- data/vendor/rails/activesupport/test/core_ext/class_test.rb +46 -0
- data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +278 -0
- data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +359 -0
- data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +22 -0
- data/vendor/rails/activesupport/test/core_ext/duration_test.rb +121 -0
- data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +97 -0
- data/vendor/rails/activesupport/test/core_ext/exception_test.rb +68 -0
- data/vendor/rails/activesupport/test/core_ext/file_test.rb +67 -0
- data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +25 -0
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +1014 -0
- data/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +37 -0
- data/vendor/rails/activesupport/test/core_ext/kernel_test.rb +43 -0
- data/vendor/rails/activesupport/test/core_ext/load_error_test.rb +16 -0
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +30 -0
- data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +52 -0
- data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +33 -0
- data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +58 -0
- data/vendor/rails/activesupport/test/core_ext/module/model_naming_test.rb +27 -0
- data/vendor/rails/activesupport/test/core_ext/module/synchronization_test.rb +85 -0
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +363 -0
- data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +20 -0
- data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +162 -0
- data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +282 -0
- data/vendor/rails/activesupport/test/core_ext/object_ext_test.rb +8 -0
- data/vendor/rails/activesupport/test/core_ext/pathname_test.rb +9 -0
- data/vendor/rails/activesupport/test/core_ext/proc_test.rb +11 -0
- data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +63 -0
- data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +369 -0
- data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +9 -0
- data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +744 -0
- data/vendor/rails/activesupport/test/core_ext/time_with_zone_test.rb +845 -0
- data/vendor/rails/activesupport/test/core_ext/uri_ext_test.rb +12 -0
- data/vendor/rails/activesupport/test/dependencies/check_warnings.rb +2 -0
- data/vendor/rails/activesupport/test/dependencies/conflict.rb +1 -0
- data/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +3 -0
- data/vendor/rails/activesupport/test/dependencies/mutual_one.rb +4 -0
- data/vendor/rails/activesupport/test/dependencies/mutual_two.rb +4 -0
- data/vendor/rails/activesupport/test/dependencies/raises_exception.rb +3 -0
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +1 -0
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +1 -0
- data/vendor/rails/activesupport/test/dependencies/service_one.rb +5 -0
- data/vendor/rails/activesupport/test/dependencies/service_two.rb +2 -0
- data/vendor/rails/activesupport/test/dependencies_test.rb +782 -0
- data/vendor/rails/activesupport/test/deprecation_test.rb +167 -0
- data/vendor/rails/activesupport/test/flush_cache_on_private_memoization_test.rb +43 -0
- data/vendor/rails/activesupport/test/gzip_test.rb +7 -0
- data/vendor/rails/activesupport/test/i18n_test.rb +98 -0
- data/vendor/rails/activesupport/test/inflector_test.rb +298 -0
- data/vendor/rails/activesupport/test/inflector_test_cases.rb +252 -0
- data/vendor/rails/activesupport/test/json/decoding_test.rb +73 -0
- data/vendor/rails/activesupport/test/json/encoding_test.rb +160 -0
- data/vendor/rails/activesupport/test/memoizable_test.rb +247 -0
- data/vendor/rails/activesupport/test/message_encryptor_test.rb +46 -0
- data/vendor/rails/activesupport/test/message_verifier_test.rb +31 -0
- data/vendor/rails/activesupport/test/multibyte_chars_test.rb +606 -0
- data/vendor/rails/activesupport/test/multibyte_conformance.rb +129 -0
- data/vendor/rails/activesupport/test/multibyte_test_helpers.rb +19 -0
- data/vendor/rails/activesupport/test/multibyte_unicode_database_test.rb +22 -0
- data/vendor/rails/activesupport/test/multibyte_utils_test.rb +137 -0
- data/vendor/rails/activesupport/test/option_merger_test.rb +85 -0
- data/vendor/rails/activesupport/test/ordered_hash_test.rb +201 -0
- data/vendor/rails/activesupport/test/ordered_options_test.rb +53 -0
- data/vendor/rails/activesupport/test/rescuable_test.rb +75 -0
- data/vendor/rails/activesupport/test/secure_random_test.rb +19 -0
- data/vendor/rails/activesupport/test/string_inquirer_test.rb +15 -0
- data/vendor/rails/activesupport/test/test_test.rb +148 -0
- data/vendor/rails/activesupport/test/time_zone_test.rb +266 -0
- data/vendor/rails/activesupport/test/whiny_nil_test.rb +50 -0
- data/vendor/rails/activesupport/test/xml_mini/jdom_engine_test.rb +153 -0
- data/vendor/rails/activesupport/test/xml_mini/nokogiri_engine_test.rb +168 -0
- data/vendor/rails/activesupport/test/xml_mini/rexml_engine_test.rb +15 -0
- data/vendor/rails/ci/ci_build.rb +119 -0
- data/vendor/rails/ci/ci_setup_notes.txt +131 -0
- data/vendor/rails/ci/cruise_config.rb +9 -0
- data/vendor/rails/ci/geminstaller.yml +24 -0
- data/vendor/rails/ci/site.css +13 -0
- data/vendor/rails/ci/site_config.rb +72 -0
- data/vendor/rails/doc/template/horo.rb +613 -0
- data/vendor/rails/pushgems.rb +14 -0
- data/vendor/rails/railties/CHANGELOG +6 -0
- data/vendor/rails/railties/Rakefile +6 -6
- data/vendor/rails/railties/lib/commands/plugin.rb +1 -1
- data/vendor/rails/railties/lib/rails/rack/debugger.rb +2 -0
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/options.rb +7 -7
- data/vendor/rails/railties/lib/tasks/rails.rb +2 -1
- data/vendor/rails/railties/test/abstract_unit.rb +27 -0
- data/vendor/rails/railties/test/backtrace_cleaner_test.rb +61 -0
- data/vendor/rails/railties/test/boot_test.rb +178 -0
- data/vendor/rails/railties/test/console_app_test.rb +42 -0
- data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +266 -0
- data/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +1 -0
- data/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +1 -0
- data/vendor/rails/railties/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +1 -0
- data/vendor/rails/railties/test/fixtures/eager/zoo.rb +3 -0
- data/vendor/rails/railties/test/fixtures/eager/zoo/reptile_house.rb +2 -0
- data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +1 -0
- data/vendor/{extensions/markdown_filter/lib/tasks/textile_filter_extension_tasks.rake → 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 +2 -0
- data/vendor/rails/railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb +5 -0
- data/vendor/rails/railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb +5 -0
- data/vendor/rails/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb +5 -0
- data/vendor/rails/railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb +5 -0
- data/vendor/rails/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb +7 -0
- data/vendor/rails/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb +7 -0
- data/vendor/rails/railties/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +4 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/init.rb +1 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/lib/gemlike.rb +2 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/rails/init.rb +7 -0
- 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/about.yml +2 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +4 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +7 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +2 -0
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/controllers/engine_controller.rb +2 -0
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/metal/engine_metal.rb +10 -0
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/models/engine_model.rb +2 -0
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/config/locales/en.yml +2 -0
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/config/routes.rb +3 -0
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/init.rb +3 -0
- data/vendor/rails/railties/test/fixtures/public/foo/bar.html +1 -0
- data/vendor/rails/railties/test/fixtures/public/foo/index.html +1 -0
- data/vendor/rails/railties/test/fixtures/public/index.html +1 -0
- data/vendor/rails/railties/test/gem_dependency_test.rb +219 -0
- data/vendor/rails/railties/test/generator_lookup_test.rb +40 -0
- data/vendor/rails/railties/test/generators/generator_test_helper.rb +310 -0
- data/vendor/rails/railties/test/generators/rails_controller_generator_test.rb +44 -0
- data/vendor/rails/railties/test/generators/rails_helper_generator_test.rb +36 -0
- data/vendor/rails/railties/test/generators/rails_mailer_generator_test.rb +29 -0
- data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +96 -0
- data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +29 -0
- data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +151 -0
- data/vendor/rails/railties/test/generators/rails_template_runner_test.rb +216 -0
- data/vendor/rails/railties/test/initializer_test.rb +416 -0
- data/vendor/rails/railties/test/metal_test.rb +72 -0
- data/vendor/rails/railties/test/mocks/routes.rb +6 -0
- data/vendor/rails/railties/test/plugin_loader_test.rb +172 -0
- data/vendor/rails/railties/test/plugin_locator_test.rb +62 -0
- data/vendor/rails/railties/test/plugin_test.rb +162 -0
- data/vendor/rails/railties/test/plugin_test_helper.rb +29 -0
- data/vendor/rails/railties/test/rack_static_test.rb +46 -0
- data/vendor/rails/railties/test/rails_generator_test.rb +145 -0
- data/vendor/rails/railties/test/rails_info_controller_test.rb +52 -0
- data/vendor/rails/railties/test/rails_info_test.rb +99 -0
- data/vendor/rails/railties/test/secret_key_generation_test.rb +38 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-a-0.4.0/lib/dummy-gem-a.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-b-0.4.0/lib/dummy-gem-b.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-b-0.6.0/lib/dummy-gem-b.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-c-0.4.0/lib/dummy-gem-c.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-c-0.6.0/lib/dummy-gem-c.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-d-1.0.0/lib/dummy-gem-d.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-e-1.0.0/lib/dummy-gem-e.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-f-1.0.0/lib/dummy-gem-f.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-g-1.0.0/lib/dummy-gem-g.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-i-1.0.0/ext/dummy-gem-i/Makefile +0 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb +1 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb +1 -0
- data/vendor/rails/release.rb +25 -0
- metadata +814 -84
- data/app/views/admin/pages/_edit_styles.html.haml +0 -15
- data/app/views/admin/references/filters.js.erb +0 -5
- data/app/views/admin/references/tags.js.erb +0 -5
- data/features/step_definitions/webrat_steps.rb +0 -117
- data/public/images/admin/add-child.png +0 -0
- data/public/images/admin/clear-page-cache.png +0 -0
- data/public/images/admin/remove-disabled.png +0 -0
- data/public/images/admin/remove.png +0 -0
- data/public/images/admin/view-site.gif +0 -0
- data/public/images/admin/virtual-page.png +0 -0
- data/public/javascripts/admin/admin.js +0 -149
- data/public/javascripts/application.js +0 -2
- data/public/javascripts/pngfix.js +0 -39
- data/public/javascripts/string.js +0 -17
- data/vendor/extensions/markdown_filter/vendor/bluecloth/CHANGES +0 -366
- data/vendor/extensions/markdown_filter/vendor/bluecloth/LICENSE +0 -340
- data/vendor/extensions/markdown_filter/vendor/bluecloth/README +0 -99
- data/vendor/extensions/markdown_filter/vendor/bluecloth/bin/bluecloth +0 -83
- data/vendor/extensions/markdown_filter/vendor/bluecloth/install.rb +0 -150
- data/vendor/extensions/markdown_filter/vendor/bluecloth/lib/bluecloth.rb +0 -1144
- data/vendor/extensions/markdown_filter/vendor/bluecloth/test.rb +0 -117
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/00_Class.tests.rb +0 -71
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/05_Markdown.tests.rb +0 -1527
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/10_Bug.tests.rb +0 -57
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/15_Contrib.tests.rb +0 -132
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/bctestcase.rb +0 -274
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/antsugar.txt +0 -34
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/ml-announce.txt +0 -17
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/re-overflow.txt +0 -67
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/re-overflow2.txt +0 -281
- data/vendor/extensions/markdown_filter/vendor/bluecloth/utils.rb +0 -553
- data/vendor/radius/ROADMAP +0 -12
- data/vendor/rails/activerecord/test/fixtures/fixture_database.sqlite +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database.sqlite3 +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite3 +0 -0
- data/vendor/rails/activeresource/test/debug.log +0 -7974
@@ -1,5 +1,5 @@
|
|
1
|
-
/* Prototype JavaScript framework, version 1.6.
|
2
|
-
* (c) 2005-
|
1
|
+
/* Prototype JavaScript framework, version 1.6.1
|
2
|
+
* (c) 2005-2009 Sam Stephenson
|
3
3
|
*
|
4
4
|
* Prototype is freely distributable under the terms of an MIT-style license.
|
5
5
|
* For details, see the Prototype web site: http://www.prototypejs.org/
|
@@ -7,26 +7,43 @@
|
|
7
7
|
*--------------------------------------------------------------------------*/
|
8
8
|
|
9
9
|
var Prototype = {
|
10
|
-
Version: '1.6.
|
11
|
-
|
12
|
-
Browser: {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
10
|
+
Version: '1.6.1',
|
11
|
+
|
12
|
+
Browser: (function(){
|
13
|
+
var ua = navigator.userAgent;
|
14
|
+
var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
|
15
|
+
return {
|
16
|
+
IE: !!window.attachEvent && !isOpera,
|
17
|
+
Opera: isOpera,
|
18
|
+
WebKit: ua.indexOf('AppleWebKit/') > -1,
|
19
|
+
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
|
20
|
+
MobileSafari: /Apple.*Mobile.*Safari/.test(ua)
|
21
|
+
}
|
22
|
+
})(),
|
21
23
|
|
22
24
|
BrowserFeatures: {
|
23
25
|
XPath: !!document.evaluate,
|
24
26
|
SelectorsAPI: !!document.querySelector,
|
25
|
-
ElementExtensions:
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
ElementExtensions: (function() {
|
28
|
+
var constructor = window.Element || window.HTMLElement;
|
29
|
+
return !!(constructor && constructor.prototype);
|
30
|
+
})(),
|
31
|
+
SpecificElementExtensions: (function() {
|
32
|
+
if (typeof window.HTMLDivElement !== 'undefined')
|
33
|
+
return true;
|
34
|
+
|
35
|
+
var div = document.createElement('div');
|
36
|
+
var form = document.createElement('form');
|
37
|
+
var isSupported = false;
|
38
|
+
|
39
|
+
if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
|
40
|
+
isSupported = true;
|
41
|
+
}
|
42
|
+
|
43
|
+
div = form = null;
|
44
|
+
|
45
|
+
return isSupported;
|
46
|
+
})()
|
30
47
|
},
|
31
48
|
|
32
49
|
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
|
@@ -40,9 +57,30 @@ if (Prototype.Browser.MobileSafari)
|
|
40
57
|
Prototype.BrowserFeatures.SpecificElementExtensions = false;
|
41
58
|
|
42
59
|
|
60
|
+
var Abstract = { };
|
61
|
+
|
62
|
+
|
63
|
+
var Try = {
|
64
|
+
these: function() {
|
65
|
+
var returnValue;
|
66
|
+
|
67
|
+
for (var i = 0, length = arguments.length; i < length; i++) {
|
68
|
+
var lambda = arguments[i];
|
69
|
+
try {
|
70
|
+
returnValue = lambda();
|
71
|
+
break;
|
72
|
+
} catch (e) { }
|
73
|
+
}
|
74
|
+
|
75
|
+
return returnValue;
|
76
|
+
}
|
77
|
+
};
|
78
|
+
|
43
79
|
/* Based on Alex Arnell's inheritance implementation. */
|
44
|
-
|
45
|
-
|
80
|
+
|
81
|
+
var Class = (function() {
|
82
|
+
function subclass() {};
|
83
|
+
function create() {
|
46
84
|
var parent = null, properties = $A(arguments);
|
47
85
|
if (Object.isFunction(properties[0]))
|
48
86
|
parent = properties.shift();
|
@@ -56,7 +94,6 @@ var Class = {
|
|
56
94
|
klass.subclasses = [];
|
57
95
|
|
58
96
|
if (parent) {
|
59
|
-
var subclass = function() { };
|
60
97
|
subclass.prototype = parent.prototype;
|
61
98
|
klass.prototype = new subclass;
|
62
99
|
parent.subclasses.push(klass);
|
@@ -69,18 +106,19 @@ var Class = {
|
|
69
106
|
klass.prototype.initialize = Prototype.emptyFunction;
|
70
107
|
|
71
108
|
klass.prototype.constructor = klass;
|
72
|
-
|
73
109
|
return klass;
|
74
110
|
}
|
75
|
-
};
|
76
111
|
|
77
|
-
|
78
|
-
addMethods: function(source) {
|
112
|
+
function addMethods(source) {
|
79
113
|
var ancestor = this.superclass && this.superclass.prototype;
|
80
114
|
var properties = Object.keys(source);
|
81
115
|
|
82
|
-
if (!Object.keys({ toString: true }).length)
|
83
|
-
|
116
|
+
if (!Object.keys({ toString: true }).length) {
|
117
|
+
if (source.toString != Object.prototype.toString)
|
118
|
+
properties.push("toString");
|
119
|
+
if (source.valueOf != Object.prototype.valueOf)
|
120
|
+
properties.push("valueOf");
|
121
|
+
}
|
84
122
|
|
85
123
|
for (var i = 0, length = properties.length; i < length; i++) {
|
86
124
|
var property = properties[i], value = source[property];
|
@@ -88,7 +126,7 @@ Class.Methods = {
|
|
88
126
|
value.argumentNames().first() == "$super") {
|
89
127
|
var method = value;
|
90
128
|
value = (function(m) {
|
91
|
-
return function() { return ancestor[m].apply(this, arguments) };
|
129
|
+
return function() { return ancestor[m].apply(this, arguments); };
|
92
130
|
})(property).wrap(method);
|
93
131
|
|
94
132
|
value.valueOf = method.valueOf.bind(method);
|
@@ -99,29 +137,36 @@ Class.Methods = {
|
|
99
137
|
|
100
138
|
return this;
|
101
139
|
}
|
102
|
-
};
|
103
140
|
|
104
|
-
|
141
|
+
return {
|
142
|
+
create: create,
|
143
|
+
Methods: {
|
144
|
+
addMethods: addMethods
|
145
|
+
}
|
146
|
+
};
|
147
|
+
})();
|
148
|
+
(function() {
|
105
149
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
150
|
+
var _toString = Object.prototype.toString;
|
151
|
+
|
152
|
+
function extend(destination, source) {
|
153
|
+
for (var property in source)
|
154
|
+
destination[property] = source[property];
|
155
|
+
return destination;
|
156
|
+
}
|
111
157
|
|
112
|
-
|
113
|
-
inspect: function(object) {
|
158
|
+
function inspect(object) {
|
114
159
|
try {
|
115
|
-
if (
|
160
|
+
if (isUndefined(object)) return 'undefined';
|
116
161
|
if (object === null) return 'null';
|
117
162
|
return object.inspect ? object.inspect() : String(object);
|
118
163
|
} catch (e) {
|
119
164
|
if (e instanceof RangeError) return '...';
|
120
165
|
throw e;
|
121
166
|
}
|
122
|
-
}
|
167
|
+
}
|
123
168
|
|
124
|
-
toJSON
|
169
|
+
function toJSON(object) {
|
125
170
|
var type = typeof object;
|
126
171
|
switch (type) {
|
127
172
|
case 'undefined':
|
@@ -132,131 +177,180 @@ Object.extend(Object, {
|
|
132
177
|
|
133
178
|
if (object === null) return 'null';
|
134
179
|
if (object.toJSON) return object.toJSON();
|
135
|
-
if (
|
180
|
+
if (isElement(object)) return;
|
136
181
|
|
137
182
|
var results = [];
|
138
183
|
for (var property in object) {
|
139
|
-
var value =
|
140
|
-
if (!
|
184
|
+
var value = toJSON(object[property]);
|
185
|
+
if (!isUndefined(value))
|
141
186
|
results.push(property.toJSON() + ': ' + value);
|
142
187
|
}
|
143
188
|
|
144
189
|
return '{' + results.join(', ') + '}';
|
145
|
-
}
|
190
|
+
}
|
146
191
|
|
147
|
-
toQueryString
|
192
|
+
function toQueryString(object) {
|
148
193
|
return $H(object).toQueryString();
|
149
|
-
}
|
194
|
+
}
|
150
195
|
|
151
|
-
toHTML
|
196
|
+
function toHTML(object) {
|
152
197
|
return object && object.toHTML ? object.toHTML() : String.interpret(object);
|
153
|
-
}
|
198
|
+
}
|
154
199
|
|
155
|
-
keys
|
156
|
-
var
|
200
|
+
function keys(object) {
|
201
|
+
var results = [];
|
157
202
|
for (var property in object)
|
158
|
-
|
159
|
-
return
|
160
|
-
}
|
203
|
+
results.push(property);
|
204
|
+
return results;
|
205
|
+
}
|
161
206
|
|
162
|
-
values
|
163
|
-
var
|
207
|
+
function values(object) {
|
208
|
+
var results = [];
|
164
209
|
for (var property in object)
|
165
|
-
|
166
|
-
return
|
167
|
-
}
|
210
|
+
results.push(object[property]);
|
211
|
+
return results;
|
212
|
+
}
|
168
213
|
|
169
|
-
clone
|
170
|
-
return
|
171
|
-
}
|
214
|
+
function clone(object) {
|
215
|
+
return extend({ }, object);
|
216
|
+
}
|
172
217
|
|
173
|
-
isElement
|
218
|
+
function isElement(object) {
|
174
219
|
return !!(object && object.nodeType == 1);
|
175
|
-
}
|
220
|
+
}
|
221
|
+
|
222
|
+
function isArray(object) {
|
223
|
+
return _toString.call(object) == "[object Array]";
|
224
|
+
}
|
176
225
|
|
177
|
-
isArray: function(object) {
|
178
|
-
return object != null && typeof object == "object" &&
|
179
|
-
'splice' in object && 'join' in object;
|
180
|
-
},
|
181
226
|
|
182
|
-
isHash
|
227
|
+
function isHash(object) {
|
183
228
|
return object instanceof Hash;
|
184
|
-
}
|
229
|
+
}
|
185
230
|
|
186
|
-
isFunction
|
187
|
-
return typeof object
|
188
|
-
}
|
231
|
+
function isFunction(object) {
|
232
|
+
return typeof object === "function";
|
233
|
+
}
|
189
234
|
|
190
|
-
isString
|
191
|
-
return
|
192
|
-
}
|
235
|
+
function isString(object) {
|
236
|
+
return _toString.call(object) == "[object String]";
|
237
|
+
}
|
193
238
|
|
194
|
-
isNumber
|
195
|
-
return
|
196
|
-
}
|
239
|
+
function isNumber(object) {
|
240
|
+
return _toString.call(object) == "[object Number]";
|
241
|
+
}
|
197
242
|
|
198
|
-
isUndefined
|
199
|
-
return typeof object
|
243
|
+
function isUndefined(object) {
|
244
|
+
return typeof object === "undefined";
|
245
|
+
}
|
246
|
+
|
247
|
+
extend(Object, {
|
248
|
+
extend: extend,
|
249
|
+
inspect: inspect,
|
250
|
+
toJSON: toJSON,
|
251
|
+
toQueryString: toQueryString,
|
252
|
+
toHTML: toHTML,
|
253
|
+
keys: keys,
|
254
|
+
values: values,
|
255
|
+
clone: clone,
|
256
|
+
isElement: isElement,
|
257
|
+
isArray: isArray,
|
258
|
+
isHash: isHash,
|
259
|
+
isFunction: isFunction,
|
260
|
+
isString: isString,
|
261
|
+
isNumber: isNumber,
|
262
|
+
isUndefined: isUndefined
|
263
|
+
});
|
264
|
+
})();
|
265
|
+
Object.extend(Function.prototype, (function() {
|
266
|
+
var slice = Array.prototype.slice;
|
267
|
+
|
268
|
+
function update(array, args) {
|
269
|
+
var arrayLength = array.length, length = args.length;
|
270
|
+
while (length--) array[arrayLength + length] = args[length];
|
271
|
+
return array;
|
272
|
+
}
|
273
|
+
|
274
|
+
function merge(array, args) {
|
275
|
+
array = slice.call(array, 0);
|
276
|
+
return update(array, args);
|
200
277
|
}
|
201
|
-
});
|
202
278
|
|
203
|
-
|
204
|
-
|
205
|
-
|
279
|
+
function argumentNames() {
|
280
|
+
var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
|
281
|
+
.replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
|
206
282
|
.replace(/\s+/g, '').split(',');
|
207
283
|
return names.length == 1 && !names[0] ? [] : names;
|
208
|
-
}
|
284
|
+
}
|
209
285
|
|
210
|
-
bind
|
286
|
+
function bind(context) {
|
211
287
|
if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
|
212
|
-
var __method = this, args =
|
288
|
+
var __method = this, args = slice.call(arguments, 1);
|
213
289
|
return function() {
|
214
|
-
|
290
|
+
var a = merge(args, arguments);
|
291
|
+
return __method.apply(context, a);
|
215
292
|
}
|
216
|
-
}
|
293
|
+
}
|
217
294
|
|
218
|
-
bindAsEventListener
|
219
|
-
var __method = this, args =
|
295
|
+
function bindAsEventListener(context) {
|
296
|
+
var __method = this, args = slice.call(arguments, 1);
|
220
297
|
return function(event) {
|
221
|
-
|
298
|
+
var a = update([event || window.event], args);
|
299
|
+
return __method.apply(context, a);
|
222
300
|
}
|
223
|
-
}
|
301
|
+
}
|
224
302
|
|
225
|
-
curry
|
303
|
+
function curry() {
|
226
304
|
if (!arguments.length) return this;
|
227
|
-
var __method = this, args =
|
305
|
+
var __method = this, args = slice.call(arguments, 0);
|
228
306
|
return function() {
|
229
|
-
|
307
|
+
var a = merge(args, arguments);
|
308
|
+
return __method.apply(this, a);
|
230
309
|
}
|
231
|
-
}
|
310
|
+
}
|
232
311
|
|
233
|
-
delay
|
234
|
-
var __method = this, args =
|
312
|
+
function delay(timeout) {
|
313
|
+
var __method = this, args = slice.call(arguments, 1);
|
314
|
+
timeout = timeout * 1000
|
235
315
|
return window.setTimeout(function() {
|
236
316
|
return __method.apply(__method, args);
|
237
317
|
}, timeout);
|
238
|
-
}
|
318
|
+
}
|
239
319
|
|
240
|
-
defer
|
241
|
-
var args = [0.01]
|
320
|
+
function defer() {
|
321
|
+
var args = update([0.01], arguments);
|
242
322
|
return this.delay.apply(this, args);
|
243
|
-
}
|
323
|
+
}
|
244
324
|
|
245
|
-
wrap
|
325
|
+
function wrap(wrapper) {
|
246
326
|
var __method = this;
|
247
327
|
return function() {
|
248
|
-
|
328
|
+
var a = update([__method.bind(this)], arguments);
|
329
|
+
return wrapper.apply(this, a);
|
249
330
|
}
|
250
|
-
}
|
331
|
+
}
|
251
332
|
|
252
|
-
methodize
|
333
|
+
function methodize() {
|
253
334
|
if (this._methodized) return this._methodized;
|
254
335
|
var __method = this;
|
255
336
|
return this._methodized = function() {
|
256
|
-
|
337
|
+
var a = update([this], arguments);
|
338
|
+
return __method.apply(null, a);
|
257
339
|
};
|
258
340
|
}
|
259
|
-
|
341
|
+
|
342
|
+
return {
|
343
|
+
argumentNames: argumentNames,
|
344
|
+
bind: bind,
|
345
|
+
bindAsEventListener: bindAsEventListener,
|
346
|
+
curry: curry,
|
347
|
+
delay: delay,
|
348
|
+
defer: defer,
|
349
|
+
wrap: wrap,
|
350
|
+
methodize: methodize
|
351
|
+
}
|
352
|
+
})());
|
353
|
+
|
260
354
|
|
261
355
|
Date.prototype.toJSON = function() {
|
262
356
|
return '"' + this.getUTCFullYear() + '-' +
|
@@ -267,30 +361,12 @@ Date.prototype.toJSON = function() {
|
|
267
361
|
this.getUTCSeconds().toPaddedString(2) + 'Z"';
|
268
362
|
};
|
269
363
|
|
270
|
-
var Try = {
|
271
|
-
these: function() {
|
272
|
-
var returnValue;
|
273
|
-
|
274
|
-
for (var i = 0, length = arguments.length; i < length; i++) {
|
275
|
-
var lambda = arguments[i];
|
276
|
-
try {
|
277
|
-
returnValue = lambda();
|
278
|
-
break;
|
279
|
-
} catch (e) { }
|
280
|
-
}
|
281
|
-
|
282
|
-
return returnValue;
|
283
|
-
}
|
284
|
-
};
|
285
364
|
|
286
365
|
RegExp.prototype.match = RegExp.prototype.test;
|
287
366
|
|
288
367
|
RegExp.escape = function(str) {
|
289
368
|
return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
290
369
|
};
|
291
|
-
|
292
|
-
/*--------------------------------------------------------------------------*/
|
293
|
-
|
294
370
|
var PeriodicalExecuter = Class.create({
|
295
371
|
initialize: function(callback, frequency) {
|
296
372
|
this.callback = callback;
|
@@ -319,8 +395,10 @@ var PeriodicalExecuter = Class.create({
|
|
319
395
|
try {
|
320
396
|
this.currentlyExecuting = true;
|
321
397
|
this.execute();
|
322
|
-
} finally {
|
323
398
|
this.currentlyExecuting = false;
|
399
|
+
} catch(e) {
|
400
|
+
this.currentlyExecuting = false;
|
401
|
+
throw e;
|
324
402
|
}
|
325
403
|
}
|
326
404
|
}
|
@@ -339,10 +417,25 @@ Object.extend(String, {
|
|
339
417
|
}
|
340
418
|
});
|
341
419
|
|
342
|
-
Object.extend(String.prototype, {
|
343
|
-
|
420
|
+
Object.extend(String.prototype, (function() {
|
421
|
+
|
422
|
+
function prepareReplacement(replacement) {
|
423
|
+
if (Object.isFunction(replacement)) return replacement;
|
424
|
+
var template = new Template(replacement);
|
425
|
+
return function(match) { return template.evaluate(match) };
|
426
|
+
}
|
427
|
+
|
428
|
+
function gsub(pattern, replacement) {
|
344
429
|
var result = '', source = this, match;
|
345
|
-
replacement =
|
430
|
+
replacement = prepareReplacement(replacement);
|
431
|
+
|
432
|
+
if (Object.isString(pattern))
|
433
|
+
pattern = RegExp.escape(pattern);
|
434
|
+
|
435
|
+
if (!(pattern.length || pattern.source)) {
|
436
|
+
replacement = replacement('');
|
437
|
+
return replacement + source.split('').join(replacement) + replacement;
|
438
|
+
}
|
346
439
|
|
347
440
|
while (source.length > 0) {
|
348
441
|
if (match = source.match(pattern)) {
|
@@ -354,69 +447,64 @@ Object.extend(String.prototype, {
|
|
354
447
|
}
|
355
448
|
}
|
356
449
|
return result;
|
357
|
-
}
|
450
|
+
}
|
358
451
|
|
359
|
-
sub
|
360
|
-
replacement =
|
452
|
+
function sub(pattern, replacement, count) {
|
453
|
+
replacement = prepareReplacement(replacement);
|
361
454
|
count = Object.isUndefined(count) ? 1 : count;
|
362
455
|
|
363
456
|
return this.gsub(pattern, function(match) {
|
364
457
|
if (--count < 0) return match[0];
|
365
458
|
return replacement(match);
|
366
459
|
});
|
367
|
-
}
|
460
|
+
}
|
368
461
|
|
369
|
-
scan
|
462
|
+
function scan(pattern, iterator) {
|
370
463
|
this.gsub(pattern, iterator);
|
371
464
|
return String(this);
|
372
|
-
}
|
465
|
+
}
|
373
466
|
|
374
|
-
truncate
|
467
|
+
function truncate(length, truncation) {
|
375
468
|
length = length || 30;
|
376
469
|
truncation = Object.isUndefined(truncation) ? '...' : truncation;
|
377
470
|
return this.length > length ?
|
378
471
|
this.slice(0, length - truncation.length) + truncation : String(this);
|
379
|
-
}
|
472
|
+
}
|
380
473
|
|
381
|
-
strip
|
474
|
+
function strip() {
|
382
475
|
return this.replace(/^\s+/, '').replace(/\s+$/, '');
|
383
|
-
}
|
476
|
+
}
|
384
477
|
|
385
|
-
stripTags
|
386
|
-
return this.replace(
|
387
|
-
}
|
478
|
+
function stripTags() {
|
479
|
+
return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
|
480
|
+
}
|
388
481
|
|
389
|
-
stripScripts
|
482
|
+
function stripScripts() {
|
390
483
|
return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
|
391
|
-
}
|
484
|
+
}
|
392
485
|
|
393
|
-
extractScripts
|
486
|
+
function extractScripts() {
|
394
487
|
var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
|
395
488
|
var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
|
396
489
|
return (this.match(matchAll) || []).map(function(scriptTag) {
|
397
490
|
return (scriptTag.match(matchOne) || ['', ''])[1];
|
398
491
|
});
|
399
|
-
}
|
492
|
+
}
|
400
493
|
|
401
|
-
evalScripts
|
494
|
+
function evalScripts() {
|
402
495
|
return this.extractScripts().map(function(script) { return eval(script) });
|
403
|
-
}
|
496
|
+
}
|
404
497
|
|
405
|
-
escapeHTML
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
498
|
+
function escapeHTML() {
|
499
|
+
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
500
|
+
}
|
501
|
+
|
502
|
+
function unescapeHTML() {
|
503
|
+
return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');
|
504
|
+
}
|
410
505
|
|
411
|
-
unescapeHTML: function() {
|
412
|
-
var div = new Element('div');
|
413
|
-
div.innerHTML = this.stripTags();
|
414
|
-
return div.childNodes[0] ? (div.childNodes.length > 1 ?
|
415
|
-
$A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
|
416
|
-
div.childNodes[0].nodeValue) : '';
|
417
|
-
},
|
418
506
|
|
419
|
-
toQueryParams
|
507
|
+
function toQueryParams(separator) {
|
420
508
|
var match = this.strip().match(/([^?#]*)(#.*)?$/);
|
421
509
|
if (!match) return { };
|
422
510
|
|
@@ -434,22 +522,22 @@ Object.extend(String.prototype, {
|
|
434
522
|
}
|
435
523
|
return hash;
|
436
524
|
});
|
437
|
-
}
|
525
|
+
}
|
438
526
|
|
439
|
-
toArray
|
527
|
+
function toArray() {
|
440
528
|
return this.split('');
|
441
|
-
}
|
529
|
+
}
|
442
530
|
|
443
|
-
succ
|
531
|
+
function succ() {
|
444
532
|
return this.slice(0, this.length - 1) +
|
445
533
|
String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
|
446
|
-
}
|
534
|
+
}
|
447
535
|
|
448
|
-
times
|
536
|
+
function times(count) {
|
449
537
|
return count < 1 ? '' : new Array(count + 1).join(this);
|
450
|
-
}
|
538
|
+
}
|
451
539
|
|
452
|
-
camelize
|
540
|
+
function camelize() {
|
453
541
|
var parts = this.split('-'), len = parts.length;
|
454
542
|
if (len == 1) return parts[0];
|
455
543
|
|
@@ -461,101 +549,117 @@ Object.extend(String.prototype, {
|
|
461
549
|
camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
|
462
550
|
|
463
551
|
return camelized;
|
464
|
-
}
|
552
|
+
}
|
465
553
|
|
466
|
-
capitalize
|
554
|
+
function capitalize() {
|
467
555
|
return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
|
468
|
-
}
|
556
|
+
}
|
469
557
|
|
470
|
-
underscore
|
471
|
-
return this.
|
472
|
-
|
558
|
+
function underscore() {
|
559
|
+
return this.replace(/::/g, '/')
|
560
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
|
561
|
+
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
|
562
|
+
.replace(/-/g, '_')
|
563
|
+
.toLowerCase();
|
564
|
+
}
|
473
565
|
|
474
|
-
dasherize
|
475
|
-
return this.
|
476
|
-
}
|
566
|
+
function dasherize() {
|
567
|
+
return this.replace(/_/g, '-');
|
568
|
+
}
|
477
569
|
|
478
|
-
inspect
|
479
|
-
var escapedString = this.
|
480
|
-
|
481
|
-
|
570
|
+
function inspect(useDoubleQuotes) {
|
571
|
+
var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) {
|
572
|
+
if (character in String.specialChar) {
|
573
|
+
return String.specialChar[character];
|
574
|
+
}
|
575
|
+
return '\\u00' + character.charCodeAt().toPaddedString(2, 16);
|
482
576
|
});
|
483
577
|
if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
|
484
578
|
return "'" + escapedString.replace(/'/g, '\\\'') + "'";
|
485
|
-
}
|
579
|
+
}
|
486
580
|
|
487
|
-
toJSON
|
581
|
+
function toJSON() {
|
488
582
|
return this.inspect(true);
|
489
|
-
}
|
583
|
+
}
|
490
584
|
|
491
|
-
unfilterJSON
|
492
|
-
return this.
|
493
|
-
}
|
585
|
+
function unfilterJSON(filter) {
|
586
|
+
return this.replace(filter || Prototype.JSONFilter, '$1');
|
587
|
+
}
|
494
588
|
|
495
|
-
isJSON
|
589
|
+
function isJSON() {
|
496
590
|
var str = this;
|
497
591
|
if (str.blank()) return false;
|
498
592
|
str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
|
499
593
|
return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
|
500
|
-
}
|
594
|
+
}
|
501
595
|
|
502
|
-
evalJSON
|
596
|
+
function evalJSON(sanitize) {
|
503
597
|
var json = this.unfilterJSON();
|
504
598
|
try {
|
505
599
|
if (!sanitize || json.isJSON()) return eval('(' + json + ')');
|
506
600
|
} catch (e) { }
|
507
601
|
throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
|
508
|
-
}
|
602
|
+
}
|
509
603
|
|
510
|
-
include
|
604
|
+
function include(pattern) {
|
511
605
|
return this.indexOf(pattern) > -1;
|
512
|
-
}
|
606
|
+
}
|
513
607
|
|
514
|
-
startsWith
|
608
|
+
function startsWith(pattern) {
|
515
609
|
return this.indexOf(pattern) === 0;
|
516
|
-
}
|
610
|
+
}
|
517
611
|
|
518
|
-
endsWith
|
612
|
+
function endsWith(pattern) {
|
519
613
|
var d = this.length - pattern.length;
|
520
614
|
return d >= 0 && this.lastIndexOf(pattern) === d;
|
521
|
-
}
|
615
|
+
}
|
522
616
|
|
523
|
-
empty
|
617
|
+
function empty() {
|
524
618
|
return this == '';
|
525
|
-
}
|
619
|
+
}
|
526
620
|
|
527
|
-
blank
|
621
|
+
function blank() {
|
528
622
|
return /^\s*$/.test(this);
|
529
|
-
},
|
530
|
-
|
531
|
-
interpolate: function(object, pattern) {
|
532
|
-
return new Template(this, pattern).evaluate(object);
|
533
623
|
}
|
534
|
-
});
|
535
624
|
|
536
|
-
|
537
|
-
|
538
|
-
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
539
|
-
},
|
540
|
-
unescapeHTML: function() {
|
541
|
-
return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
625
|
+
function interpolate(object, pattern) {
|
626
|
+
return new Template(this, pattern).evaluate(object);
|
542
627
|
}
|
543
|
-
});
|
544
628
|
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
629
|
+
return {
|
630
|
+
gsub: gsub,
|
631
|
+
sub: sub,
|
632
|
+
scan: scan,
|
633
|
+
truncate: truncate,
|
634
|
+
strip: String.prototype.trim ? String.prototype.trim : strip,
|
635
|
+
stripTags: stripTags,
|
636
|
+
stripScripts: stripScripts,
|
637
|
+
extractScripts: extractScripts,
|
638
|
+
evalScripts: evalScripts,
|
639
|
+
escapeHTML: escapeHTML,
|
640
|
+
unescapeHTML: unescapeHTML,
|
641
|
+
toQueryParams: toQueryParams,
|
642
|
+
parseQuery: toQueryParams,
|
643
|
+
toArray: toArray,
|
644
|
+
succ: succ,
|
645
|
+
times: times,
|
646
|
+
camelize: camelize,
|
647
|
+
capitalize: capitalize,
|
648
|
+
underscore: underscore,
|
649
|
+
dasherize: dasherize,
|
650
|
+
inspect: inspect,
|
651
|
+
toJSON: toJSON,
|
652
|
+
unfilterJSON: unfilterJSON,
|
653
|
+
isJSON: isJSON,
|
654
|
+
evalJSON: evalJSON,
|
655
|
+
include: include,
|
656
|
+
startsWith: startsWith,
|
657
|
+
endsWith: endsWith,
|
658
|
+
empty: empty,
|
659
|
+
blank: blank,
|
660
|
+
interpolate: interpolate
|
661
|
+
};
|
662
|
+
})());
|
559
663
|
|
560
664
|
var Template = Class.create({
|
561
665
|
initialize: function(template, pattern) {
|
@@ -564,11 +668,11 @@ var Template = Class.create({
|
|
564
668
|
},
|
565
669
|
|
566
670
|
evaluate: function(object) {
|
567
|
-
if (Object.isFunction(object.toTemplateReplacements))
|
671
|
+
if (object && Object.isFunction(object.toTemplateReplacements))
|
568
672
|
object = object.toTemplateReplacements();
|
569
673
|
|
570
674
|
return this.template.gsub(this.pattern, function(match) {
|
571
|
-
if (object == null) return '';
|
675
|
+
if (object == null) return (match[1] + '');
|
572
676
|
|
573
677
|
var before = match[1] || '';
|
574
678
|
if (before == '\\') return match[2];
|
@@ -579,7 +683,7 @@ var Template = Class.create({
|
|
579
683
|
if (match == null) return before;
|
580
684
|
|
581
685
|
while (match != null) {
|
582
|
-
var comp = match[1].startsWith('[') ? match[2].
|
686
|
+
var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
|
583
687
|
ctx = ctx[comp];
|
584
688
|
if (null == ctx || '' == match[3]) break;
|
585
689
|
expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
|
@@ -594,8 +698,8 @@ Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
|
|
594
698
|
|
595
699
|
var $break = { };
|
596
700
|
|
597
|
-
var Enumerable = {
|
598
|
-
each
|
701
|
+
var Enumerable = (function() {
|
702
|
+
function each(iterator, context) {
|
599
703
|
var index = 0;
|
600
704
|
try {
|
601
705
|
this._each(function(value) {
|
@@ -605,17 +709,17 @@ var Enumerable = {
|
|
605
709
|
if (e != $break) throw e;
|
606
710
|
}
|
607
711
|
return this;
|
608
|
-
}
|
712
|
+
}
|
609
713
|
|
610
|
-
eachSlice
|
714
|
+
function eachSlice(number, iterator, context) {
|
611
715
|
var index = -number, slices = [], array = this.toArray();
|
612
716
|
if (number < 1) return array;
|
613
717
|
while ((index += number) < array.length)
|
614
718
|
slices.push(array.slice(index, index+number));
|
615
719
|
return slices.collect(iterator, context);
|
616
|
-
}
|
720
|
+
}
|
617
721
|
|
618
|
-
all
|
722
|
+
function all(iterator, context) {
|
619
723
|
iterator = iterator || Prototype.K;
|
620
724
|
var result = true;
|
621
725
|
this.each(function(value, index) {
|
@@ -623,9 +727,9 @@ var Enumerable = {
|
|
623
727
|
if (!result) throw $break;
|
624
728
|
});
|
625
729
|
return result;
|
626
|
-
}
|
730
|
+
}
|
627
731
|
|
628
|
-
any
|
732
|
+
function any(iterator, context) {
|
629
733
|
iterator = iterator || Prototype.K;
|
630
734
|
var result = false;
|
631
735
|
this.each(function(value, index) {
|
@@ -633,18 +737,18 @@ var Enumerable = {
|
|
633
737
|
throw $break;
|
634
738
|
});
|
635
739
|
return result;
|
636
|
-
}
|
740
|
+
}
|
637
741
|
|
638
|
-
collect
|
742
|
+
function collect(iterator, context) {
|
639
743
|
iterator = iterator || Prototype.K;
|
640
744
|
var results = [];
|
641
745
|
this.each(function(value, index) {
|
642
746
|
results.push(iterator.call(context, value, index));
|
643
747
|
});
|
644
748
|
return results;
|
645
|
-
}
|
749
|
+
}
|
646
750
|
|
647
|
-
detect
|
751
|
+
function detect(iterator, context) {
|
648
752
|
var result;
|
649
753
|
this.each(function(value, index) {
|
650
754
|
if (iterator.call(context, value, index)) {
|
@@ -653,32 +757,32 @@ var Enumerable = {
|
|
653
757
|
}
|
654
758
|
});
|
655
759
|
return result;
|
656
|
-
}
|
760
|
+
}
|
657
761
|
|
658
|
-
findAll
|
762
|
+
function findAll(iterator, context) {
|
659
763
|
var results = [];
|
660
764
|
this.each(function(value, index) {
|
661
765
|
if (iterator.call(context, value, index))
|
662
766
|
results.push(value);
|
663
767
|
});
|
664
768
|
return results;
|
665
|
-
}
|
769
|
+
}
|
666
770
|
|
667
|
-
grep
|
771
|
+
function grep(filter, iterator, context) {
|
668
772
|
iterator = iterator || Prototype.K;
|
669
773
|
var results = [];
|
670
774
|
|
671
775
|
if (Object.isString(filter))
|
672
|
-
filter = new RegExp(filter);
|
776
|
+
filter = new RegExp(RegExp.escape(filter));
|
673
777
|
|
674
778
|
this.each(function(value, index) {
|
675
779
|
if (filter.match(value))
|
676
780
|
results.push(iterator.call(context, value, index));
|
677
781
|
});
|
678
782
|
return results;
|
679
|
-
}
|
783
|
+
}
|
680
784
|
|
681
|
-
include
|
785
|
+
function include(object) {
|
682
786
|
if (Object.isFunction(this.indexOf))
|
683
787
|
if (this.indexOf(object) != -1) return true;
|
684
788
|
|
@@ -690,31 +794,31 @@ var Enumerable = {
|
|
690
794
|
}
|
691
795
|
});
|
692
796
|
return found;
|
693
|
-
}
|
797
|
+
}
|
694
798
|
|
695
|
-
inGroupsOf
|
799
|
+
function inGroupsOf(number, fillWith) {
|
696
800
|
fillWith = Object.isUndefined(fillWith) ? null : fillWith;
|
697
801
|
return this.eachSlice(number, function(slice) {
|
698
802
|
while(slice.length < number) slice.push(fillWith);
|
699
803
|
return slice;
|
700
804
|
});
|
701
|
-
}
|
805
|
+
}
|
702
806
|
|
703
|
-
inject
|
807
|
+
function inject(memo, iterator, context) {
|
704
808
|
this.each(function(value, index) {
|
705
809
|
memo = iterator.call(context, memo, value, index);
|
706
810
|
});
|
707
811
|
return memo;
|
708
|
-
}
|
812
|
+
}
|
709
813
|
|
710
|
-
invoke
|
814
|
+
function invoke(method) {
|
711
815
|
var args = $A(arguments).slice(1);
|
712
816
|
return this.map(function(value) {
|
713
817
|
return value[method].apply(value, args);
|
714
818
|
});
|
715
|
-
}
|
819
|
+
}
|
716
820
|
|
717
|
-
max
|
821
|
+
function max(iterator, context) {
|
718
822
|
iterator = iterator || Prototype.K;
|
719
823
|
var result;
|
720
824
|
this.each(function(value, index) {
|
@@ -723,9 +827,9 @@ var Enumerable = {
|
|
723
827
|
result = value;
|
724
828
|
});
|
725
829
|
return result;
|
726
|
-
}
|
830
|
+
}
|
727
831
|
|
728
|
-
min
|
832
|
+
function min(iterator, context) {
|
729
833
|
iterator = iterator || Prototype.K;
|
730
834
|
var result;
|
731
835
|
this.each(function(value, index) {
|
@@ -734,9 +838,9 @@ var Enumerable = {
|
|
734
838
|
result = value;
|
735
839
|
});
|
736
840
|
return result;
|
737
|
-
}
|
841
|
+
}
|
738
842
|
|
739
|
-
partition
|
843
|
+
function partition(iterator, context) {
|
740
844
|
iterator = iterator || Prototype.K;
|
741
845
|
var trues = [], falses = [];
|
742
846
|
this.each(function(value, index) {
|
@@ -744,26 +848,26 @@ var Enumerable = {
|
|
744
848
|
trues : falses).push(value);
|
745
849
|
});
|
746
850
|
return [trues, falses];
|
747
|
-
}
|
851
|
+
}
|
748
852
|
|
749
|
-
pluck
|
853
|
+
function pluck(property) {
|
750
854
|
var results = [];
|
751
855
|
this.each(function(value) {
|
752
856
|
results.push(value[property]);
|
753
857
|
});
|
754
858
|
return results;
|
755
|
-
}
|
859
|
+
}
|
756
860
|
|
757
|
-
reject
|
861
|
+
function reject(iterator, context) {
|
758
862
|
var results = [];
|
759
863
|
this.each(function(value, index) {
|
760
864
|
if (!iterator.call(context, value, index))
|
761
865
|
results.push(value);
|
762
866
|
});
|
763
867
|
return results;
|
764
|
-
}
|
868
|
+
}
|
765
869
|
|
766
|
-
sortBy
|
870
|
+
function sortBy(iterator, context) {
|
767
871
|
return this.map(function(value, index) {
|
768
872
|
return {
|
769
873
|
value: value,
|
@@ -773,13 +877,13 @@ var Enumerable = {
|
|
773
877
|
var a = left.criteria, b = right.criteria;
|
774
878
|
return a < b ? -1 : a > b ? 1 : 0;
|
775
879
|
}).pluck('value');
|
776
|
-
}
|
880
|
+
}
|
777
881
|
|
778
|
-
toArray
|
882
|
+
function toArray() {
|
779
883
|
return this.map();
|
780
|
-
}
|
884
|
+
}
|
781
885
|
|
782
|
-
zip
|
886
|
+
function zip() {
|
783
887
|
var iterator = Prototype.K, args = $A(arguments);
|
784
888
|
if (Object.isFunction(args.last()))
|
785
889
|
iterator = args.pop();
|
@@ -788,130 +892,152 @@ var Enumerable = {
|
|
788
892
|
return this.map(function(value, index) {
|
789
893
|
return iterator(collections.pluck(index));
|
790
894
|
});
|
791
|
-
}
|
895
|
+
}
|
792
896
|
|
793
|
-
size
|
897
|
+
function size() {
|
794
898
|
return this.toArray().length;
|
795
|
-
}
|
899
|
+
}
|
796
900
|
|
797
|
-
inspect
|
901
|
+
function inspect() {
|
798
902
|
return '#<Enumerable:' + this.toArray().inspect() + '>';
|
799
903
|
}
|
800
|
-
};
|
801
904
|
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
905
|
+
|
906
|
+
|
907
|
+
|
908
|
+
|
909
|
+
|
910
|
+
|
911
|
+
|
912
|
+
|
913
|
+
return {
|
914
|
+
each: each,
|
915
|
+
eachSlice: eachSlice,
|
916
|
+
all: all,
|
917
|
+
every: all,
|
918
|
+
any: any,
|
919
|
+
some: any,
|
920
|
+
collect: collect,
|
921
|
+
map: collect,
|
922
|
+
detect: detect,
|
923
|
+
findAll: findAll,
|
924
|
+
select: findAll,
|
925
|
+
filter: findAll,
|
926
|
+
grep: grep,
|
927
|
+
include: include,
|
928
|
+
member: include,
|
929
|
+
inGroupsOf: inGroupsOf,
|
930
|
+
inject: inject,
|
931
|
+
invoke: invoke,
|
932
|
+
max: max,
|
933
|
+
min: min,
|
934
|
+
partition: partition,
|
935
|
+
pluck: pluck,
|
936
|
+
reject: reject,
|
937
|
+
sortBy: sortBy,
|
938
|
+
toArray: toArray,
|
939
|
+
entries: toArray,
|
940
|
+
zip: zip,
|
941
|
+
size: size,
|
942
|
+
inspect: inspect,
|
943
|
+
find: detect
|
944
|
+
};
|
945
|
+
})();
|
812
946
|
function $A(iterable) {
|
813
947
|
if (!iterable) return [];
|
814
|
-
if (iterable
|
948
|
+
if ('toArray' in Object(iterable)) return iterable.toArray();
|
815
949
|
var length = iterable.length || 0, results = new Array(length);
|
816
950
|
while (length--) results[length] = iterable[length];
|
817
951
|
return results;
|
818
952
|
}
|
819
953
|
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
// A NodeList is a function, has an function `item` property, and a numeric
|
825
|
-
// `length` property. Adapted from Google Doctype.
|
826
|
-
if (!(typeof iterable === 'function' && typeof iterable.length ===
|
827
|
-
'number' && typeof iterable.item === 'function') && iterable.toArray)
|
828
|
-
return iterable.toArray();
|
829
|
-
var length = iterable.length || 0, results = new Array(length);
|
830
|
-
while (length--) results[length] = iterable[length];
|
831
|
-
return results;
|
832
|
-
};
|
954
|
+
function $w(string) {
|
955
|
+
if (!Object.isString(string)) return [];
|
956
|
+
string = string.strip();
|
957
|
+
return string ? string.split(/\s+/) : [];
|
833
958
|
}
|
834
959
|
|
835
960
|
Array.from = $A;
|
836
961
|
|
837
|
-
Object.extend(Array.prototype, Enumerable);
|
838
962
|
|
839
|
-
|
963
|
+
(function() {
|
964
|
+
var arrayProto = Array.prototype,
|
965
|
+
slice = arrayProto.slice,
|
966
|
+
_each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
|
840
967
|
|
841
|
-
|
842
|
-
_each: function(iterator) {
|
968
|
+
function each(iterator) {
|
843
969
|
for (var i = 0, length = this.length; i < length; i++)
|
844
970
|
iterator(this[i]);
|
845
|
-
}
|
971
|
+
}
|
972
|
+
if (!_each) _each = each;
|
846
973
|
|
847
|
-
clear
|
974
|
+
function clear() {
|
848
975
|
this.length = 0;
|
849
976
|
return this;
|
850
|
-
}
|
977
|
+
}
|
851
978
|
|
852
|
-
first
|
979
|
+
function first() {
|
853
980
|
return this[0];
|
854
|
-
}
|
981
|
+
}
|
855
982
|
|
856
|
-
last
|
983
|
+
function last() {
|
857
984
|
return this[this.length - 1];
|
858
|
-
}
|
985
|
+
}
|
859
986
|
|
860
|
-
compact
|
987
|
+
function compact() {
|
861
988
|
return this.select(function(value) {
|
862
989
|
return value != null;
|
863
990
|
});
|
864
|
-
}
|
991
|
+
}
|
865
992
|
|
866
|
-
flatten
|
993
|
+
function flatten() {
|
867
994
|
return this.inject([], function(array, value) {
|
868
|
-
|
869
|
-
value.flatten()
|
995
|
+
if (Object.isArray(value))
|
996
|
+
return array.concat(value.flatten());
|
997
|
+
array.push(value);
|
998
|
+
return array;
|
870
999
|
});
|
871
|
-
}
|
1000
|
+
}
|
872
1001
|
|
873
|
-
without
|
874
|
-
var values =
|
1002
|
+
function without() {
|
1003
|
+
var values = slice.call(arguments, 0);
|
875
1004
|
return this.select(function(value) {
|
876
1005
|
return !values.include(value);
|
877
1006
|
});
|
878
|
-
}
|
1007
|
+
}
|
879
1008
|
|
880
|
-
reverse
|
1009
|
+
function reverse(inline) {
|
881
1010
|
return (inline !== false ? this : this.toArray())._reverse();
|
882
|
-
}
|
883
|
-
|
884
|
-
reduce: function() {
|
885
|
-
return this.length > 1 ? this : this[0];
|
886
|
-
},
|
1011
|
+
}
|
887
1012
|
|
888
|
-
uniq
|
1013
|
+
function uniq(sorted) {
|
889
1014
|
return this.inject([], function(array, value, index) {
|
890
1015
|
if (0 == index || (sorted ? array.last() != value : !array.include(value)))
|
891
1016
|
array.push(value);
|
892
1017
|
return array;
|
893
1018
|
});
|
894
|
-
}
|
1019
|
+
}
|
895
1020
|
|
896
|
-
intersect
|
1021
|
+
function intersect(array) {
|
897
1022
|
return this.uniq().findAll(function(item) {
|
898
1023
|
return array.detect(function(value) { return item === value });
|
899
1024
|
});
|
900
|
-
}
|
1025
|
+
}
|
901
1026
|
|
902
|
-
clone: function() {
|
903
|
-
return [].concat(this);
|
904
|
-
},
|
905
1027
|
|
906
|
-
|
1028
|
+
function clone() {
|
1029
|
+
return slice.call(this, 0);
|
1030
|
+
}
|
1031
|
+
|
1032
|
+
function size() {
|
907
1033
|
return this.length;
|
908
|
-
}
|
1034
|
+
}
|
909
1035
|
|
910
|
-
inspect
|
1036
|
+
function inspect() {
|
911
1037
|
return '[' + this.map(Object.inspect).join(', ') + ']';
|
912
|
-
}
|
1038
|
+
}
|
913
1039
|
|
914
|
-
toJSON
|
1040
|
+
function toJSON() {
|
915
1041
|
var results = [];
|
916
1042
|
this.each(function(object) {
|
917
1043
|
var value = Object.toJSON(object);
|
@@ -919,205 +1045,270 @@ Object.extend(Array.prototype, {
|
|
919
1045
|
});
|
920
1046
|
return '[' + results.join(', ') + ']';
|
921
1047
|
}
|
922
|
-
});
|
923
|
-
|
924
|
-
// use native browser JS 1.6 implementation if available
|
925
|
-
if (Object.isFunction(Array.prototype.forEach))
|
926
|
-
Array.prototype._each = Array.prototype.forEach;
|
927
|
-
|
928
|
-
if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
|
929
|
-
i || (i = 0);
|
930
|
-
var length = this.length;
|
931
|
-
if (i < 0) i = length + i;
|
932
|
-
for (; i < length; i++)
|
933
|
-
if (this[i] === item) return i;
|
934
|
-
return -1;
|
935
|
-
};
|
936
|
-
|
937
|
-
if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
|
938
|
-
i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
|
939
|
-
var n = this.slice(0, i).reverse().indexOf(item);
|
940
|
-
return (n < 0) ? n : i - n - 1;
|
941
|
-
};
|
942
1048
|
|
943
|
-
|
1049
|
+
function indexOf(item, i) {
|
1050
|
+
i || (i = 0);
|
1051
|
+
var length = this.length;
|
1052
|
+
if (i < 0) i = length + i;
|
1053
|
+
for (; i < length; i++)
|
1054
|
+
if (this[i] === item) return i;
|
1055
|
+
return -1;
|
1056
|
+
}
|
944
1057
|
|
945
|
-
function
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
}
|
1058
|
+
function lastIndexOf(item, i) {
|
1059
|
+
i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
|
1060
|
+
var n = this.slice(0, i).reverse().indexOf(item);
|
1061
|
+
return (n < 0) ? n : i - n - 1;
|
1062
|
+
}
|
950
1063
|
|
951
|
-
|
952
|
-
|
953
|
-
var array = [];
|
954
|
-
for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
|
1064
|
+
function concat() {
|
1065
|
+
var array = slice.call(this, 0), item;
|
955
1066
|
for (var i = 0, length = arguments.length; i < length; i++) {
|
956
|
-
|
957
|
-
|
958
|
-
|
1067
|
+
item = arguments[i];
|
1068
|
+
if (Object.isArray(item) && !('callee' in item)) {
|
1069
|
+
for (var j = 0, arrayLength = item.length; j < arrayLength; j++)
|
1070
|
+
array.push(item[j]);
|
959
1071
|
} else {
|
960
|
-
array.push(
|
1072
|
+
array.push(item);
|
961
1073
|
}
|
962
1074
|
}
|
963
1075
|
return array;
|
964
|
-
}
|
965
|
-
}
|
966
|
-
Object.extend(Number.prototype, {
|
967
|
-
toColorPart: function() {
|
968
|
-
return this.toPaddedString(2, 16);
|
969
|
-
},
|
970
|
-
|
971
|
-
succ: function() {
|
972
|
-
return this + 1;
|
973
|
-
},
|
1076
|
+
}
|
974
1077
|
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
1078
|
+
Object.extend(arrayProto, Enumerable);
|
1079
|
+
|
1080
|
+
if (!arrayProto._reverse)
|
1081
|
+
arrayProto._reverse = arrayProto.reverse;
|
1082
|
+
|
1083
|
+
Object.extend(arrayProto, {
|
1084
|
+
_each: _each,
|
1085
|
+
clear: clear,
|
1086
|
+
first: first,
|
1087
|
+
last: last,
|
1088
|
+
compact: compact,
|
1089
|
+
flatten: flatten,
|
1090
|
+
without: without,
|
1091
|
+
reverse: reverse,
|
1092
|
+
uniq: uniq,
|
1093
|
+
intersect: intersect,
|
1094
|
+
clone: clone,
|
1095
|
+
toArray: clone,
|
1096
|
+
size: size,
|
1097
|
+
inspect: inspect,
|
1098
|
+
toJSON: toJSON
|
1099
|
+
});
|
979
1100
|
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
},
|
1101
|
+
var CONCAT_ARGUMENTS_BUGGY = (function() {
|
1102
|
+
return [].concat(arguments)[0][0] !== 1;
|
1103
|
+
})(1,2)
|
984
1104
|
|
985
|
-
|
986
|
-
return isFinite(this) ? this.toString() : 'null';
|
987
|
-
}
|
988
|
-
});
|
1105
|
+
if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
|
989
1106
|
|
990
|
-
|
991
|
-
|
992
|
-
});
|
1107
|
+
if (!arrayProto.indexOf) arrayProto.indexOf = indexOf;
|
1108
|
+
if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf;
|
1109
|
+
})();
|
993
1110
|
function $H(object) {
|
994
1111
|
return new Hash(object);
|
995
1112
|
};
|
996
1113
|
|
997
1114
|
var Hash = Class.create(Enumerable, (function() {
|
1115
|
+
function initialize(object) {
|
1116
|
+
this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
function _each(iterator) {
|
1120
|
+
for (var key in this._object) {
|
1121
|
+
var value = this._object[key], pair = [key, value];
|
1122
|
+
pair.key = key;
|
1123
|
+
pair.value = value;
|
1124
|
+
iterator(pair);
|
1125
|
+
}
|
1126
|
+
}
|
1127
|
+
|
1128
|
+
function set(key, value) {
|
1129
|
+
return this._object[key] = value;
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
function get(key) {
|
1133
|
+
if (this._object[key] !== Object.prototype[key])
|
1134
|
+
return this._object[key];
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
function unset(key) {
|
1138
|
+
var value = this._object[key];
|
1139
|
+
delete this._object[key];
|
1140
|
+
return value;
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
function toObject() {
|
1144
|
+
return Object.clone(this._object);
|
1145
|
+
}
|
1146
|
+
|
1147
|
+
function keys() {
|
1148
|
+
return this.pluck('key');
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
function values() {
|
1152
|
+
return this.pluck('value');
|
1153
|
+
}
|
1154
|
+
|
1155
|
+
function index(value) {
|
1156
|
+
var match = this.detect(function(pair) {
|
1157
|
+
return pair.value === value;
|
1158
|
+
});
|
1159
|
+
return match && match.key;
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
function merge(object) {
|
1163
|
+
return this.clone().update(object);
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
function update(object) {
|
1167
|
+
return new Hash(object).inject(this, function(result, pair) {
|
1168
|
+
result.set(pair.key, pair.value);
|
1169
|
+
return result;
|
1170
|
+
});
|
1171
|
+
}
|
998
1172
|
|
999
1173
|
function toQueryPair(key, value) {
|
1000
1174
|
if (Object.isUndefined(value)) return key;
|
1001
1175
|
return key + '=' + encodeURIComponent(String.interpret(value));
|
1002
1176
|
}
|
1003
1177
|
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
},
|
1008
|
-
|
1009
|
-
_each: function(iterator) {
|
1010
|
-
for (var key in this._object) {
|
1011
|
-
var value = this._object[key], pair = [key, value];
|
1012
|
-
pair.key = key;
|
1013
|
-
pair.value = value;
|
1014
|
-
iterator(pair);
|
1015
|
-
}
|
1016
|
-
},
|
1178
|
+
function toQueryString() {
|
1179
|
+
return this.inject([], function(results, pair) {
|
1180
|
+
var key = encodeURIComponent(pair.key), values = pair.value;
|
1017
1181
|
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1182
|
+
if (values && typeof values == 'object') {
|
1183
|
+
if (Object.isArray(values))
|
1184
|
+
return results.concat(values.map(toQueryPair.curry(key)));
|
1185
|
+
} else results.push(toQueryPair(key, values));
|
1186
|
+
return results;
|
1187
|
+
}).join('&');
|
1188
|
+
}
|
1021
1189
|
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1190
|
+
function inspect() {
|
1191
|
+
return '#<Hash:{' + this.map(function(pair) {
|
1192
|
+
return pair.map(Object.inspect).join(': ');
|
1193
|
+
}).join(', ') + '}>';
|
1194
|
+
}
|
1027
1195
|
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
return value;
|
1032
|
-
},
|
1196
|
+
function toJSON() {
|
1197
|
+
return Object.toJSON(this.toObject());
|
1198
|
+
}
|
1033
1199
|
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1200
|
+
function clone() {
|
1201
|
+
return new Hash(this);
|
1202
|
+
}
|
1037
1203
|
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1204
|
+
return {
|
1205
|
+
initialize: initialize,
|
1206
|
+
_each: _each,
|
1207
|
+
set: set,
|
1208
|
+
get: get,
|
1209
|
+
unset: unset,
|
1210
|
+
toObject: toObject,
|
1211
|
+
toTemplateReplacements: toObject,
|
1212
|
+
keys: keys,
|
1213
|
+
values: values,
|
1214
|
+
index: index,
|
1215
|
+
merge: merge,
|
1216
|
+
update: update,
|
1217
|
+
toQueryString: toQueryString,
|
1218
|
+
inspect: inspect,
|
1219
|
+
toJSON: toJSON,
|
1220
|
+
clone: clone
|
1221
|
+
};
|
1222
|
+
})());
|
1041
1223
|
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1224
|
+
Hash.from = $H;
|
1225
|
+
Object.extend(Number.prototype, (function() {
|
1226
|
+
function toColorPart() {
|
1227
|
+
return this.toPaddedString(2, 16);
|
1228
|
+
}
|
1045
1229
|
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
});
|
1050
|
-
return match && match.key;
|
1051
|
-
},
|
1230
|
+
function succ() {
|
1231
|
+
return this + 1;
|
1232
|
+
}
|
1052
1233
|
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1234
|
+
function times(iterator, context) {
|
1235
|
+
$R(0, this, true).each(iterator, context);
|
1236
|
+
return this;
|
1237
|
+
}
|
1056
1238
|
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
});
|
1062
|
-
},
|
1239
|
+
function toPaddedString(length, radix) {
|
1240
|
+
var string = this.toString(radix || 10);
|
1241
|
+
return '0'.times(length - string.length) + string;
|
1242
|
+
}
|
1063
1243
|
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1244
|
+
function toJSON() {
|
1245
|
+
return isFinite(this) ? this.toString() : 'null';
|
1246
|
+
}
|
1067
1247
|
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
} else results.push(toQueryPair(key, values));
|
1072
|
-
return results;
|
1073
|
-
}).join('&');
|
1074
|
-
},
|
1248
|
+
function abs() {
|
1249
|
+
return Math.abs(this);
|
1250
|
+
}
|
1075
1251
|
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
}).join(', ') + '}>';
|
1080
|
-
},
|
1252
|
+
function round() {
|
1253
|
+
return Math.round(this);
|
1254
|
+
}
|
1081
1255
|
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1256
|
+
function ceil() {
|
1257
|
+
return Math.ceil(this);
|
1258
|
+
}
|
1085
1259
|
|
1086
|
-
|
1087
|
-
|
1088
|
-
}
|
1260
|
+
function floor() {
|
1261
|
+
return Math.floor(this);
|
1089
1262
|
}
|
1263
|
+
|
1264
|
+
return {
|
1265
|
+
toColorPart: toColorPart,
|
1266
|
+
succ: succ,
|
1267
|
+
times: times,
|
1268
|
+
toPaddedString: toPaddedString,
|
1269
|
+
toJSON: toJSON,
|
1270
|
+
abs: abs,
|
1271
|
+
round: round,
|
1272
|
+
ceil: ceil,
|
1273
|
+
floor: floor
|
1274
|
+
};
|
1090
1275
|
})());
|
1091
1276
|
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1277
|
+
function $R(start, end, exclusive) {
|
1278
|
+
return new ObjectRange(start, end, exclusive);
|
1279
|
+
}
|
1280
|
+
|
1281
|
+
var ObjectRange = Class.create(Enumerable, (function() {
|
1282
|
+
function initialize(start, end, exclusive) {
|
1096
1283
|
this.start = start;
|
1097
1284
|
this.end = end;
|
1098
1285
|
this.exclusive = exclusive;
|
1099
|
-
}
|
1286
|
+
}
|
1100
1287
|
|
1101
|
-
_each
|
1288
|
+
function _each(iterator) {
|
1102
1289
|
var value = this.start;
|
1103
1290
|
while (this.include(value)) {
|
1104
1291
|
iterator(value);
|
1105
1292
|
value = value.succ();
|
1106
1293
|
}
|
1107
|
-
}
|
1294
|
+
}
|
1108
1295
|
|
1109
|
-
include
|
1296
|
+
function include(value) {
|
1110
1297
|
if (value < this.start)
|
1111
1298
|
return false;
|
1112
1299
|
if (this.exclusive)
|
1113
1300
|
return value < this.end;
|
1114
1301
|
return value <= this.end;
|
1115
1302
|
}
|
1116
|
-
});
|
1117
1303
|
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1304
|
+
return {
|
1305
|
+
initialize: initialize,
|
1306
|
+
_each: _each,
|
1307
|
+
include: include
|
1308
|
+
};
|
1309
|
+
})());
|
1310
|
+
|
1311
|
+
|
1121
1312
|
|
1122
1313
|
var Ajax = {
|
1123
1314
|
getTransport: function() {
|
@@ -1164,7 +1355,6 @@ Ajax.Responders.register({
|
|
1164
1355
|
onCreate: function() { Ajax.activeRequestCount++ },
|
1165
1356
|
onComplete: function() { Ajax.activeRequestCount-- }
|
1166
1357
|
});
|
1167
|
-
|
1168
1358
|
Ajax.Base = Class.create({
|
1169
1359
|
initialize: function(options) {
|
1170
1360
|
this.options = {
|
@@ -1186,7 +1376,6 @@ Ajax.Base = Class.create({
|
|
1186
1376
|
this.options.parameters = this.options.parameters.toObject();
|
1187
1377
|
}
|
1188
1378
|
});
|
1189
|
-
|
1190
1379
|
Ajax.Request = Class.create(Ajax.Base, {
|
1191
1380
|
_complete: false,
|
1192
1381
|
|
@@ -1202,7 +1391,6 @@ Ajax.Request = Class.create(Ajax.Base, {
|
|
1202
1391
|
var params = Object.clone(this.options.parameters);
|
1203
1392
|
|
1204
1393
|
if (!['get', 'post'].include(this.method)) {
|
1205
|
-
// simulate other verbs over post
|
1206
1394
|
params['_method'] = this.method;
|
1207
1395
|
this.method = 'post';
|
1208
1396
|
}
|
@@ -1210,7 +1398,6 @@ Ajax.Request = Class.create(Ajax.Base, {
|
|
1210
1398
|
this.parameters = params;
|
1211
1399
|
|
1212
1400
|
if (params = Object.toQueryString(params)) {
|
1213
|
-
// when GET, append parameters to URL
|
1214
1401
|
if (this.method == 'get')
|
1215
1402
|
this.url += (this.url.include('?') ? '&' : '?') + params;
|
1216
1403
|
else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
|
@@ -1269,7 +1456,6 @@ Ajax.Request = Class.create(Ajax.Base, {
|
|
1269
1456
|
headers['Connection'] = 'close';
|
1270
1457
|
}
|
1271
1458
|
|
1272
|
-
// user-defined headers
|
1273
1459
|
if (typeof this.options.requestHeaders == 'object') {
|
1274
1460
|
var extras = this.options.requestHeaders;
|
1275
1461
|
|
@@ -1323,7 +1509,6 @@ Ajax.Request = Class.create(Ajax.Base, {
|
|
1323
1509
|
}
|
1324
1510
|
|
1325
1511
|
if (state == 'Complete') {
|
1326
|
-
// avoid memory leak in MSIE: clean up
|
1327
1512
|
this.transport.onreadystatechange = Prototype.emptyFunction;
|
1328
1513
|
}
|
1329
1514
|
},
|
@@ -1340,7 +1525,7 @@ Ajax.Request = Class.create(Ajax.Base, {
|
|
1340
1525
|
getHeader: function(name) {
|
1341
1526
|
try {
|
1342
1527
|
return this.transport.getResponseHeader(name) || null;
|
1343
|
-
} catch (e) { return null }
|
1528
|
+
} catch (e) { return null; }
|
1344
1529
|
},
|
1345
1530
|
|
1346
1531
|
evalResponse: function() {
|
@@ -1360,6 +1545,13 @@ Ajax.Request = Class.create(Ajax.Base, {
|
|
1360
1545
|
Ajax.Request.Events =
|
1361
1546
|
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
1362
1547
|
|
1548
|
+
|
1549
|
+
|
1550
|
+
|
1551
|
+
|
1552
|
+
|
1553
|
+
|
1554
|
+
|
1363
1555
|
Ajax.Response = Class.create({
|
1364
1556
|
initialize: function(request){
|
1365
1557
|
this.request = request;
|
@@ -1381,6 +1573,7 @@ Ajax.Response = Class.create({
|
|
1381
1573
|
},
|
1382
1574
|
|
1383
1575
|
status: 0,
|
1576
|
+
|
1384
1577
|
statusText: '',
|
1385
1578
|
|
1386
1579
|
getStatus: Ajax.Request.prototype.getStatus,
|
@@ -1510,6 +1703,9 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|
1510
1703
|
this.updater = new Ajax.Updater(this.container, this.url, this.options);
|
1511
1704
|
}
|
1512
1705
|
});
|
1706
|
+
|
1707
|
+
|
1708
|
+
|
1513
1709
|
function $(element) {
|
1514
1710
|
if (arguments.length > 1) {
|
1515
1711
|
for (var i = 0, elements = [], length = arguments.length; i < length; i++)
|
@@ -1537,7 +1733,6 @@ if (Prototype.BrowserFeatures.XPath) {
|
|
1537
1733
|
if (!window.Node) var Node = { };
|
1538
1734
|
|
1539
1735
|
if (!Node.ELEMENT_NODE) {
|
1540
|
-
// DOM level 2 ECMAScript Language Binding
|
1541
1736
|
Object.extend(Node, {
|
1542
1737
|
ELEMENT_NODE: 1,
|
1543
1738
|
ATTRIBUTE_NODE: 2,
|
@@ -1554,13 +1749,30 @@ if (!Node.ELEMENT_NODE) {
|
|
1554
1749
|
});
|
1555
1750
|
}
|
1556
1751
|
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1752
|
+
|
1753
|
+
(function(global) {
|
1754
|
+
|
1755
|
+
var SETATTRIBUTE_IGNORES_NAME = (function(){
|
1756
|
+
var elForm = document.createElement("form");
|
1757
|
+
var elInput = document.createElement("input");
|
1758
|
+
var root = document.documentElement;
|
1759
|
+
elInput.setAttribute("name", "test");
|
1760
|
+
elForm.appendChild(elInput);
|
1761
|
+
root.appendChild(elForm);
|
1762
|
+
var isBuggy = elForm.elements
|
1763
|
+
? (typeof elForm.elements.test == "undefined")
|
1764
|
+
: null;
|
1765
|
+
root.removeChild(elForm);
|
1766
|
+
elForm = elInput = null;
|
1767
|
+
return isBuggy;
|
1768
|
+
})();
|
1769
|
+
|
1770
|
+
var element = global.Element;
|
1771
|
+
global.Element = function(tagName, attributes) {
|
1560
1772
|
attributes = attributes || { };
|
1561
1773
|
tagName = tagName.toLowerCase();
|
1562
1774
|
var cache = Element.cache;
|
1563
|
-
if (
|
1775
|
+
if (SETATTRIBUTE_IGNORES_NAME && attributes.name) {
|
1564
1776
|
tagName = '<' + tagName + ' name="' + attributes.name + '">';
|
1565
1777
|
delete attributes.name;
|
1566
1778
|
return Element.writeAttribute(document.createElement(tagName), attributes);
|
@@ -1568,11 +1780,12 @@ if (!Node.ELEMENT_NODE) {
|
|
1568
1780
|
if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
|
1569
1781
|
return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
|
1570
1782
|
};
|
1571
|
-
Object.extend(
|
1572
|
-
if (element)
|
1573
|
-
})
|
1783
|
+
Object.extend(global.Element, element || { });
|
1784
|
+
if (element) global.Element.prototype = element.prototype;
|
1785
|
+
})(this);
|
1574
1786
|
|
1575
1787
|
Element.cache = { };
|
1788
|
+
Element.idCounter = 1;
|
1576
1789
|
|
1577
1790
|
Element.Methods = {
|
1578
1791
|
visible: function(element) {
|
@@ -1585,6 +1798,7 @@ Element.Methods = {
|
|
1585
1798
|
return element;
|
1586
1799
|
},
|
1587
1800
|
|
1801
|
+
|
1588
1802
|
hide: function(element) {
|
1589
1803
|
element = $(element);
|
1590
1804
|
element.style.display = 'none';
|
@@ -1603,15 +1817,89 @@ Element.Methods = {
|
|
1603
1817
|
return element;
|
1604
1818
|
},
|
1605
1819
|
|
1606
|
-
update: function(
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1820
|
+
update: (function(){
|
1821
|
+
|
1822
|
+
var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
|
1823
|
+
var el = document.createElement("select"),
|
1824
|
+
isBuggy = true;
|
1825
|
+
el.innerHTML = "<option value=\"test\">test</option>";
|
1826
|
+
if (el.options && el.options[0]) {
|
1827
|
+
isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION";
|
1828
|
+
}
|
1829
|
+
el = null;
|
1830
|
+
return isBuggy;
|
1831
|
+
})();
|
1832
|
+
|
1833
|
+
var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){
|
1834
|
+
try {
|
1835
|
+
var el = document.createElement("table");
|
1836
|
+
if (el && el.tBodies) {
|
1837
|
+
el.innerHTML = "<tbody><tr><td>test</td></tr></tbody>";
|
1838
|
+
var isBuggy = typeof el.tBodies[0] == "undefined";
|
1839
|
+
el = null;
|
1840
|
+
return isBuggy;
|
1841
|
+
}
|
1842
|
+
} catch (e) {
|
1843
|
+
return true;
|
1844
|
+
}
|
1845
|
+
})();
|
1846
|
+
|
1847
|
+
var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
|
1848
|
+
var s = document.createElement("script"),
|
1849
|
+
isBuggy = false;
|
1850
|
+
try {
|
1851
|
+
s.appendChild(document.createTextNode(""));
|
1852
|
+
isBuggy = !s.firstChild ||
|
1853
|
+
s.firstChild && s.firstChild.nodeType !== 3;
|
1854
|
+
} catch (e) {
|
1855
|
+
isBuggy = true;
|
1856
|
+
}
|
1857
|
+
s = null;
|
1858
|
+
return isBuggy;
|
1859
|
+
})();
|
1860
|
+
|
1861
|
+
function update(element, content) {
|
1862
|
+
element = $(element);
|
1863
|
+
|
1864
|
+
if (content && content.toElement)
|
1865
|
+
content = content.toElement();
|
1866
|
+
|
1867
|
+
if (Object.isElement(content))
|
1868
|
+
return element.update().insert(content);
|
1869
|
+
|
1870
|
+
content = Object.toHTML(content);
|
1871
|
+
|
1872
|
+
var tagName = element.tagName.toUpperCase();
|
1873
|
+
|
1874
|
+
if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) {
|
1875
|
+
element.text = content;
|
1876
|
+
return element;
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) {
|
1880
|
+
if (tagName in Element._insertionTranslations.tags) {
|
1881
|
+
while (element.firstChild) {
|
1882
|
+
element.removeChild(element.firstChild);
|
1883
|
+
}
|
1884
|
+
Element._getContentFromAnonymousElement(tagName, content.stripScripts())
|
1885
|
+
.each(function(node) {
|
1886
|
+
element.appendChild(node)
|
1887
|
+
});
|
1888
|
+
}
|
1889
|
+
else {
|
1890
|
+
element.innerHTML = content.stripScripts();
|
1891
|
+
}
|
1892
|
+
}
|
1893
|
+
else {
|
1894
|
+
element.innerHTML = content.stripScripts();
|
1895
|
+
}
|
1896
|
+
|
1897
|
+
content.evalScripts.bind(content).defer();
|
1898
|
+
return element;
|
1899
|
+
}
|
1900
|
+
|
1901
|
+
return update;
|
1902
|
+
})(),
|
1615
1903
|
|
1616
1904
|
replace: function(element, content) {
|
1617
1905
|
element = $(element);
|
@@ -1696,11 +1984,11 @@ Element.Methods = {
|
|
1696
1984
|
},
|
1697
1985
|
|
1698
1986
|
ancestors: function(element) {
|
1699
|
-
return
|
1987
|
+
return Element.recursivelyCollect(element, 'parentNode');
|
1700
1988
|
},
|
1701
1989
|
|
1702
1990
|
descendants: function(element) {
|
1703
|
-
return
|
1991
|
+
return Element.select(element, "*");
|
1704
1992
|
},
|
1705
1993
|
|
1706
1994
|
firstDescendant: function(element) {
|
@@ -1717,16 +2005,17 @@ Element.Methods = {
|
|
1717
2005
|
},
|
1718
2006
|
|
1719
2007
|
previousSiblings: function(element) {
|
1720
|
-
return
|
2008
|
+
return Element.recursivelyCollect(element, 'previousSibling');
|
1721
2009
|
},
|
1722
2010
|
|
1723
2011
|
nextSiblings: function(element) {
|
1724
|
-
return
|
2012
|
+
return Element.recursivelyCollect(element, 'nextSibling');
|
1725
2013
|
},
|
1726
2014
|
|
1727
2015
|
siblings: function(element) {
|
1728
2016
|
element = $(element);
|
1729
|
-
return
|
2017
|
+
return Element.previousSiblings(element).reverse()
|
2018
|
+
.concat(Element.nextSiblings(element));
|
1730
2019
|
},
|
1731
2020
|
|
1732
2021
|
match: function(element, selector) {
|
@@ -1738,22 +2027,22 @@ Element.Methods = {
|
|
1738
2027
|
up: function(element, expression, index) {
|
1739
2028
|
element = $(element);
|
1740
2029
|
if (arguments.length == 1) return $(element.parentNode);
|
1741
|
-
var ancestors =
|
2030
|
+
var ancestors = Element.ancestors(element);
|
1742
2031
|
return Object.isNumber(expression) ? ancestors[expression] :
|
1743
2032
|
Selector.findElement(ancestors, expression, index);
|
1744
2033
|
},
|
1745
2034
|
|
1746
2035
|
down: function(element, expression, index) {
|
1747
2036
|
element = $(element);
|
1748
|
-
if (arguments.length == 1) return
|
1749
|
-
return Object.isNumber(expression) ?
|
2037
|
+
if (arguments.length == 1) return Element.firstDescendant(element);
|
2038
|
+
return Object.isNumber(expression) ? Element.descendants(element)[expression] :
|
1750
2039
|
Element.select(element, expression)[index || 0];
|
1751
2040
|
},
|
1752
2041
|
|
1753
2042
|
previous: function(element, expression, index) {
|
1754
2043
|
element = $(element);
|
1755
2044
|
if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
|
1756
|
-
var previousSiblings =
|
2045
|
+
var previousSiblings = Element.previousSiblings(element);
|
1757
2046
|
return Object.isNumber(expression) ? previousSiblings[expression] :
|
1758
2047
|
Selector.findElement(previousSiblings, expression, index);
|
1759
2048
|
},
|
@@ -1761,27 +2050,28 @@ Element.Methods = {
|
|
1761
2050
|
next: function(element, expression, index) {
|
1762
2051
|
element = $(element);
|
1763
2052
|
if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
|
1764
|
-
var nextSiblings =
|
2053
|
+
var nextSiblings = Element.nextSiblings(element);
|
1765
2054
|
return Object.isNumber(expression) ? nextSiblings[expression] :
|
1766
2055
|
Selector.findElement(nextSiblings, expression, index);
|
1767
2056
|
},
|
1768
2057
|
|
1769
|
-
|
1770
|
-
|
2058
|
+
|
2059
|
+
select: function(element) {
|
2060
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
1771
2061
|
return Selector.findChildElements(element, args);
|
1772
2062
|
},
|
1773
2063
|
|
1774
|
-
adjacent: function() {
|
1775
|
-
var args =
|
2064
|
+
adjacent: function(element) {
|
2065
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
1776
2066
|
return Selector.findChildElements(element.parentNode, args).without(element);
|
1777
2067
|
},
|
1778
2068
|
|
1779
2069
|
identify: function(element) {
|
1780
2070
|
element = $(element);
|
1781
|
-
var id =
|
2071
|
+
var id = Element.readAttribute(element, 'id');
|
1782
2072
|
if (id) return id;
|
1783
|
-
do { id = 'anonymous_element_' +
|
1784
|
-
|
2073
|
+
do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
|
2074
|
+
Element.writeAttribute(element, 'id', id);
|
1785
2075
|
return id;
|
1786
2076
|
},
|
1787
2077
|
|
@@ -1820,11 +2110,11 @@ Element.Methods = {
|
|
1820
2110
|
},
|
1821
2111
|
|
1822
2112
|
getHeight: function(element) {
|
1823
|
-
return
|
2113
|
+
return Element.getDimensions(element).height;
|
1824
2114
|
},
|
1825
2115
|
|
1826
2116
|
getWidth: function(element) {
|
1827
|
-
return
|
2117
|
+
return Element.getDimensions(element).width;
|
1828
2118
|
},
|
1829
2119
|
|
1830
2120
|
classNames: function(element) {
|
@@ -1840,7 +2130,7 @@ Element.Methods = {
|
|
1840
2130
|
|
1841
2131
|
addClassName: function(element, className) {
|
1842
2132
|
if (!(element = $(element))) return;
|
1843
|
-
if (!
|
2133
|
+
if (!Element.hasClassName(element, className))
|
1844
2134
|
element.className += (element.className ? ' ' : '') + className;
|
1845
2135
|
return element;
|
1846
2136
|
},
|
@@ -1854,11 +2144,10 @@ Element.Methods = {
|
|
1854
2144
|
|
1855
2145
|
toggleClassName: function(element, className) {
|
1856
2146
|
if (!(element = $(element))) return;
|
1857
|
-
return
|
1858
|
-
'removeClassName' : 'addClassName'](className);
|
2147
|
+
return Element[Element.hasClassName(element, className) ?
|
2148
|
+
'removeClassName' : 'addClassName'](element, className);
|
1859
2149
|
},
|
1860
2150
|
|
1861
|
-
// removes whitespace-only text node children
|
1862
2151
|
cleanWhitespace: function(element) {
|
1863
2152
|
element = $(element);
|
1864
2153
|
var node = element.firstChild;
|
@@ -1892,7 +2181,7 @@ Element.Methods = {
|
|
1892
2181
|
|
1893
2182
|
scrollTo: function(element) {
|
1894
2183
|
element = $(element);
|
1895
|
-
var pos =
|
2184
|
+
var pos = Element.cumulativeOffset(element);
|
1896
2185
|
window.scrollTo(pos[0], pos[1]);
|
1897
2186
|
return element;
|
1898
2187
|
},
|
@@ -1940,18 +2229,17 @@ Element.Methods = {
|
|
1940
2229
|
|
1941
2230
|
getDimensions: function(element) {
|
1942
2231
|
element = $(element);
|
1943
|
-
var display =
|
2232
|
+
var display = Element.getStyle(element, 'display');
|
1944
2233
|
if (display != 'none' && display != null) // Safari bug
|
1945
2234
|
return {width: element.offsetWidth, height: element.offsetHeight};
|
1946
2235
|
|
1947
|
-
// All *Width and *Height properties give 0 on elements with display none,
|
1948
|
-
// so enable the element temporarily
|
1949
2236
|
var els = element.style;
|
1950
2237
|
var originalVisibility = els.visibility;
|
1951
2238
|
var originalPosition = els.position;
|
1952
2239
|
var originalDisplay = els.display;
|
1953
2240
|
els.visibility = 'hidden';
|
1954
|
-
|
2241
|
+
if (originalPosition != 'fixed') // Switching fixed to absolute causes issues in Safari
|
2242
|
+
els.position = 'absolute';
|
1955
2243
|
els.display = 'block';
|
1956
2244
|
var originalWidth = element.clientWidth;
|
1957
2245
|
var originalHeight = element.clientHeight;
|
@@ -1967,8 +2255,6 @@ Element.Methods = {
|
|
1967
2255
|
if (pos == 'static' || !pos) {
|
1968
2256
|
element._madePositioned = true;
|
1969
2257
|
element.style.position = 'relative';
|
1970
|
-
// Opera returns the offset relative to the positioning context, when an
|
1971
|
-
// element is position relative but top and left have not been defined
|
1972
2258
|
if (Prototype.Browser.Opera) {
|
1973
2259
|
element.style.top = 0;
|
1974
2260
|
element.style.left = 0;
|
@@ -2034,10 +2320,9 @@ Element.Methods = {
|
|
2034
2320
|
|
2035
2321
|
absolutize: function(element) {
|
2036
2322
|
element = $(element);
|
2037
|
-
if (
|
2038
|
-
// Position.prepare(); // To be done manually by Scripty when it needs it.
|
2323
|
+
if (Element.getStyle(element, 'position') == 'absolute') return element;
|
2039
2324
|
|
2040
|
-
var offsets =
|
2325
|
+
var offsets = Element.positionedOffset(element);
|
2041
2326
|
var top = offsets[1];
|
2042
2327
|
var left = offsets[0];
|
2043
2328
|
var width = element.clientWidth;
|
@@ -2058,8 +2343,7 @@ Element.Methods = {
|
|
2058
2343
|
|
2059
2344
|
relativize: function(element) {
|
2060
2345
|
element = $(element);
|
2061
|
-
if (
|
2062
|
-
// Position.prepare(); // To be done manually by Scripty when it needs it.
|
2346
|
+
if (Element.getStyle(element, 'position') == 'relative') return element;
|
2063
2347
|
|
2064
2348
|
element.style.position = 'relative';
|
2065
2349
|
var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
|
@@ -2101,7 +2385,6 @@ Element.Methods = {
|
|
2101
2385
|
valueT += element.offsetTop || 0;
|
2102
2386
|
valueL += element.offsetLeft || 0;
|
2103
2387
|
|
2104
|
-
// Safari fix
|
2105
2388
|
if (element.offsetParent == document.body &&
|
2106
2389
|
Element.getStyle(element, 'position') == 'absolute') break;
|
2107
2390
|
|
@@ -2128,28 +2411,22 @@ Element.Methods = {
|
|
2128
2411
|
offsetLeft: 0
|
2129
2412
|
}, arguments[2] || { });
|
2130
2413
|
|
2131
|
-
// find page position of source
|
2132
2414
|
source = $(source);
|
2133
|
-
var p =
|
2415
|
+
var p = Element.viewportOffset(source);
|
2134
2416
|
|
2135
|
-
// find coordinate system to use
|
2136
2417
|
element = $(element);
|
2137
2418
|
var delta = [0, 0];
|
2138
2419
|
var parent = null;
|
2139
|
-
// delta [0,0] will do fine with position: fixed elements,
|
2140
|
-
// position:absolute needs offsetParent deltas
|
2141
2420
|
if (Element.getStyle(element, 'position') == 'absolute') {
|
2142
|
-
parent =
|
2143
|
-
delta =
|
2421
|
+
parent = Element.getOffsetParent(element);
|
2422
|
+
delta = Element.viewportOffset(parent);
|
2144
2423
|
}
|
2145
2424
|
|
2146
|
-
// correct by body offsets (fixes Safari)
|
2147
2425
|
if (parent == document.body) {
|
2148
2426
|
delta[0] -= document.body.offsetLeft;
|
2149
2427
|
delta[1] -= document.body.offsetTop;
|
2150
2428
|
}
|
2151
2429
|
|
2152
|
-
// set position
|
2153
2430
|
if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
|
2154
2431
|
if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
|
2155
2432
|
if (options.setWidth) element.style.width = source.offsetWidth + 'px';
|
@@ -2158,10 +2435,9 @@ Element.Methods = {
|
|
2158
2435
|
}
|
2159
2436
|
};
|
2160
2437
|
|
2161
|
-
Element.Methods.identify.counter = 1;
|
2162
|
-
|
2163
2438
|
Object.extend(Element.Methods, {
|
2164
2439
|
getElementsBySelector: Element.Methods.select,
|
2440
|
+
|
2165
2441
|
childElements: Element.Methods.immediateDescendants
|
2166
2442
|
});
|
2167
2443
|
|
@@ -2182,11 +2458,8 @@ if (Prototype.Browser.Opera) {
|
|
2182
2458
|
case 'left': case 'top': case 'right': case 'bottom':
|
2183
2459
|
if (proceed(element, 'position') === 'static') return null;
|
2184
2460
|
case 'height': case 'width':
|
2185
|
-
// returns '0px' for hidden elements; we want it to return null
|
2186
2461
|
if (!Element.visible(element)) return null;
|
2187
2462
|
|
2188
|
-
// returns the border-box dimensions rather than the content-box
|
2189
|
-
// dimensions, so we subtract padding and borders from the value
|
2190
2463
|
var dim = parseInt(proceed(element, style), 10);
|
2191
2464
|
|
2192
2465
|
if (dim !== element['offset' + style.capitalize()])
|
@@ -2219,12 +2492,9 @@ if (Prototype.Browser.Opera) {
|
|
2219
2492
|
}
|
2220
2493
|
|
2221
2494
|
else if (Prototype.Browser.IE) {
|
2222
|
-
// IE doesn't report offsets correctly for static elements, so we change them
|
2223
|
-
// to "relative" to get the values, then change them back.
|
2224
2495
|
Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap(
|
2225
2496
|
function(proceed, element) {
|
2226
2497
|
element = $(element);
|
2227
|
-
// IE throws an error if element is not in document
|
2228
2498
|
try { element.offsetParent }
|
2229
2499
|
catch(e) { return $(document.body) }
|
2230
2500
|
var position = element.getStyle('position');
|
@@ -2244,8 +2514,6 @@ else if (Prototype.Browser.IE) {
|
|
2244
2514
|
catch(e) { return Element._returnOffset(0,0) }
|
2245
2515
|
var position = element.getStyle('position');
|
2246
2516
|
if (position !== 'static') return proceed(element);
|
2247
|
-
// Trigger hasLayout on the offset parent so that IE6 reports
|
2248
|
-
// accurate offsetTop and offsetLeft values for position: fixed.
|
2249
2517
|
var offsetParent = element.getOffsetParent();
|
2250
2518
|
if (offsetParent && offsetParent.getStyle('position') === 'fixed')
|
2251
2519
|
offsetParent.setStyle({ zoom: 1 });
|
@@ -2306,36 +2574,92 @@ else if (Prototype.Browser.IE) {
|
|
2306
2574
|
return element;
|
2307
2575
|
};
|
2308
2576
|
|
2309
|
-
Element._attributeTranslations = {
|
2310
|
-
|
2311
|
-
|
2312
|
-
|
2313
|
-
|
2314
|
-
|
2315
|
-
|
2316
|
-
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2331
|
-
|
2577
|
+
Element._attributeTranslations = (function(){
|
2578
|
+
|
2579
|
+
var classProp = 'className';
|
2580
|
+
var forProp = 'for';
|
2581
|
+
|
2582
|
+
var el = document.createElement('div');
|
2583
|
+
|
2584
|
+
el.setAttribute(classProp, 'x');
|
2585
|
+
|
2586
|
+
if (el.className !== 'x') {
|
2587
|
+
el.setAttribute('class', 'x');
|
2588
|
+
if (el.className === 'x') {
|
2589
|
+
classProp = 'class';
|
2590
|
+
}
|
2591
|
+
}
|
2592
|
+
el = null;
|
2593
|
+
|
2594
|
+
el = document.createElement('label');
|
2595
|
+
el.setAttribute(forProp, 'x');
|
2596
|
+
if (el.htmlFor !== 'x') {
|
2597
|
+
el.setAttribute('htmlFor', 'x');
|
2598
|
+
if (el.htmlFor === 'x') {
|
2599
|
+
forProp = 'htmlFor';
|
2600
|
+
}
|
2601
|
+
}
|
2602
|
+
el = null;
|
2603
|
+
|
2604
|
+
return {
|
2605
|
+
read: {
|
2606
|
+
names: {
|
2607
|
+
'class': classProp,
|
2608
|
+
'className': classProp,
|
2609
|
+
'for': forProp,
|
2610
|
+
'htmlFor': forProp
|
2332
2611
|
},
|
2333
|
-
|
2334
|
-
|
2612
|
+
values: {
|
2613
|
+
_getAttr: function(element, attribute) {
|
2614
|
+
return element.getAttribute(attribute);
|
2615
|
+
},
|
2616
|
+
_getAttr2: function(element, attribute) {
|
2617
|
+
return element.getAttribute(attribute, 2);
|
2618
|
+
},
|
2619
|
+
_getAttrNode: function(element, attribute) {
|
2620
|
+
var node = element.getAttributeNode(attribute);
|
2621
|
+
return node ? node.value : "";
|
2622
|
+
},
|
2623
|
+
_getEv: (function(){
|
2624
|
+
|
2625
|
+
var el = document.createElement('div');
|
2626
|
+
el.onclick = Prototype.emptyFunction;
|
2627
|
+
var value = el.getAttribute('onclick');
|
2628
|
+
var f;
|
2629
|
+
|
2630
|
+
if (String(value).indexOf('{') > -1) {
|
2631
|
+
f = function(element, attribute) {
|
2632
|
+
attribute = element.getAttribute(attribute);
|
2633
|
+
if (!attribute) return null;
|
2634
|
+
attribute = attribute.toString();
|
2635
|
+
attribute = attribute.split('{')[1];
|
2636
|
+
attribute = attribute.split('}')[0];
|
2637
|
+
return attribute.strip();
|
2638
|
+
};
|
2639
|
+
}
|
2640
|
+
else if (value === '') {
|
2641
|
+
f = function(element, attribute) {
|
2642
|
+
attribute = element.getAttribute(attribute);
|
2643
|
+
if (!attribute) return null;
|
2644
|
+
return attribute.strip();
|
2645
|
+
};
|
2646
|
+
}
|
2647
|
+
el = null;
|
2648
|
+
return f;
|
2649
|
+
})(),
|
2650
|
+
_flag: function(element, attribute) {
|
2651
|
+
return $(element).hasAttribute(attribute) ? attribute : null;
|
2652
|
+
},
|
2653
|
+
style: function(element) {
|
2654
|
+
return element.style.cssText.toLowerCase();
|
2655
|
+
},
|
2656
|
+
title: function(element) {
|
2657
|
+
return element.title;
|
2658
|
+
}
|
2335
2659
|
}
|
2336
2660
|
}
|
2337
2661
|
}
|
2338
|
-
};
|
2662
|
+
})();
|
2339
2663
|
|
2340
2664
|
Element._attributeTranslations.write = {
|
2341
2665
|
names: Object.extend({
|
@@ -2363,8 +2687,8 @@ else if (Prototype.Browser.IE) {
|
|
2363
2687
|
|
2364
2688
|
(function(v) {
|
2365
2689
|
Object.extend(v, {
|
2366
|
-
href: v.
|
2367
|
-
src: v.
|
2690
|
+
href: v._getAttr2,
|
2691
|
+
src: v._getAttr2,
|
2368
2692
|
type: v._getAttr,
|
2369
2693
|
action: v._getAttrNode,
|
2370
2694
|
disabled: v._flag,
|
@@ -2391,6 +2715,26 @@ else if (Prototype.Browser.IE) {
|
|
2391
2715
|
onchange: v._getEv
|
2392
2716
|
});
|
2393
2717
|
})(Element._attributeTranslations.read.values);
|
2718
|
+
|
2719
|
+
if (Prototype.BrowserFeatures.ElementExtensions) {
|
2720
|
+
(function() {
|
2721
|
+
function _descendants(element) {
|
2722
|
+
var nodes = element.getElementsByTagName('*'), results = [];
|
2723
|
+
for (var i = 0, node; node = nodes[i]; i++)
|
2724
|
+
if (node.tagName !== "!") // Filter out comment nodes.
|
2725
|
+
results.push(node);
|
2726
|
+
return results;
|
2727
|
+
}
|
2728
|
+
|
2729
|
+
Element.Methods.down = function(element, expression, index) {
|
2730
|
+
element = $(element);
|
2731
|
+
if (arguments.length == 1) return element.firstDescendant();
|
2732
|
+
return Object.isNumber(expression) ? _descendants(element)[expression] :
|
2733
|
+
Element.select(element, expression)[index || 0];
|
2734
|
+
}
|
2735
|
+
})();
|
2736
|
+
}
|
2737
|
+
|
2394
2738
|
}
|
2395
2739
|
|
2396
2740
|
else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
|
@@ -2420,9 +2764,6 @@ else if (Prototype.Browser.WebKit) {
|
|
2420
2764
|
return element;
|
2421
2765
|
};
|
2422
2766
|
|
2423
|
-
// Safari returns margins on body which is incorrect if the child is absolutely
|
2424
|
-
// positioned. For performance reasons, redefine Element#cumulativeOffset for
|
2425
|
-
// KHTML/WebKit only.
|
2426
2767
|
Element.Methods.cumulativeOffset = function(element) {
|
2427
2768
|
var valueT = 0, valueL = 0;
|
2428
2769
|
do {
|
@@ -2438,30 +2779,7 @@ else if (Prototype.Browser.WebKit) {
|
|
2438
2779
|
};
|
2439
2780
|
}
|
2440
2781
|
|
2441
|
-
if (
|
2442
|
-
// IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
|
2443
|
-
Element.Methods.update = function(element, content) {
|
2444
|
-
element = $(element);
|
2445
|
-
|
2446
|
-
if (content && content.toElement) content = content.toElement();
|
2447
|
-
if (Object.isElement(content)) return element.update().insert(content);
|
2448
|
-
|
2449
|
-
content = Object.toHTML(content);
|
2450
|
-
var tagName = element.tagName.toUpperCase();
|
2451
|
-
|
2452
|
-
if (tagName in Element._insertionTranslations.tags) {
|
2453
|
-
$A(element.childNodes).each(function(node) { element.removeChild(node) });
|
2454
|
-
Element._getContentFromAnonymousElement(tagName, content.stripScripts())
|
2455
|
-
.each(function(node) { element.appendChild(node) });
|
2456
|
-
}
|
2457
|
-
else element.innerHTML = content.stripScripts();
|
2458
|
-
|
2459
|
-
content.evalScripts.bind(content).defer();
|
2460
|
-
return element;
|
2461
|
-
};
|
2462
|
-
}
|
2463
|
-
|
2464
|
-
if ('outerHTML' in document.createElement('div')) {
|
2782
|
+
if ('outerHTML' in document.documentElement) {
|
2465
2783
|
Element.Methods.replace = function(element, content) {
|
2466
2784
|
element = $(element);
|
2467
2785
|
|
@@ -2529,12 +2847,13 @@ Element._insertionTranslations = {
|
|
2529
2847
|
};
|
2530
2848
|
|
2531
2849
|
(function() {
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2850
|
+
var tags = Element._insertionTranslations.tags;
|
2851
|
+
Object.extend(tags, {
|
2852
|
+
THEAD: tags.TBODY,
|
2853
|
+
TFOOT: tags.TBODY,
|
2854
|
+
TH: tags.TD
|
2536
2855
|
});
|
2537
|
-
})
|
2856
|
+
})();
|
2538
2857
|
|
2539
2858
|
Element.Methods.Simulated = {
|
2540
2859
|
hasAttribute: function(element, attribute) {
|
@@ -2548,41 +2867,81 @@ Element.Methods.ByTag = { };
|
|
2548
2867
|
|
2549
2868
|
Object.extend(Element, Element.Methods);
|
2550
2869
|
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2870
|
+
(function(div) {
|
2871
|
+
|
2872
|
+
if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) {
|
2873
|
+
window.HTMLElement = { };
|
2874
|
+
window.HTMLElement.prototype = div['__proto__'];
|
2875
|
+
Prototype.BrowserFeatures.ElementExtensions = true;
|
2876
|
+
}
|
2877
|
+
|
2878
|
+
div = null;
|
2879
|
+
|
2880
|
+
})(document.createElement('div'))
|
2557
2881
|
|
2558
2882
|
Element.extend = (function() {
|
2559
|
-
|
2883
|
+
|
2884
|
+
function checkDeficiency(tagName) {
|
2885
|
+
if (typeof window.Element != 'undefined') {
|
2886
|
+
var proto = window.Element.prototype;
|
2887
|
+
if (proto) {
|
2888
|
+
var id = '_' + (Math.random()+'').slice(2);
|
2889
|
+
var el = document.createElement(tagName);
|
2890
|
+
proto[id] = 'x';
|
2891
|
+
var isBuggy = (el[id] !== 'x');
|
2892
|
+
delete proto[id];
|
2893
|
+
el = null;
|
2894
|
+
return isBuggy;
|
2895
|
+
}
|
2896
|
+
}
|
2897
|
+
return false;
|
2898
|
+
}
|
2899
|
+
|
2900
|
+
function extendElementWith(element, methods) {
|
2901
|
+
for (var property in methods) {
|
2902
|
+
var value = methods[property];
|
2903
|
+
if (Object.isFunction(value) && !(property in element))
|
2904
|
+
element[property] = value.methodize();
|
2905
|
+
}
|
2906
|
+
}
|
2907
|
+
|
2908
|
+
var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object');
|
2909
|
+
|
2910
|
+
if (Prototype.BrowserFeatures.SpecificElementExtensions) {
|
2911
|
+
if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) {
|
2912
|
+
return function(element) {
|
2913
|
+
if (element && typeof element._extendedByPrototype == 'undefined') {
|
2914
|
+
var t = element.tagName;
|
2915
|
+
if (t && (/^(?:object|applet|embed)$/i.test(t))) {
|
2916
|
+
extendElementWith(element, Element.Methods);
|
2917
|
+
extendElementWith(element, Element.Methods.Simulated);
|
2918
|
+
extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]);
|
2919
|
+
}
|
2920
|
+
}
|
2921
|
+
return element;
|
2922
|
+
}
|
2923
|
+
}
|
2560
2924
|
return Prototype.K;
|
2925
|
+
}
|
2561
2926
|
|
2562
2927
|
var Methods = { }, ByTag = Element.Methods.ByTag;
|
2563
2928
|
|
2564
2929
|
var extend = Object.extend(function(element) {
|
2565
|
-
if (!element || element._extendedByPrototype ||
|
2930
|
+
if (!element || typeof element._extendedByPrototype != 'undefined' ||
|
2566
2931
|
element.nodeType != 1 || element == window) return element;
|
2567
2932
|
|
2568
2933
|
var methods = Object.clone(Methods),
|
2569
|
-
|
2934
|
+
tagName = element.tagName.toUpperCase();
|
2570
2935
|
|
2571
|
-
// extend methods for specific tags
|
2572
2936
|
if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
|
2573
2937
|
|
2574
|
-
|
2575
|
-
value = methods[property];
|
2576
|
-
if (Object.isFunction(value) && !(property in element))
|
2577
|
-
element[property] = value.methodize();
|
2578
|
-
}
|
2938
|
+
extendElementWith(element, methods);
|
2579
2939
|
|
2580
2940
|
element._extendedByPrototype = Prototype.emptyFunction;
|
2581
2941
|
return element;
|
2582
2942
|
|
2583
2943
|
}, {
|
2584
2944
|
refresh: function() {
|
2585
|
-
// extend methods for all tags (Safari doesn't need this)
|
2586
2945
|
if (!Prototype.BrowserFeatures.ElementExtensions) {
|
2587
2946
|
Object.extend(Methods, Element.Methods);
|
2588
2947
|
Object.extend(Methods, Element.Methods.Simulated);
|
@@ -2661,14 +3020,18 @@ Element.addMethods = function(methods) {
|
|
2661
3020
|
klass = 'HTML' + tagName.capitalize() + 'Element';
|
2662
3021
|
if (window[klass]) return window[klass];
|
2663
3022
|
|
2664
|
-
|
2665
|
-
|
2666
|
-
|
3023
|
+
var element = document.createElement(tagName);
|
3024
|
+
var proto = element['__proto__'] || element.constructor.prototype;
|
3025
|
+
element = null;
|
3026
|
+
return proto;
|
2667
3027
|
}
|
2668
3028
|
|
3029
|
+
var elementPrototype = window.HTMLElement ? HTMLElement.prototype :
|
3030
|
+
Element.prototype;
|
3031
|
+
|
2669
3032
|
if (F.ElementExtensions) {
|
2670
|
-
copy(Element.Methods,
|
2671
|
-
copy(Element.Methods.Simulated,
|
3033
|
+
copy(Element.Methods, elementPrototype);
|
3034
|
+
copy(Element.Methods.Simulated, elementPrototype, true);
|
2672
3035
|
}
|
2673
3036
|
|
2674
3037
|
if (F.SpecificElementExtensions) {
|
@@ -2686,38 +3049,109 @@ Element.addMethods = function(methods) {
|
|
2686
3049
|
Element.cache = { };
|
2687
3050
|
};
|
2688
3051
|
|
2689
|
-
document.viewport = {
|
2690
|
-
getDimensions: function() {
|
2691
|
-
var dimensions = { }, B = Prototype.Browser;
|
2692
|
-
$w('width height').each(function(d) {
|
2693
|
-
var D = d.capitalize();
|
2694
|
-
if (B.WebKit && !document.evaluate) {
|
2695
|
-
// Safari <3.0 needs self.innerWidth/Height
|
2696
|
-
dimensions[d] = self['inner' + D];
|
2697
|
-
} else if (B.Opera && parseFloat(window.opera.version()) < 9.5) {
|
2698
|
-
// Opera <9.5 needs document.body.clientWidth/Height
|
2699
|
-
dimensions[d] = document.body['client' + D]
|
2700
|
-
} else {
|
2701
|
-
dimensions[d] = document.documentElement['client' + D];
|
2702
|
-
}
|
2703
|
-
});
|
2704
|
-
return dimensions;
|
2705
|
-
},
|
2706
3052
|
|
2707
|
-
|
2708
|
-
return this.getDimensions().width;
|
2709
|
-
},
|
3053
|
+
document.viewport = {
|
2710
3054
|
|
2711
|
-
|
2712
|
-
return this.
|
3055
|
+
getDimensions: function() {
|
3056
|
+
return { width: this.getWidth(), height: this.getHeight() };
|
2713
3057
|
},
|
2714
3058
|
|
2715
3059
|
getScrollOffsets: function() {
|
2716
3060
|
return Element._returnOffset(
|
2717
3061
|
window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
|
2718
|
-
window.pageYOffset || document.documentElement.scrollTop
|
3062
|
+
window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
|
3063
|
+
}
|
3064
|
+
};
|
3065
|
+
|
3066
|
+
(function(viewport) {
|
3067
|
+
var B = Prototype.Browser, doc = document, element, property = {};
|
3068
|
+
|
3069
|
+
function getRootElement() {
|
3070
|
+
if (B.WebKit && !doc.evaluate)
|
3071
|
+
return document;
|
3072
|
+
|
3073
|
+
if (B.Opera && window.parseFloat(window.opera.version()) < 9.5)
|
3074
|
+
return document.body;
|
3075
|
+
|
3076
|
+
return document.documentElement;
|
3077
|
+
}
|
3078
|
+
|
3079
|
+
function define(D) {
|
3080
|
+
if (!element) element = getRootElement();
|
3081
|
+
|
3082
|
+
property[D] = 'client' + D;
|
3083
|
+
|
3084
|
+
viewport['get' + D] = function() { return element[property[D]] };
|
3085
|
+
return viewport['get' + D]();
|
2719
3086
|
}
|
3087
|
+
|
3088
|
+
viewport.getWidth = define.curry('Width');
|
3089
|
+
|
3090
|
+
viewport.getHeight = define.curry('Height');
|
3091
|
+
})(document.viewport);
|
3092
|
+
|
3093
|
+
|
3094
|
+
Element.Storage = {
|
3095
|
+
UID: 1
|
2720
3096
|
};
|
3097
|
+
|
3098
|
+
Element.addMethods({
|
3099
|
+
getStorage: function(element) {
|
3100
|
+
if (!(element = $(element))) return;
|
3101
|
+
|
3102
|
+
var uid;
|
3103
|
+
if (element === window) {
|
3104
|
+
uid = 0;
|
3105
|
+
} else {
|
3106
|
+
if (typeof element._prototypeUID === "undefined")
|
3107
|
+
element._prototypeUID = [Element.Storage.UID++];
|
3108
|
+
uid = element._prototypeUID[0];
|
3109
|
+
}
|
3110
|
+
|
3111
|
+
if (!Element.Storage[uid])
|
3112
|
+
Element.Storage[uid] = $H();
|
3113
|
+
|
3114
|
+
return Element.Storage[uid];
|
3115
|
+
},
|
3116
|
+
|
3117
|
+
store: function(element, key, value) {
|
3118
|
+
if (!(element = $(element))) return;
|
3119
|
+
|
3120
|
+
if (arguments.length === 2) {
|
3121
|
+
Element.getStorage(element).update(key);
|
3122
|
+
} else {
|
3123
|
+
Element.getStorage(element).set(key, value);
|
3124
|
+
}
|
3125
|
+
|
3126
|
+
return element;
|
3127
|
+
},
|
3128
|
+
|
3129
|
+
retrieve: function(element, key, defaultValue) {
|
3130
|
+
if (!(element = $(element))) return;
|
3131
|
+
var hash = Element.getStorage(element), value = hash.get(key);
|
3132
|
+
|
3133
|
+
if (Object.isUndefined(value)) {
|
3134
|
+
hash.set(key, defaultValue);
|
3135
|
+
value = defaultValue;
|
3136
|
+
}
|
3137
|
+
|
3138
|
+
return value;
|
3139
|
+
},
|
3140
|
+
|
3141
|
+
clone: function(element, deep) {
|
3142
|
+
if (!(element = $(element))) return;
|
3143
|
+
var clone = element.cloneNode(deep);
|
3144
|
+
clone._prototypeUID = void 0;
|
3145
|
+
if (deep) {
|
3146
|
+
var descendants = Element.select(clone, '*'),
|
3147
|
+
i = descendants.length;
|
3148
|
+
while (i--) {
|
3149
|
+
descendants[i]._prototypeUID = void 0;
|
3150
|
+
}
|
3151
|
+
}
|
3152
|
+
return Element.extend(clone);
|
3153
|
+
}
|
3154
|
+
});
|
2721
3155
|
/* Portions of the Selector class are derived from Jack Slocum's DomQuery,
|
2722
3156
|
* part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
|
2723
3157
|
* license. Please see http://www.yui-ext.com/ for more information. */
|
@@ -2738,31 +3172,52 @@ var Selector = Class.create({
|
|
2738
3172
|
|
2739
3173
|
},
|
2740
3174
|
|
2741
|
-
shouldUseXPath: function() {
|
2742
|
-
if (!Prototype.BrowserFeatures.XPath) return false;
|
3175
|
+
shouldUseXPath: (function() {
|
2743
3176
|
|
2744
|
-
var
|
3177
|
+
var IS_DESCENDANT_SELECTOR_BUGGY = (function(){
|
3178
|
+
var isBuggy = false;
|
3179
|
+
if (document.evaluate && window.XPathResult) {
|
3180
|
+
var el = document.createElement('div');
|
3181
|
+
el.innerHTML = '<ul><li></li></ul><div><ul><li></li></ul></div>';
|
2745
3182
|
|
2746
|
-
|
2747
|
-
|
2748
|
-
(e.include("-of-type") || e.include(":empty")))
|
2749
|
-
return false;
|
3183
|
+
var xpath = ".//*[local-name()='ul' or local-name()='UL']" +
|
3184
|
+
"//*[local-name()='li' or local-name()='LI']";
|
2750
3185
|
|
2751
|
-
|
2752
|
-
|
2753
|
-
if ((/(\[[\w-]*?:|:checked)/).test(e))
|
2754
|
-
return false;
|
3186
|
+
var result = document.evaluate(xpath, el, null,
|
3187
|
+
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
|
2755
3188
|
|
2756
|
-
|
2757
|
-
|
3189
|
+
isBuggy = (result.snapshotLength !== 2);
|
3190
|
+
el = null;
|
3191
|
+
}
|
3192
|
+
return isBuggy;
|
3193
|
+
})();
|
3194
|
+
|
3195
|
+
return function() {
|
3196
|
+
if (!Prototype.BrowserFeatures.XPath) return false;
|
3197
|
+
|
3198
|
+
var e = this.expression;
|
3199
|
+
|
3200
|
+
if (Prototype.Browser.WebKit &&
|
3201
|
+
(e.include("-of-type") || e.include(":empty")))
|
3202
|
+
return false;
|
3203
|
+
|
3204
|
+
if ((/(\[[\w-]*?:|:checked)/).test(e))
|
3205
|
+
return false;
|
3206
|
+
|
3207
|
+
if (IS_DESCENDANT_SELECTOR_BUGGY) return false;
|
3208
|
+
|
3209
|
+
return true;
|
3210
|
+
}
|
3211
|
+
|
3212
|
+
})(),
|
2758
3213
|
|
2759
3214
|
shouldUseSelectorsAPI: function() {
|
2760
3215
|
if (!Prototype.BrowserFeatures.SelectorsAPI) return false;
|
2761
3216
|
|
3217
|
+
if (Selector.CASE_INSENSITIVE_CLASS_NAMES) return false;
|
3218
|
+
|
2762
3219
|
if (!Selector._div) Selector._div = new Element('div');
|
2763
3220
|
|
2764
|
-
// Make sure the browser treats the selector as valid. Test on an
|
2765
|
-
// isolated element to minimize cost of this check.
|
2766
3221
|
try {
|
2767
3222
|
Selector._div.querySelector(this.expression);
|
2768
3223
|
} catch(e) {
|
@@ -2774,7 +3229,7 @@ var Selector = Class.create({
|
|
2774
3229
|
|
2775
3230
|
compileMatcher: function() {
|
2776
3231
|
var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
|
2777
|
-
c = Selector.criteria, le, p, m;
|
3232
|
+
c = Selector.criteria, le, p, m, len = ps.length, name;
|
2778
3233
|
|
2779
3234
|
if (Selector._cache[e]) {
|
2780
3235
|
this.matcher = Selector._cache[e];
|
@@ -2786,11 +3241,12 @@ var Selector = Class.create({
|
|
2786
3241
|
|
2787
3242
|
while (e && le != e && (/\S/).test(e)) {
|
2788
3243
|
le = e;
|
2789
|
-
for (var i
|
2790
|
-
p = ps[i];
|
3244
|
+
for (var i = 0; i<len; i++) {
|
3245
|
+
p = ps[i].re;
|
3246
|
+
name = ps[i].name;
|
2791
3247
|
if (m = e.match(p)) {
|
2792
|
-
this.matcher.push(Object.isFunction(c[
|
2793
|
-
new Template(c[
|
3248
|
+
this.matcher.push(Object.isFunction(c[name]) ? c[name](m) :
|
3249
|
+
new Template(c[name]).evaluate(m));
|
2794
3250
|
e = e.replace(m[0], '');
|
2795
3251
|
break;
|
2796
3252
|
}
|
@@ -2804,7 +3260,7 @@ var Selector = Class.create({
|
|
2804
3260
|
|
2805
3261
|
compileXPathMatcher: function() {
|
2806
3262
|
var e = this.expression, ps = Selector.patterns,
|
2807
|
-
x = Selector.xpath, le, m;
|
3263
|
+
x = Selector.xpath, le, m, len = ps.length, name;
|
2808
3264
|
|
2809
3265
|
if (Selector._cache[e]) {
|
2810
3266
|
this.xpath = Selector._cache[e]; return;
|
@@ -2813,10 +3269,11 @@ var Selector = Class.create({
|
|
2813
3269
|
this.matcher = ['.//*'];
|
2814
3270
|
while (e && le != e && (/\S/).test(e)) {
|
2815
3271
|
le = e;
|
2816
|
-
for (var i
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
3272
|
+
for (var i = 0; i<len; i++) {
|
3273
|
+
name = ps[i].name;
|
3274
|
+
if (m = e.match(ps[i].re)) {
|
3275
|
+
this.matcher.push(Object.isFunction(x[name]) ? x[name](m) :
|
3276
|
+
new Template(x[name]).evaluate(m));
|
2820
3277
|
e = e.replace(m[0], '');
|
2821
3278
|
break;
|
2822
3279
|
}
|
@@ -2833,11 +3290,9 @@ var Selector = Class.create({
|
|
2833
3290
|
|
2834
3291
|
switch (this.mode) {
|
2835
3292
|
case 'selectorsAPI':
|
2836
|
-
// querySelectorAll queries document-wide, then filters to descendants
|
2837
|
-
// of the context element. That's not what we want.
|
2838
|
-
// Add an explicit context to the selector if necessary.
|
2839
3293
|
if (root !== document) {
|
2840
3294
|
var oldId = root.id, id = $(root).identify();
|
3295
|
+
id = id.replace(/([\.:])/g, "\\$1");
|
2841
3296
|
e = "#" + id + " " + e;
|
2842
3297
|
}
|
2843
3298
|
|
@@ -2856,21 +3311,18 @@ var Selector = Class.create({
|
|
2856
3311
|
this.tokens = [];
|
2857
3312
|
|
2858
3313
|
var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
|
2859
|
-
var le, p, m;
|
3314
|
+
var le, p, m, len = ps.length, name;
|
2860
3315
|
|
2861
3316
|
while (e && le !== e && (/\S/).test(e)) {
|
2862
3317
|
le = e;
|
2863
|
-
for (var i
|
2864
|
-
p = ps[i];
|
3318
|
+
for (var i = 0; i<len; i++) {
|
3319
|
+
p = ps[i].re;
|
3320
|
+
name = ps[i].name;
|
2865
3321
|
if (m = e.match(p)) {
|
2866
|
-
|
2867
|
-
|
2868
|
-
if (as[i]) {
|
2869
|
-
this.tokens.push([i, Object.clone(m)]);
|
3322
|
+
if (as[name]) {
|
3323
|
+
this.tokens.push([name, Object.clone(m)]);
|
2870
3324
|
e = e.replace(m[0], '');
|
2871
3325
|
} else {
|
2872
|
-
// reluctantly do a document-wide search
|
2873
|
-
// and look for a match in the array
|
2874
3326
|
return this.findElements(document).include(element);
|
2875
3327
|
}
|
2876
3328
|
}
|
@@ -2897,6 +3349,21 @@ var Selector = Class.create({
|
|
2897
3349
|
}
|
2898
3350
|
});
|
2899
3351
|
|
3352
|
+
if (Prototype.BrowserFeatures.SelectorsAPI &&
|
3353
|
+
document.compatMode === 'BackCompat') {
|
3354
|
+
Selector.CASE_INSENSITIVE_CLASS_NAMES = (function(){
|
3355
|
+
var div = document.createElement('div'),
|
3356
|
+
span = document.createElement('span');
|
3357
|
+
|
3358
|
+
div.id = "prototype_test_id";
|
3359
|
+
span.className = 'Test';
|
3360
|
+
div.appendChild(span);
|
3361
|
+
var isIgnored = (div.querySelector('#prototype_test_id .test') !== null);
|
3362
|
+
div = span = null;
|
3363
|
+
return isIgnored;
|
3364
|
+
})();
|
3365
|
+
}
|
3366
|
+
|
2900
3367
|
Object.extend(Selector, {
|
2901
3368
|
_cache: { },
|
2902
3369
|
|
@@ -2946,14 +3413,15 @@ Object.extend(Selector, {
|
|
2946
3413
|
'enabled': "[not(@disabled) and (@type!='hidden')]",
|
2947
3414
|
'not': function(m) {
|
2948
3415
|
var e = m[6], p = Selector.patterns,
|
2949
|
-
x = Selector.xpath, le, v;
|
3416
|
+
x = Selector.xpath, le, v, len = p.length, name;
|
2950
3417
|
|
2951
3418
|
var exclusion = [];
|
2952
3419
|
while (e && le != e && (/\S/).test(e)) {
|
2953
3420
|
le = e;
|
2954
|
-
for (var i
|
2955
|
-
|
2956
|
-
|
3421
|
+
for (var i = 0; i<len; i++) {
|
3422
|
+
name = p[i].name
|
3423
|
+
if (m = e.match(p[i].re)) {
|
3424
|
+
v = Object.isFunction(x[name]) ? x[name](m) : new Template(x[name]).evaluate(m);
|
2957
3425
|
exclusion.push("(" + v.substring(1, v.length - 1) + ")");
|
2958
3426
|
e = e.replace(m[0], '');
|
2959
3427
|
break;
|
@@ -3021,25 +3489,20 @@ Object.extend(Selector, {
|
|
3021
3489
|
laterSibling: 'c = "laterSibling";'
|
3022
3490
|
},
|
3023
3491
|
|
3024
|
-
patterns:
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
adjacent: /^\s*\+\s*/,
|
3030
|
-
descendant: /^\s/,
|
3492
|
+
patterns: [
|
3493
|
+
{ name: 'laterSibling', re: /^\s*~\s*/ },
|
3494
|
+
{ name: 'child', re: /^\s*>\s*/ },
|
3495
|
+
{ name: 'adjacent', re: /^\s*\+\s*/ },
|
3496
|
+
{ name: 'descendant', re: /^\s/ },
|
3031
3497
|
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
3036
|
-
|
3037
|
-
|
3038
|
-
|
3039
|
-
attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
|
3040
|
-
},
|
3498
|
+
{ name: 'tagName', re: /^\s*(\*|[\w\-]+)(\b|$)?/ },
|
3499
|
+
{ name: 'id', re: /^#([\w\-\*]+)(\b|$)/ },
|
3500
|
+
{ name: 'className', re: /^\.([\w\-\*]+)(\b|$)/ },
|
3501
|
+
{ name: 'pseudo', re: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/ },
|
3502
|
+
{ name: 'attrPresence', re: /^\[((?:[\w-]+:)?[\w-]+)\]/ },
|
3503
|
+
{ name: 'attr', re: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ }
|
3504
|
+
],
|
3041
3505
|
|
3042
|
-
// for Selector.match and Element#match
|
3043
3506
|
assertions: {
|
3044
3507
|
tagName: function(element, matches) {
|
3045
3508
|
return matches[1].toUpperCase() == element.tagName.toUpperCase();
|
@@ -3064,15 +3527,12 @@ Object.extend(Selector, {
|
|
3064
3527
|
},
|
3065
3528
|
|
3066
3529
|
handlers: {
|
3067
|
-
// UTILITY FUNCTIONS
|
3068
|
-
// joins two collections
|
3069
3530
|
concat: function(a, b) {
|
3070
3531
|
for (var i = 0, node; node = b[i]; i++)
|
3071
3532
|
a.push(node);
|
3072
3533
|
return a;
|
3073
3534
|
},
|
3074
3535
|
|
3075
|
-
// marks an array of nodes for counting
|
3076
3536
|
mark: function(nodes) {
|
3077
3537
|
var _true = Prototype.emptyFunction;
|
3078
3538
|
for (var i = 0, node; node = nodes[i]; i++)
|
@@ -3080,15 +3540,32 @@ Object.extend(Selector, {
|
|
3080
3540
|
return nodes;
|
3081
3541
|
},
|
3082
3542
|
|
3083
|
-
unmark: function(
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3543
|
+
unmark: (function(){
|
3544
|
+
|
3545
|
+
var PROPERTIES_ATTRIBUTES_MAP = (function(){
|
3546
|
+
var el = document.createElement('div'),
|
3547
|
+
isBuggy = false,
|
3548
|
+
propName = '_countedByPrototype',
|
3549
|
+
value = 'x'
|
3550
|
+
el[propName] = value;
|
3551
|
+
isBuggy = (el.getAttribute(propName) === value);
|
3552
|
+
el = null;
|
3553
|
+
return isBuggy;
|
3554
|
+
})();
|
3555
|
+
|
3556
|
+
return PROPERTIES_ATTRIBUTES_MAP ?
|
3557
|
+
function(nodes) {
|
3558
|
+
for (var i = 0, node; node = nodes[i]; i++)
|
3559
|
+
node.removeAttribute('_countedByPrototype');
|
3560
|
+
return nodes;
|
3561
|
+
} :
|
3562
|
+
function(nodes) {
|
3563
|
+
for (var i = 0, node; node = nodes[i]; i++)
|
3564
|
+
node._countedByPrototype = void 0;
|
3565
|
+
return nodes;
|
3566
|
+
}
|
3567
|
+
})(),
|
3088
3568
|
|
3089
|
-
// mark each child node with its position (for nth calls)
|
3090
|
-
// "ofType" flag indicates whether we're indexing for nth-of-type
|
3091
|
-
// rather than nth-child
|
3092
3569
|
index: function(parentNode, reverse, ofType) {
|
3093
3570
|
parentNode._countedByPrototype = Prototype.emptyFunction;
|
3094
3571
|
if (reverse) {
|
@@ -3102,19 +3579,17 @@ Object.extend(Selector, {
|
|
3102
3579
|
}
|
3103
3580
|
},
|
3104
3581
|
|
3105
|
-
// filters out duplicates and extends all nodes
|
3106
3582
|
unique: function(nodes) {
|
3107
3583
|
if (nodes.length == 0) return nodes;
|
3108
3584
|
var results = [], n;
|
3109
3585
|
for (var i = 0, l = nodes.length; i < l; i++)
|
3110
|
-
if (
|
3586
|
+
if (typeof (n = nodes[i])._countedByPrototype == 'undefined') {
|
3111
3587
|
n._countedByPrototype = Prototype.emptyFunction;
|
3112
3588
|
results.push(Element.extend(n));
|
3113
3589
|
}
|
3114
3590
|
return Selector.handlers.unmark(results);
|
3115
3591
|
},
|
3116
3592
|
|
3117
|
-
// COMBINATOR FUNCTIONS
|
3118
3593
|
descendant: function(nodes) {
|
3119
3594
|
var h = Selector.handlers;
|
3120
3595
|
for (var i = 0, results = [], node; node = nodes[i]; i++)
|
@@ -3158,13 +3633,11 @@ Object.extend(Selector, {
|
|
3158
3633
|
return null;
|
3159
3634
|
},
|
3160
3635
|
|
3161
|
-
// TOKEN FUNCTIONS
|
3162
3636
|
tagName: function(nodes, root, tagName, combinator) {
|
3163
3637
|
var uTagName = tagName.toUpperCase();
|
3164
3638
|
var results = [], h = Selector.handlers;
|
3165
3639
|
if (nodes) {
|
3166
3640
|
if (combinator) {
|
3167
|
-
// fastlane for ordinary descendant combinators
|
3168
3641
|
if (combinator == "descendant") {
|
3169
3642
|
for (var i = 0, node; node = nodes[i]; i++)
|
3170
3643
|
h.concat(results, node.getElementsByTagName(tagName));
|
@@ -3180,8 +3653,19 @@ Object.extend(Selector, {
|
|
3180
3653
|
|
3181
3654
|
id: function(nodes, root, id, combinator) {
|
3182
3655
|
var targetNode = $(id), h = Selector.handlers;
|
3183
|
-
|
3184
|
-
if (
|
3656
|
+
|
3657
|
+
if (root == document) {
|
3658
|
+
if (!targetNode) return [];
|
3659
|
+
if (!nodes) return [targetNode];
|
3660
|
+
} else {
|
3661
|
+
if (!root.sourceIndex || root.sourceIndex < 1) {
|
3662
|
+
var nodes = root.getElementsByTagName('*');
|
3663
|
+
for (var j = 0, node; node = nodes[j]; j++) {
|
3664
|
+
if (node.id === id) return [node];
|
3665
|
+
}
|
3666
|
+
}
|
3667
|
+
}
|
3668
|
+
|
3185
3669
|
if (nodes) {
|
3186
3670
|
if (combinator) {
|
3187
3671
|
if (combinator == 'child') {
|
@@ -3293,7 +3777,6 @@ Object.extend(Selector, {
|
|
3293
3777
|
return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
|
3294
3778
|
},
|
3295
3779
|
|
3296
|
-
// handles the an+b logic
|
3297
3780
|
getIndices: function(a, b, total) {
|
3298
3781
|
if (a == 0) return b > 0 ? [b] : [];
|
3299
3782
|
return $R(1, total).inject([], function(memo, i) {
|
@@ -3302,7 +3785,6 @@ Object.extend(Selector, {
|
|
3302
3785
|
});
|
3303
3786
|
},
|
3304
3787
|
|
3305
|
-
// handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
|
3306
3788
|
nth: function(nodes, formula, root, reverse, ofType) {
|
3307
3789
|
if (nodes.length == 0) return [];
|
3308
3790
|
if (formula == 'even') formula = '2n+0';
|
@@ -3336,7 +3818,6 @@ Object.extend(Selector, {
|
|
3336
3818
|
|
3337
3819
|
'empty': function(nodes, value, root) {
|
3338
3820
|
for (var i = 0, results = [], node; node = nodes[i]; i++) {
|
3339
|
-
// IE treats comments as element nodes
|
3340
3821
|
if (node.tagName == '!' || node.firstChild) continue;
|
3341
3822
|
results.push(node);
|
3342
3823
|
}
|
@@ -3379,8 +3860,6 @@ Object.extend(Selector, {
|
|
3379
3860
|
'^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); },
|
3380
3861
|
'$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); },
|
3381
3862
|
'*=': function(nv, v) { return nv == v || nv && nv.include(v); },
|
3382
|
-
'$=': function(nv, v) { return nv.endsWith(v); },
|
3383
|
-
'*=': function(nv, v) { return nv.include(v); },
|
3384
3863
|
'~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
|
3385
3864
|
'|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() +
|
3386
3865
|
'-').include('-' + (v || "").toUpperCase() + '-'); }
|
@@ -3423,19 +3902,10 @@ Object.extend(Selector, {
|
|
3423
3902
|
|
3424
3903
|
if (Prototype.Browser.IE) {
|
3425
3904
|
Object.extend(Selector.handlers, {
|
3426
|
-
// IE returns comment nodes on getElementsByTagName("*").
|
3427
|
-
// Filter them out.
|
3428
3905
|
concat: function(a, b) {
|
3429
3906
|
for (var i = 0, node; node = b[i]; i++)
|
3430
3907
|
if (node.tagName !== "!") a.push(node);
|
3431
3908
|
return a;
|
3432
|
-
},
|
3433
|
-
|
3434
|
-
// IE improperly serializes _countedByPrototype in (inner|outer)HTML.
|
3435
|
-
unmark: function(nodes) {
|
3436
|
-
for (var i = 0, node; node = nodes[i]; i++)
|
3437
|
-
node.removeAttribute('_countedByPrototype');
|
3438
|
-
return nodes;
|
3439
3909
|
}
|
3440
3910
|
});
|
3441
3911
|
}
|
@@ -3443,9 +3913,11 @@ if (Prototype.Browser.IE) {
|
|
3443
3913
|
function $$() {
|
3444
3914
|
return Selector.findChildElements(document, $A(arguments));
|
3445
3915
|
}
|
3916
|
+
|
3446
3917
|
var Form = {
|
3447
3918
|
reset: function(form) {
|
3448
|
-
$(form)
|
3919
|
+
form = $(form);
|
3920
|
+
form.reset();
|
3449
3921
|
return form;
|
3450
3922
|
},
|
3451
3923
|
|
@@ -3460,7 +3932,6 @@ var Form = {
|
|
3460
3932
|
if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
|
3461
3933
|
submit !== false && (!submit || key == submit) && (submitted = true)))) {
|
3462
3934
|
if (key in result) {
|
3463
|
-
// a key is already present; construct an array of values
|
3464
3935
|
if (!Object.isArray(result[key])) result[key] = [result[key]];
|
3465
3936
|
result[key].push(value);
|
3466
3937
|
}
|
@@ -3480,13 +3951,18 @@ Form.Methods = {
|
|
3480
3951
|
},
|
3481
3952
|
|
3482
3953
|
getElements: function(form) {
|
3483
|
-
|
3484
|
-
|
3485
|
-
|
3486
|
-
|
3487
|
-
|
3488
|
-
|
3489
|
-
|
3954
|
+
var elements = $(form).getElementsByTagName('*'),
|
3955
|
+
element,
|
3956
|
+
arr = [ ],
|
3957
|
+
serializers = Form.Element.Serializers;
|
3958
|
+
for (var i = 0; element = elements[i]; i++) {
|
3959
|
+
arr.push(element);
|
3960
|
+
}
|
3961
|
+
return arr.inject([], function(elements, child) {
|
3962
|
+
if (serializers[child.tagName.toLowerCase()])
|
3963
|
+
elements.push(Element.extend(child));
|
3964
|
+
return elements;
|
3965
|
+
})
|
3490
3966
|
},
|
3491
3967
|
|
3492
3968
|
getInputs: function(form, typeName, name) {
|
@@ -3526,7 +4002,7 @@ Form.Methods = {
|
|
3526
4002
|
}).sortBy(function(element) { return element.tabIndex }).first();
|
3527
4003
|
|
3528
4004
|
return firstByIndex ? firstByIndex : elements.find(function(element) {
|
3529
|
-
return
|
4005
|
+
return /^(?:input|select|textarea)$/i.test(element.tagName);
|
3530
4006
|
});
|
3531
4007
|
},
|
3532
4008
|
|
@@ -3557,6 +4033,7 @@ Form.Methods = {
|
|
3557
4033
|
|
3558
4034
|
/*--------------------------------------------------------------------------*/
|
3559
4035
|
|
4036
|
+
|
3560
4037
|
Form.Element = {
|
3561
4038
|
focus: function(element) {
|
3562
4039
|
$(element).focus();
|
@@ -3570,6 +4047,7 @@ Form.Element = {
|
|
3570
4047
|
};
|
3571
4048
|
|
3572
4049
|
Form.Element.Methods = {
|
4050
|
+
|
3573
4051
|
serialize: function(element) {
|
3574
4052
|
element = $(element);
|
3575
4053
|
if (!element.disabled && element.name) {
|
@@ -3610,7 +4088,7 @@ Form.Element.Methods = {
|
|
3610
4088
|
try {
|
3611
4089
|
element.focus();
|
3612
4090
|
if (element.select && (element.tagName.toLowerCase() != 'input' ||
|
3613
|
-
!
|
4091
|
+
!(/^(?:button|reset|submit)$/i.test(element.type))))
|
3614
4092
|
element.select();
|
3615
4093
|
} catch (e) { }
|
3616
4094
|
return element;
|
@@ -3632,6 +4110,7 @@ Form.Element.Methods = {
|
|
3632
4110
|
/*--------------------------------------------------------------------------*/
|
3633
4111
|
|
3634
4112
|
var Field = Form.Element;
|
4113
|
+
|
3635
4114
|
var $F = Form.Element.Methods.getValue;
|
3636
4115
|
|
3637
4116
|
/*--------------------------------------------------------------------------*/
|
@@ -3694,13 +4173,13 @@ Form.Element.Serializers = {
|
|
3694
4173
|
},
|
3695
4174
|
|
3696
4175
|
optionValue: function(opt) {
|
3697
|
-
// extend element because hasAttribute may not be native
|
3698
4176
|
return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
|
3699
4177
|
}
|
3700
4178
|
};
|
3701
4179
|
|
3702
4180
|
/*--------------------------------------------------------------------------*/
|
3703
4181
|
|
4182
|
+
|
3704
4183
|
Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
|
3705
4184
|
initialize: function($super, element, frequency, callback) {
|
3706
4185
|
$super(callback, frequency);
|
@@ -3782,354 +4261,441 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
|
|
3782
4261
|
return Form.serialize(this.element);
|
3783
4262
|
}
|
3784
4263
|
});
|
3785
|
-
|
3786
|
-
|
3787
|
-
|
3788
|
-
|
3789
|
-
|
3790
|
-
|
3791
|
-
|
3792
|
-
|
3793
|
-
|
3794
|
-
|
3795
|
-
|
3796
|
-
|
3797
|
-
|
3798
|
-
|
3799
|
-
|
3800
|
-
|
3801
|
-
|
3802
|
-
|
3803
|
-
|
3804
|
-
|
3805
|
-
relatedTarget: function(event) {
|
3806
|
-
var element;
|
3807
|
-
switch(event.type) {
|
3808
|
-
case 'mouseover': element = event.fromElement; break;
|
3809
|
-
case 'mouseout': element = event.toElement; break;
|
3810
|
-
default: return null;
|
3811
|
-
}
|
3812
|
-
return Element.extend(element);
|
3813
|
-
}
|
3814
|
-
});
|
4264
|
+
(function() {
|
4265
|
+
|
4266
|
+
var Event = {
|
4267
|
+
KEY_BACKSPACE: 8,
|
4268
|
+
KEY_TAB: 9,
|
4269
|
+
KEY_RETURN: 13,
|
4270
|
+
KEY_ESC: 27,
|
4271
|
+
KEY_LEFT: 37,
|
4272
|
+
KEY_UP: 38,
|
4273
|
+
KEY_RIGHT: 39,
|
4274
|
+
KEY_DOWN: 40,
|
4275
|
+
KEY_DELETE: 46,
|
4276
|
+
KEY_HOME: 36,
|
4277
|
+
KEY_END: 35,
|
4278
|
+
KEY_PAGEUP: 33,
|
4279
|
+
KEY_PAGEDOWN: 34,
|
4280
|
+
KEY_INSERT: 45,
|
4281
|
+
|
4282
|
+
cache: {}
|
4283
|
+
};
|
3815
4284
|
|
3816
|
-
|
3817
|
-
var
|
4285
|
+
var docEl = document.documentElement;
|
4286
|
+
var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
|
4287
|
+
&& 'onmouseleave' in docEl;
|
3818
4288
|
|
4289
|
+
var _isButton;
|
3819
4290
|
if (Prototype.Browser.IE) {
|
3820
4291
|
var buttonMap = { 0: 1, 1: 4, 2: 2 };
|
3821
|
-
|
3822
|
-
return event.button
|
4292
|
+
_isButton = function(event, code) {
|
4293
|
+
return event.button === buttonMap[code];
|
3823
4294
|
};
|
3824
|
-
|
3825
4295
|
} else if (Prototype.Browser.WebKit) {
|
3826
|
-
|
4296
|
+
_isButton = function(event, code) {
|
3827
4297
|
switch (code) {
|
3828
4298
|
case 0: return event.which == 1 && !event.metaKey;
|
3829
4299
|
case 1: return event.which == 1 && event.metaKey;
|
3830
4300
|
default: return false;
|
3831
4301
|
}
|
3832
4302
|
};
|
3833
|
-
|
3834
4303
|
} else {
|
3835
|
-
|
4304
|
+
_isButton = function(event, code) {
|
3836
4305
|
return event.which ? (event.which === code + 1) : (event.button === code);
|
3837
4306
|
};
|
3838
4307
|
}
|
3839
4308
|
|
3840
|
-
return
|
3841
|
-
isLeftClick: function(event) { return isButton(event, 0) },
|
3842
|
-
isMiddleClick: function(event) { return isButton(event, 1) },
|
3843
|
-
isRightClick: function(event) { return isButton(event, 2) },
|
3844
|
-
|
3845
|
-
element: function(event) {
|
3846
|
-
event = Event.extend(event);
|
3847
|
-
|
3848
|
-
var node = event.target,
|
3849
|
-
type = event.type,
|
3850
|
-
currentTarget = event.currentTarget;
|
3851
|
-
|
3852
|
-
if (currentTarget && currentTarget.tagName) {
|
3853
|
-
// Firefox screws up the "click" event when moving between radio buttons
|
3854
|
-
// via arrow keys. It also screws up the "load" and "error" events on images,
|
3855
|
-
// reporting the document as the target instead of the original image.
|
3856
|
-
if (type === 'load' || type === 'error' ||
|
3857
|
-
(type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
|
3858
|
-
&& currentTarget.type === 'radio'))
|
3859
|
-
node = currentTarget;
|
3860
|
-
}
|
3861
|
-
if (node.nodeType == Node.TEXT_NODE) node = node.parentNode;
|
3862
|
-
return Element.extend(node);
|
3863
|
-
},
|
4309
|
+
function isLeftClick(event) { return _isButton(event, 0) }
|
3864
4310
|
|
3865
|
-
|
3866
|
-
var element = Event.element(event);
|
3867
|
-
if (!expression) return element;
|
3868
|
-
var elements = [element].concat(element.ancestors());
|
3869
|
-
return Selector.findElement(elements, expression, 0);
|
3870
|
-
},
|
4311
|
+
function isMiddleClick(event) { return _isButton(event, 1) }
|
3871
4312
|
|
3872
|
-
|
3873
|
-
var docElement = document.documentElement,
|
3874
|
-
body = document.body || { scrollLeft: 0, scrollTop: 0 };
|
3875
|
-
return {
|
3876
|
-
x: event.pageX || (event.clientX +
|
3877
|
-
(docElement.scrollLeft || body.scrollLeft) -
|
3878
|
-
(docElement.clientLeft || 0)),
|
3879
|
-
y: event.pageY || (event.clientY +
|
3880
|
-
(docElement.scrollTop || body.scrollTop) -
|
3881
|
-
(docElement.clientTop || 0))
|
3882
|
-
};
|
3883
|
-
},
|
4313
|
+
function isRightClick(event) { return _isButton(event, 2) }
|
3884
4314
|
|
3885
|
-
|
3886
|
-
|
4315
|
+
function element(event) {
|
4316
|
+
event = Event.extend(event);
|
3887
4317
|
|
3888
|
-
|
3889
|
-
|
3890
|
-
|
3891
|
-
|
3892
|
-
|
4318
|
+
var node = event.target, type = event.type,
|
4319
|
+
currentTarget = event.currentTarget;
|
4320
|
+
|
4321
|
+
if (currentTarget && currentTarget.tagName) {
|
4322
|
+
if (type === 'load' || type === 'error' ||
|
4323
|
+
(type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
|
4324
|
+
&& currentTarget.type === 'radio'))
|
4325
|
+
node = currentTarget;
|
3893
4326
|
}
|
4327
|
+
|
4328
|
+
if (node.nodeType == Node.TEXT_NODE)
|
4329
|
+
node = node.parentNode;
|
4330
|
+
|
4331
|
+
return Element.extend(node);
|
4332
|
+
}
|
4333
|
+
|
4334
|
+
function findElement(event, expression) {
|
4335
|
+
var element = Event.element(event);
|
4336
|
+
if (!expression) return element;
|
4337
|
+
var elements = [element].concat(element.ancestors());
|
4338
|
+
return Selector.findElement(elements, expression, 0);
|
4339
|
+
}
|
4340
|
+
|
4341
|
+
function pointer(event) {
|
4342
|
+
return { x: pointerX(event), y: pointerY(event) };
|
4343
|
+
}
|
4344
|
+
|
4345
|
+
function pointerX(event) {
|
4346
|
+
var docElement = document.documentElement,
|
4347
|
+
body = document.body || { scrollLeft: 0 };
|
4348
|
+
|
4349
|
+
return event.pageX || (event.clientX +
|
4350
|
+
(docElement.scrollLeft || body.scrollLeft) -
|
4351
|
+
(docElement.clientLeft || 0));
|
4352
|
+
}
|
4353
|
+
|
4354
|
+
function pointerY(event) {
|
4355
|
+
var docElement = document.documentElement,
|
4356
|
+
body = document.body || { scrollTop: 0 };
|
4357
|
+
|
4358
|
+
return event.pageY || (event.clientY +
|
4359
|
+
(docElement.scrollTop || body.scrollTop) -
|
4360
|
+
(docElement.clientTop || 0));
|
4361
|
+
}
|
4362
|
+
|
4363
|
+
|
4364
|
+
function stop(event) {
|
4365
|
+
Event.extend(event);
|
4366
|
+
event.preventDefault();
|
4367
|
+
event.stopPropagation();
|
4368
|
+
|
4369
|
+
event.stopped = true;
|
4370
|
+
}
|
4371
|
+
|
4372
|
+
Event.Methods = {
|
4373
|
+
isLeftClick: isLeftClick,
|
4374
|
+
isMiddleClick: isMiddleClick,
|
4375
|
+
isRightClick: isRightClick,
|
4376
|
+
|
4377
|
+
element: element,
|
4378
|
+
findElement: findElement,
|
4379
|
+
|
4380
|
+
pointer: pointer,
|
4381
|
+
pointerX: pointerX,
|
4382
|
+
pointerY: pointerY,
|
4383
|
+
|
4384
|
+
stop: stop
|
3894
4385
|
};
|
3895
|
-
})();
|
3896
4386
|
|
3897
|
-
|
4387
|
+
|
3898
4388
|
var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
|
3899
4389
|
m[name] = Event.Methods[name].methodize();
|
3900
4390
|
return m;
|
3901
4391
|
});
|
3902
4392
|
|
3903
4393
|
if (Prototype.Browser.IE) {
|
4394
|
+
function _relatedTarget(event) {
|
4395
|
+
var element;
|
4396
|
+
switch (event.type) {
|
4397
|
+
case 'mouseover': element = event.fromElement; break;
|
4398
|
+
case 'mouseout': element = event.toElement; break;
|
4399
|
+
default: return null;
|
4400
|
+
}
|
4401
|
+
return Element.extend(element);
|
4402
|
+
}
|
4403
|
+
|
3904
4404
|
Object.extend(methods, {
|
3905
4405
|
stopPropagation: function() { this.cancelBubble = true },
|
3906
4406
|
preventDefault: function() { this.returnValue = false },
|
3907
|
-
inspect: function() { return
|
4407
|
+
inspect: function() { return '[object Event]' }
|
3908
4408
|
});
|
3909
4409
|
|
3910
|
-
|
4410
|
+
Event.extend = function(event, element) {
|
3911
4411
|
if (!event) return false;
|
3912
4412
|
if (event._extendedByPrototype) return event;
|
3913
4413
|
|
3914
4414
|
event._extendedByPrototype = Prototype.emptyFunction;
|
3915
4415
|
var pointer = Event.pointer(event);
|
4416
|
+
|
3916
4417
|
Object.extend(event, {
|
3917
|
-
target: event.srcElement,
|
3918
|
-
relatedTarget:
|
4418
|
+
target: event.srcElement || element,
|
4419
|
+
relatedTarget: _relatedTarget(event),
|
3919
4420
|
pageX: pointer.x,
|
3920
4421
|
pageY: pointer.y
|
3921
4422
|
});
|
4423
|
+
|
3922
4424
|
return Object.extend(event, methods);
|
3923
4425
|
};
|
3924
|
-
|
3925
4426
|
} else {
|
3926
|
-
Event.prototype = Event.prototype || document.createEvent(
|
4427
|
+
Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
|
3927
4428
|
Object.extend(Event.prototype, methods);
|
3928
|
-
|
4429
|
+
Event.extend = Prototype.K;
|
3929
4430
|
}
|
3930
|
-
})();
|
3931
|
-
|
3932
|
-
Object.extend(Event, (function() {
|
3933
|
-
var cache = Event.cache;
|
3934
4431
|
|
3935
|
-
function
|
3936
|
-
|
3937
|
-
arguments.callee.id = arguments.callee.id || 1;
|
3938
|
-
return element._prototypeEventID = [++arguments.callee.id];
|
3939
|
-
}
|
4432
|
+
function _createResponder(element, eventName, handler) {
|
4433
|
+
var registry = Element.retrieve(element, 'prototype_event_registry');
|
3940
4434
|
|
3941
|
-
|
3942
|
-
|
3943
|
-
|
3944
|
-
|
4435
|
+
if (Object.isUndefined(registry)) {
|
4436
|
+
CACHE.push(element);
|
4437
|
+
registry = Element.retrieve(element, 'prototype_event_registry', $H());
|
4438
|
+
}
|
3945
4439
|
|
3946
|
-
|
3947
|
-
|
3948
|
-
|
4440
|
+
var respondersForEvent = registry.get(eventName);
|
4441
|
+
if (Object.isUndefined(respondersForEvent)) {
|
4442
|
+
respondersForEvent = [];
|
4443
|
+
registry.set(eventName, respondersForEvent);
|
4444
|
+
}
|
3949
4445
|
|
3950
|
-
|
3951
|
-
var c = getCacheForID(id);
|
3952
|
-
return c[eventName] = c[eventName] || [];
|
3953
|
-
}
|
4446
|
+
if (respondersForEvent.pluck('handler').include(handler)) return false;
|
3954
4447
|
|
3955
|
-
|
3956
|
-
|
3957
|
-
|
3958
|
-
|
4448
|
+
var responder;
|
4449
|
+
if (eventName.include(":")) {
|
4450
|
+
responder = function(event) {
|
4451
|
+
if (Object.isUndefined(event.eventName))
|
4452
|
+
return false;
|
3959
4453
|
|
3960
|
-
|
3961
|
-
if (!Event || !Event.extend ||
|
3962
|
-
(event.eventName && event.eventName != eventName))
|
4454
|
+
if (event.eventName !== eventName)
|
3963
4455
|
return false;
|
3964
4456
|
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
4457
|
+
Event.extend(event, element);
|
4458
|
+
handler.call(element, event);
|
4459
|
+
};
|
4460
|
+
} else {
|
4461
|
+
if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED &&
|
4462
|
+
(eventName === "mouseenter" || eventName === "mouseleave")) {
|
4463
|
+
if (eventName === "mouseenter" || eventName === "mouseleave") {
|
4464
|
+
responder = function(event) {
|
4465
|
+
Event.extend(event, element);
|
4466
|
+
|
4467
|
+
var parent = event.relatedTarget;
|
4468
|
+
while (parent && parent !== element) {
|
4469
|
+
try { parent = parent.parentNode; }
|
4470
|
+
catch(e) { parent = element; }
|
4471
|
+
}
|
3968
4472
|
|
3969
|
-
|
3970
|
-
c.push(wrapper);
|
3971
|
-
return wrapper;
|
3972
|
-
}
|
4473
|
+
if (parent === element) return;
|
3973
4474
|
|
3974
|
-
|
3975
|
-
|
3976
|
-
|
3977
|
-
|
4475
|
+
handler.call(element, event);
|
4476
|
+
};
|
4477
|
+
}
|
4478
|
+
} else {
|
4479
|
+
responder = function(event) {
|
4480
|
+
Event.extend(event, element);
|
4481
|
+
handler.call(element, event);
|
4482
|
+
};
|
4483
|
+
}
|
4484
|
+
}
|
3978
4485
|
|
3979
|
-
|
3980
|
-
|
3981
|
-
|
3982
|
-
c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
|
4486
|
+
responder.handler = handler;
|
4487
|
+
respondersForEvent.push(responder);
|
4488
|
+
return responder;
|
3983
4489
|
}
|
3984
4490
|
|
3985
|
-
function
|
3986
|
-
for (var
|
3987
|
-
|
3988
|
-
|
4491
|
+
function _destroyCache() {
|
4492
|
+
for (var i = 0, length = CACHE.length; i < length; i++) {
|
4493
|
+
Event.stopObserving(CACHE[i]);
|
4494
|
+
CACHE[i] = null;
|
4495
|
+
}
|
3989
4496
|
}
|
3990
4497
|
|
4498
|
+
var CACHE = [];
|
3991
4499
|
|
3992
|
-
|
3993
|
-
|
3994
|
-
if (window.attachEvent) {
|
3995
|
-
window.attachEvent("onunload", destroyCache);
|
3996
|
-
}
|
4500
|
+
if (Prototype.Browser.IE)
|
4501
|
+
window.attachEvent('onunload', _destroyCache);
|
3997
4502
|
|
3998
|
-
|
3999
|
-
// use its bfcache. Safari <= 3.1 has an issue with restoring the "document"
|
4000
|
-
// object when page is returned to via the back button using its bfcache.
|
4001
|
-
if (Prototype.Browser.WebKit) {
|
4503
|
+
if (Prototype.Browser.WebKit)
|
4002
4504
|
window.addEventListener('unload', Prototype.emptyFunction, false);
|
4505
|
+
|
4506
|
+
|
4507
|
+
var _getDOMEventName = Prototype.K;
|
4508
|
+
|
4509
|
+
if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) {
|
4510
|
+
_getDOMEventName = function(eventName) {
|
4511
|
+
var translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
|
4512
|
+
return eventName in translations ? translations[eventName] : eventName;
|
4513
|
+
};
|
4003
4514
|
}
|
4004
4515
|
|
4005
|
-
|
4006
|
-
|
4007
|
-
element = $(element);
|
4008
|
-
var name = getDOMEventName(eventName);
|
4516
|
+
function observe(element, eventName, handler) {
|
4517
|
+
element = $(element);
|
4009
4518
|
|
4010
|
-
|
4011
|
-
if (!wrapper) return element;
|
4519
|
+
var responder = _createResponder(element, eventName, handler);
|
4012
4520
|
|
4013
|
-
|
4014
|
-
|
4015
|
-
|
4016
|
-
|
4521
|
+
if (!responder) return element;
|
4522
|
+
|
4523
|
+
if (eventName.include(':')) {
|
4524
|
+
if (element.addEventListener)
|
4525
|
+
element.addEventListener("dataavailable", responder, false);
|
4526
|
+
else {
|
4527
|
+
element.attachEvent("ondataavailable", responder);
|
4528
|
+
element.attachEvent("onfilterchange", responder);
|
4017
4529
|
}
|
4530
|
+
} else {
|
4531
|
+
var actualEventName = _getDOMEventName(eventName);
|
4018
4532
|
|
4019
|
-
|
4020
|
-
|
4533
|
+
if (element.addEventListener)
|
4534
|
+
element.addEventListener(actualEventName, responder, false);
|
4535
|
+
else
|
4536
|
+
element.attachEvent("on" + actualEventName, responder);
|
4537
|
+
}
|
4021
4538
|
|
4022
|
-
|
4023
|
-
|
4024
|
-
var id = getEventID(element), name = getDOMEventName(eventName);
|
4539
|
+
return element;
|
4540
|
+
}
|
4025
4541
|
|
4026
|
-
|
4027
|
-
|
4028
|
-
element.stopObserving(eventName, wrapper.handler);
|
4029
|
-
});
|
4030
|
-
return element;
|
4542
|
+
function stopObserving(element, eventName, handler) {
|
4543
|
+
element = $(element);
|
4031
4544
|
|
4032
|
-
|
4033
|
-
Object.keys(getCacheForID(id)).each(function(eventName) {
|
4034
|
-
element.stopObserving(eventName);
|
4035
|
-
});
|
4036
|
-
return element;
|
4037
|
-
}
|
4545
|
+
var registry = Element.retrieve(element, 'prototype_event_registry');
|
4038
4546
|
|
4039
|
-
|
4040
|
-
if (!wrapper) return element;
|
4547
|
+
if (Object.isUndefined(registry)) return element;
|
4041
4548
|
|
4042
|
-
|
4043
|
-
|
4044
|
-
} else {
|
4045
|
-
element.detachEvent("on" + name, wrapper);
|
4046
|
-
}
|
4549
|
+
if (eventName && !handler) {
|
4550
|
+
var responders = registry.get(eventName);
|
4047
4551
|
|
4048
|
-
|
4552
|
+
if (Object.isUndefined(responders)) return element;
|
4049
4553
|
|
4554
|
+
responders.each( function(r) {
|
4555
|
+
Element.stopObserving(element, eventName, r.handler);
|
4556
|
+
});
|
4050
4557
|
return element;
|
4051
|
-
}
|
4558
|
+
} else if (!eventName) {
|
4559
|
+
registry.each( function(pair) {
|
4560
|
+
var eventName = pair.key, responders = pair.value;
|
4052
4561
|
|
4053
|
-
|
4054
|
-
|
4055
|
-
|
4056
|
-
|
4562
|
+
responders.each( function(r) {
|
4563
|
+
Element.stopObserving(element, eventName, r.handler);
|
4564
|
+
});
|
4565
|
+
});
|
4566
|
+
return element;
|
4567
|
+
}
|
4057
4568
|
|
4058
|
-
|
4059
|
-
if (document.createEvent) {
|
4060
|
-
event = document.createEvent("HTMLEvents");
|
4061
|
-
event.initEvent("dataavailable", true, true);
|
4062
|
-
} else {
|
4063
|
-
event = document.createEventObject();
|
4064
|
-
event.eventType = "ondataavailable";
|
4065
|
-
}
|
4569
|
+
var responders = registry.get(eventName);
|
4066
4570
|
|
4067
|
-
|
4068
|
-
event.memo = memo || { };
|
4571
|
+
if (!responders) return;
|
4069
4572
|
|
4070
|
-
|
4071
|
-
|
4072
|
-
|
4073
|
-
|
4573
|
+
var responder = responders.find( function(r) { return r.handler === handler; });
|
4574
|
+
if (!responder) return element;
|
4575
|
+
|
4576
|
+
var actualEventName = _getDOMEventName(eventName);
|
4577
|
+
|
4578
|
+
if (eventName.include(':')) {
|
4579
|
+
if (element.removeEventListener)
|
4580
|
+
element.removeEventListener("dataavailable", responder, false);
|
4581
|
+
else {
|
4582
|
+
element.detachEvent("ondataavailable", responder);
|
4583
|
+
element.detachEvent("onfilterchange", responder);
|
4074
4584
|
}
|
4585
|
+
} else {
|
4586
|
+
if (element.removeEventListener)
|
4587
|
+
element.removeEventListener(actualEventName, responder, false);
|
4588
|
+
else
|
4589
|
+
element.detachEvent('on' + actualEventName, responder);
|
4590
|
+
}
|
4591
|
+
|
4592
|
+
registry.set(eventName, responders.without(responder));
|
4593
|
+
|
4594
|
+
return element;
|
4595
|
+
}
|
4596
|
+
|
4597
|
+
function fire(element, eventName, memo, bubble) {
|
4598
|
+
element = $(element);
|
4075
4599
|
|
4076
|
-
|
4600
|
+
if (Object.isUndefined(bubble))
|
4601
|
+
bubble = true;
|
4602
|
+
|
4603
|
+
if (element == document && document.createEvent && !element.dispatchEvent)
|
4604
|
+
element = document.documentElement;
|
4605
|
+
|
4606
|
+
var event;
|
4607
|
+
if (document.createEvent) {
|
4608
|
+
event = document.createEvent('HTMLEvents');
|
4609
|
+
event.initEvent('dataavailable', true, true);
|
4610
|
+
} else {
|
4611
|
+
event = document.createEventObject();
|
4612
|
+
event.eventType = bubble ? 'ondataavailable' : 'onfilterchange';
|
4077
4613
|
}
|
4078
|
-
};
|
4079
|
-
})());
|
4080
4614
|
|
4081
|
-
|
4615
|
+
event.eventName = eventName;
|
4616
|
+
event.memo = memo || { };
|
4082
4617
|
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
4086
|
-
|
4087
|
-
});
|
4618
|
+
if (document.createEvent)
|
4619
|
+
element.dispatchEvent(event);
|
4620
|
+
else
|
4621
|
+
element.fireEvent(event.eventType, event);
|
4088
4622
|
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4094
|
-
|
4623
|
+
return Event.extend(event);
|
4624
|
+
}
|
4625
|
+
|
4626
|
+
|
4627
|
+
Object.extend(Event, Event.Methods);
|
4628
|
+
|
4629
|
+
Object.extend(Event, {
|
4630
|
+
fire: fire,
|
4631
|
+
observe: observe,
|
4632
|
+
stopObserving: stopObserving
|
4633
|
+
});
|
4634
|
+
|
4635
|
+
Element.addMethods({
|
4636
|
+
fire: fire,
|
4637
|
+
|
4638
|
+
observe: observe,
|
4639
|
+
|
4640
|
+
stopObserving: stopObserving
|
4641
|
+
});
|
4642
|
+
|
4643
|
+
Object.extend(document, {
|
4644
|
+
fire: fire.methodize(),
|
4645
|
+
|
4646
|
+
observe: observe.methodize(),
|
4647
|
+
|
4648
|
+
stopObserving: stopObserving.methodize(),
|
4649
|
+
|
4650
|
+
loaded: false
|
4651
|
+
});
|
4652
|
+
|
4653
|
+
if (window.Event) Object.extend(window.Event, Event);
|
4654
|
+
else window.Event = Event;
|
4655
|
+
})();
|
4095
4656
|
|
4096
4657
|
(function() {
|
4097
4658
|
/* Support for the DOMContentLoaded event is based on work by Dan Webb,
|
4098
|
-
Matthias Miller, Dean Edwards and
|
4659
|
+
Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
|
4099
4660
|
|
4100
4661
|
var timer;
|
4101
4662
|
|
4102
4663
|
function fireContentLoadedEvent() {
|
4103
4664
|
if (document.loaded) return;
|
4104
|
-
if (timer) window.
|
4105
|
-
document.fire("dom:loaded");
|
4665
|
+
if (timer) window.clearTimeout(timer);
|
4106
4666
|
document.loaded = true;
|
4667
|
+
document.fire('dom:loaded');
|
4107
4668
|
}
|
4108
4669
|
|
4109
|
-
|
4110
|
-
if (
|
4111
|
-
|
4112
|
-
|
4113
|
-
|
4114
|
-
|
4115
|
-
|
4116
|
-
Event.observe(window, "load", fireContentLoadedEvent);
|
4670
|
+
function checkReadyState() {
|
4671
|
+
if (document.readyState === 'complete') {
|
4672
|
+
document.stopObserving('readystatechange', checkReadyState);
|
4673
|
+
fireContentLoadedEvent();
|
4674
|
+
}
|
4675
|
+
}
|
4117
4676
|
|
4118
|
-
|
4119
|
-
|
4120
|
-
|
4677
|
+
function pollDoScroll() {
|
4678
|
+
try { document.documentElement.doScroll('left'); }
|
4679
|
+
catch(e) {
|
4680
|
+
timer = pollDoScroll.defer();
|
4681
|
+
return;
|
4121
4682
|
}
|
4683
|
+
fireContentLoadedEvent();
|
4684
|
+
}
|
4122
4685
|
|
4686
|
+
if (document.addEventListener) {
|
4687
|
+
document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
|
4123
4688
|
} else {
|
4124
|
-
document.
|
4125
|
-
|
4126
|
-
|
4127
|
-
this.onreadystatechange = null;
|
4128
|
-
fireContentLoadedEvent();
|
4129
|
-
}
|
4130
|
-
};
|
4689
|
+
document.observe('readystatechange', checkReadyState);
|
4690
|
+
if (window == top)
|
4691
|
+
timer = pollDoScroll.defer();
|
4131
4692
|
}
|
4693
|
+
|
4694
|
+
Event.observe(window, 'load', fireContentLoadedEvent);
|
4132
4695
|
})();
|
4696
|
+
|
4697
|
+
Element.addMethods();
|
4698
|
+
|
4133
4699
|
/*------------------------------- DEPRECATED -------------------------------*/
|
4134
4700
|
|
4135
4701
|
Hash.toQueryString = Object.toQueryString;
|
@@ -4158,16 +4724,9 @@ var Insertion = {
|
|
4158
4724
|
|
4159
4725
|
var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
|
4160
4726
|
|
4161
|
-
// This should be moved to script.aculo.us; notice the deprecated methods
|
4162
|
-
// further below, that map to the newer Element methods.
|
4163
4727
|
var Position = {
|
4164
|
-
// set to true if needed, warning: firefox performance problems
|
4165
|
-
// NOT neeeded for page scrolling, only if draggable contained in
|
4166
|
-
// scrollable elements
|
4167
4728
|
includeScrollOffsets: false,
|
4168
4729
|
|
4169
|
-
// must be called before calling withinIncludingScrolloffset, every time the
|
4170
|
-
// page is scrolled
|
4171
4730
|
prepare: function() {
|
4172
4731
|
this.deltaX = window.pageXOffset
|
4173
4732
|
|| document.documentElement.scrollLeft
|
@@ -4179,7 +4738,6 @@ var Position = {
|
|
4179
4738
|
|| 0;
|
4180
4739
|
},
|
4181
4740
|
|
4182
|
-
// caches x/y coordinate pair to use with overlap
|
4183
4741
|
within: function(element, x, y) {
|
4184
4742
|
if (this.includeScrollOffsets)
|
4185
4743
|
return this.withinIncludingScrolloffsets(element, x, y);
|
@@ -4206,7 +4764,6 @@ var Position = {
|
|
4206
4764
|
this.xcomp < this.offset[0] + element.offsetWidth);
|
4207
4765
|
},
|
4208
4766
|
|
4209
|
-
// within must be called directly before
|
4210
4767
|
overlap: function(mode, element) {
|
4211
4768
|
if (!mode) return 0;
|
4212
4769
|
if (mode == 'vertical')
|
@@ -4217,7 +4774,6 @@ var Position = {
|
|
4217
4774
|
element.offsetWidth;
|
4218
4775
|
},
|
4219
4776
|
|
4220
|
-
// Deprecation layer -- use newer Element methods now (1.5.2).
|
4221
4777
|
|
4222
4778
|
cumulativeOffset: Element.Methods.cumulativeOffset,
|
4223
4779
|
|
@@ -4315,6 +4871,4 @@ Element.ClassNames.prototype = {
|
|
4315
4871
|
|
4316
4872
|
Object.extend(Element.ClassNames.prototype, Enumerable);
|
4317
4873
|
|
4318
|
-
/*--------------------------------------------------------------------------*/
|
4319
|
-
|
4320
|
-
Element.addMethods();
|
4874
|
+
/*--------------------------------------------------------------------------*/
|