backlog 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/LICENSE_LOCALIZATION +20 -0
- data/Manifest.txt +216 -0
- data/README +180 -0
- data/README_LOCALIZATION +61 -0
- data/README_LOGIN_SUGAR +194 -0
- data/Rakefile +19 -0
- data/app/controllers/application.rb +142 -0
- data/app/controllers/backlogs_controller.rb +117 -0
- data/app/controllers/estimates_controller.rb +10 -0
- data/app/controllers/periods_controller.rb +227 -0
- data/app/controllers/tasks_controller.rb +229 -0
- data/app/controllers/user_controller.rb +183 -0
- data/app/controllers/works_controller.rb +117 -0
- data/app/helpers/application_helper.rb +26 -0
- data/app/helpers/backlogs_helper.rb +2 -0
- data/app/helpers/estimates_helper.rb +2 -0
- data/app/helpers/periods_helper.rb +2 -0
- data/app/helpers/tasks_helper.rb +17 -0
- data/app/helpers/user_helper.rb +53 -0
- data/app/helpers/works_helper.rb +2 -0
- data/app/models/backlog.rb +40 -0
- data/app/models/estimate.rb +10 -0
- data/app/models/period.rb +124 -0
- data/app/models/task.rb +280 -0
- data/app/models/user.rb +101 -0
- data/app/models/user_notify.rb +50 -0
- data/app/models/work.rb +94 -0
- data/app/views/backlogs/_form.rhtml +49 -0
- data/app/views/backlogs/edit.rhtml +10 -0
- data/app/views/backlogs/new.rhtml +11 -0
- data/app/views/backlogs/show.rhtml +90 -0
- data/app/views/layouts/_headers.rhtml +22 -0
- data/app/views/layouts/mwrt002.rhtml +83 -0
- data/app/views/layouts/wide.rhtml +22 -0
- data/app/views/periods/_burn_down_chart.rhtml +8 -0
- data/app/views/periods/_form.rhtml +56 -0
- data/app/views/periods/_show_active.rhtml +64 -0
- data/app/views/periods/_title.rhtml +10 -0
- data/app/views/periods/edit.rhtml +10 -0
- data/app/views/periods/new.rhtml +10 -0
- data/app/views/periods/show.rhtml +26 -0
- data/app/views/tasks/_form.rhtml +29 -0
- data/app/views/tasks/_task.rhtml +102 -0
- data/app/views/tasks/edit.rhtml +11 -0
- data/app/views/tasks/list.rhtml +77 -0
- data/app/views/tasks/list_started.rhtml +64 -0
- data/app/views/tasks/new.rhtml +10 -0
- data/app/views/user/_edit.rhtml +30 -0
- data/app/views/user/_password.rhtml +21 -0
- data/app/views/user/change_password.rhtml +15 -0
- data/app/views/user/edit.rhtml +19 -0
- data/app/views/user/forgot_password.rhtml +19 -0
- data/app/views/user/login.rhtml +30 -0
- data/app/views/user/logout.rhtml +8 -0
- data/app/views/user/signup.rhtml +14 -0
- data/app/views/user/welcome.rhtml +10 -0
- data/app/views/user_notify/change_password.rhtml +10 -0
- data/app/views/user_notify/change_password_no.rhtml +10 -0
- data/app/views/user_notify/forgot_password.rhtml +11 -0
- data/app/views/user_notify/forgot_password_no.rhtml +11 -0
- data/app/views/user_notify/signup.rhtml +12 -0
- data/app/views/user_notify/signup_no.rhtml +12 -0
- data/app/views/works/_form.rhtml +85 -0
- data/app/views/works/daily_work_sheet.rhtml +99 -0
- data/app/views/works/edit.rhtml +11 -0
- data/app/views/works/list.rhtml +47 -0
- data/app/views/works/new.rhtml +11 -0
- data/app/views/works/show.rhtml +10 -0
- data/app/views/works/timeliste.rhtml +883 -0
- data/app/views/works/weekly_work_sheet.rhtml +84 -0
- data/backlog.gemspec +21 -0
- data/bin/backlog +44 -0
- data/bin/backlog_init.d +27 -0
- data/config/boot.rb +45 -0
- data/config/database.yml +38 -0
- data/config/deploy.rb +20 -0
- data/config/deploy_datek.rb +21 -0
- data/config/deploy_kubosch.rb +19 -0
- data/config/environment.rb +63 -0
- data/config/environments/datek_production.rb +26 -0
- data/config/environments/development.rb +27 -0
- data/config/environments/kubosch_production.rb +21 -0
- data/config/environments/localization_environment.rb +12 -0
- data/config/environments/production.rb +20 -0
- data/config/environments/test.rb +19 -0
- data/config/environments/user_environment.rb +21 -0
- data/config/mime_types.yaml +1 -0
- data/config/routes.rb +5 -0
- data/db/migrate/001_tasks.rb +15 -0
- data/db/migrate/002_backlogs.rb +14 -0
- data/db/migrate/003_add_estimation_points.rb +16 -0
- data/db/migrate/004_add_period.rb +63 -0
- data/db/migrate/005_add_field_work_started_at.rb +9 -0
- data/db/migrate/006_works_data_fix.rb +13 -0
- data/db/migrate/007_add_task_created_at.rb +23 -0
- data/db/migrate/008_add_backlog_options.rb +13 -0
- data/db/migrate/009_add_subtasks.rb +28 -0
- data/db/migrate/010_add_work_start.rb +9 -0
- data/db/migrate/011_login_sugar.rb +21 -0
- data/db/migrate/012_add_resolution.rb +12 -0
- data/db/migrate/013_create_estimates.rb +20 -0
- data/db/migrate/014_add_customer_option.rb +11 -0
- data/db/migrate/015_add_user_option.rb +43 -0
- data/db/migrate/016_add_invoicable_flag.rb +11 -0
- data/db/migrate/017_insert_datek_projects.rb +95 -0
- data/db/schema.rb +92 -0
- data/lang/en.yaml +75 -0
- data/lang/localizations.yaml +2 -0
- data/lang/no.yaml +74 -0
- data/lib/array_helper.rb +10 -0
- data/lib/clock.rb +14 -0
- data/lib/localization.rb +88 -0
- data/lib/tasks/capistrano.rake +90 -0
- data/lib/user_system.rb +70 -0
- data/public/404.html +8 -0
- data/public/500.html +8 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/favicon.ico +0 -0
- data/public/images/add.png +0 -0
- data/public/images/add.svg +70 -0
- data/public/images/appunti_architetto_franc_01.svg +92 -0
- data/public/images/arrow07_2.png +0 -0
- data/public/images/arrow07_4.png +0 -0
- data/public/images/arrow_down.png +0 -0
- data/public/images/arrow_down.svg +59 -0
- data/public/images/arrow_left.png +0 -0
- data/public/images/arrow_left.svg +59 -0
- data/public/images/arrow_right.png +0 -0
- data/public/images/arrow_right.svg +59 -0
- data/public/images/arrow_up.png +0 -0
- data/public/images/arrow_up.svg +59 -0
- data/public/images/blank.jpg +0 -0
- data/public/images/cestino_pieno_architetto_01.svg +470 -0
- data/public/images/checkmark.png +0 -0
- data/public/images/checkmark_org.png +0 -0
- data/public/images/clipboard.png +0 -0
- data/public/images/clipboard.svg +62 -0
- data/public/images/construction_hammer_jon__01.svg +116 -0
- data/public/images/eraser.png +0 -0
- data/public/images/eraser_org.png +0 -0
- data/public/images/ernes_stop.png +0 -0
- data/public/images/ernes_stop_org.png +0 -0
- data/public/images/hammer.png +0 -0
- data/public/images/header.jpg +0 -0
- data/public/images/pagebak.jpg +0 -0
- data/public/images/paper3.svg +54 -0
- data/public/images/period.png +0 -0
- data/public/images/period_org.png +0 -0
- data/public/images/question.svg +56 -0
- data/public/images/rails.png +0 -0
- data/public/images/tabella_architetto_franc_01.svg +105 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +833 -0
- data/public/javascripts/dragdrop.js +944 -0
- data/public/javascripts/effects.js +1088 -0
- data/public/javascripts/prototype.js +2515 -0
- data/public/javascripts/zapatec/utils/transport.js +2217 -0
- data/public/javascripts/zapatec/utils/utils.js +1799 -0
- data/public/javascripts/zapatec/utils/zapatec.js +90 -0
- data/public/javascripts/zapatec/utils/zpeventdriven.js +212 -0
- data/public/javascripts/zapatec/utils/zpwidget.js +729 -0
- data/public/javascripts/zapatec/zpcal/lang/calendar-no.js +124 -0
- data/public/javascripts/zapatec/zpcal/src/calendar-core.js +2878 -0
- data/public/javascripts/zapatec/zpcal/src/calendar-date-core.js +348 -0
- data/public/javascripts/zapatec/zpcal/src/calendar-setup.js +360 -0
- data/public/javascripts/zapatec/zpcal/src/calendar.js +35 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/backlog.css +65 -0
- data/public/stylesheets/mwrt002.css +54 -0
- data/public/stylesheets/mwrt002MAC.css +3 -0
- data/public/stylesheets/mwrt002NN.css +3 -0
- data/public/stylesheets/scaffold.css +74 -0
- data/public/stylesheets/user.css +74 -0
- data/public/stylesheets/zpcal/themes/green.css +153 -0
- data/public/stylesheets/zpcal/themes/layouts/layout-2d.css +134 -0
- data/public/stylesheets/zpcal/themes/layouts/layout-common.css +74 -0
- data/public/stylesheets/zpcal/themes/menuarrow.gif +0 -0
- data/public/stylesheets/zpcal/themes/scroller-down.gif +0 -0
- data/public/stylesheets/zpcal/themes/scroller-up.gif +0 -0
- data/script/about +3 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/process/inspector +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/backlogs.yml +7 -0
- data/test/fixtures/estimates.yml +9 -0
- data/test/fixtures/periods.yml +14 -0
- data/test/fixtures/tasks.yml +12 -0
- data/test/fixtures/users.yml +59 -0
- data/test/fixtures/works.yml +10 -0
- data/test/functional/backlogs_controller_test.rb +78 -0
- data/test/functional/estimates_controller_test.rb +18 -0
- data/test/functional/periods_controller_test.rb +80 -0
- data/test/functional/tasks_controller_test.rb +94 -0
- data/test/functional/user_controller_test.rb +267 -0
- data/test/functional/works_controller_test.rb +89 -0
- data/test/integration/user_system_test.rb +95 -0
- data/test/mocks/test/clock.rb +14 -0
- data/test/mocks/test/user_notify.rb +16 -0
- data/test/test_helper.rb +1 -2
- data/test/unit/estimate_test.rb +10 -0
- data/test/unit/localization_test.rb +47 -0
- data/test/unit/period_test.rb +10 -0
- data/test/unit/task_test.rb +10 -0
- data/test/unit/user_test.rb +133 -0
- data/test/unit/work_test.rb +10 -0
- data/vendor/plugins/activerecord_foreign_key_extensions/init.rb +2 -0
- data/vendor/plugins/activerecord_foreign_key_extensions/lib/active_record_extensions.rb +180 -0
- data/vendor/plugins/assert_cookie/MIT-LICENSE +7 -0
- data/vendor/plugins/assert_cookie/README +6 -0
- data/vendor/plugins/assert_cookie/Rakefile +21 -0
- data/vendor/plugins/assert_cookie/init.rb +1 -0
- data/vendor/plugins/assert_cookie/lib/assert_cookie.rb +75 -0
- data/vendor/plugins/assert_cookie/meta.yml +7 -0
- data/vendor/plugins/assert_cookie/test/test_assert_cookie.rb +124 -0
- data/vendor/plugins/assert_cookie/test/test_helper.rb +31 -0
- data/vendor/plugins/foreign_key_migrations/CHANGELOG +67 -0
- data/vendor/plugins/foreign_key_migrations/MIT-LICENSE +20 -0
- data/vendor/plugins/foreign_key_migrations/README +60 -0
- data/vendor/plugins/foreign_key_migrations/init.rb +2 -0
- data/vendor/plugins/foreign_key_migrations/install.rb +1 -0
- data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations.rb +57 -0
- data/vendor/plugins/redhillonrails_core/CHANGELOG +85 -0
- data/vendor/plugins/redhillonrails_core/MIT-LICENSE +20 -0
- data/vendor/plugins/redhillonrails_core/README +97 -0
- data/vendor/plugins/redhillonrails_core/init.rb +9 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core.rb +290 -0
- data/vendor/rails/REVISION_6747 +0 -0
- data/vendor/rails/actionmailer/CHANGELOG +281 -0
- data/vendor/rails/actionmailer/MIT-LICENSE +21 -0
- data/vendor/rails/actionmailer/README +145 -0
- data/vendor/rails/actionmailer/Rakefile +95 -0
- data/vendor/rails/actionmailer/install.rb +30 -0
- data/vendor/rails/actionmailer/lib/action_mailer.rb +51 -0
- data/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +30 -0
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +570 -0
- data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +111 -0
- data/vendor/rails/actionmailer/lib/action_mailer/mail_helper.rb +19 -0
- data/vendor/rails/actionmailer/lib/action_mailer/part.rb +113 -0
- data/vendor/rails/actionmailer/lib/action_mailer/part_container.rb +51 -0
- data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +59 -0
- data/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb +67 -0
- data/vendor/rails/actionmailer/lib/action_mailer/utils.rb +8 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/text/format.rb +1466 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +3 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/address.rb +242 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb +41 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/base64.rb +71 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/config.rb +69 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/encode.rb +467 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/facade.rb +552 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb +914 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/info.rb +35 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/loader.rb +1 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mail.rb +447 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb +433 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mbox.rb +1 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/net.rb +280 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/obsolete.rb +135 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/parser.rb +1522 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/port.rb +377 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb +131 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner.rb +41 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner_r.rb +263 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/stringio.rb +277 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/tmail.rb +1 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/utils.rb +238 -0
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +9 -0
- data/vendor/rails/actionmailer/test/abstract_unit.rb +39 -0
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb +5 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +5 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email +14 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email10 +20 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email11 +34 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email12 +32 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email13 +29 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email2 +114 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email3 +70 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email4 +59 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email5 +19 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email6 +20 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email7 +66 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email8 +47 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email9 +28 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_quoted_with_0d0a +14 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment +100 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject +14 -0
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb +3 -0
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb +10 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb +2 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb +3 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +3 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -0
- data/vendor/rails/actionmailer/test/mail_helper_test.rb +91 -0
- data/vendor/rails/actionmailer/test/mail_render_test.rb +79 -0
- data/vendor/rails/actionmailer/test/mail_service_test.rb +850 -0
- data/vendor/rails/actionmailer/test/quoting_test.rb +57 -0
- data/vendor/rails/actionmailer/test/test_helper_test.rb +79 -0
- data/vendor/rails/actionmailer/test/tmail_test.rb +21 -0
- data/vendor/rails/actionmailer/test/url_test.rb +68 -0
- data/vendor/rails/actionpack/CHANGELOG +3560 -0
- data/vendor/rails/actionpack/MIT-LICENSE +21 -0
- data/vendor/rails/actionpack/README +469 -0
- data/vendor/rails/actionpack/RUNNING_UNIT_TESTS +25 -0
- data/vendor/rails/actionpack/Rakefile +154 -0
- data/vendor/rails/actionpack/examples/address_book/index.erb +33 -0
- data/vendor/rails/actionpack/examples/address_book/index.rhtml +0 -0
- data/vendor/rails/actionpack/examples/address_book/layout.erb +8 -0
- data/vendor/rails/actionpack/examples/address_book/layout.rhtml +0 -0
- data/vendor/rails/actionpack/examples/address_book_controller.cgi +9 -0
- data/vendor/rails/actionpack/examples/address_book_controller.fcgi +6 -0
- data/vendor/rails/actionpack/examples/address_book_controller.rb +52 -0
- data/vendor/rails/actionpack/examples/address_book_controller.rbx +4 -0
- data/vendor/rails/actionpack/examples/benchmark.rb +52 -0
- data/vendor/rails/actionpack/examples/benchmark_with_ar.fcgi +89 -0
- data/vendor/rails/actionpack/examples/blog_controller.cgi +53 -0
- data/vendor/rails/actionpack/examples/debate/index.erb +14 -0
- data/vendor/rails/actionpack/examples/debate/index.rhtml +0 -0
- data/vendor/rails/actionpack/examples/debate/new_topic.erb +22 -0
- data/vendor/rails/actionpack/examples/debate/new_topic.rhtml +0 -0
- data/vendor/rails/actionpack/examples/debate/topic.erb +32 -0
- data/vendor/rails/actionpack/examples/debate/topic.rhtml +0 -0
- data/vendor/rails/actionpack/examples/debate_controller.cgi +57 -0
- data/vendor/rails/actionpack/install.rb +30 -0
- data/vendor/rails/actionpack/lib/action_controller.rb +85 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions.rb +70 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +25 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +12 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +141 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +99 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +585 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +117 -0
- data/vendor/rails/actionpack/lib/action_controller/base.rb +1251 -0
- data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +93 -0
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +656 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext.rb +18 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +123 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/parameters.rb +208 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb +96 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb +63 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +23 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +217 -0
- data/vendor/rails/actionpack/lib/action_controller/components.rb +165 -0
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +78 -0
- data/vendor/rails/actionpack/lib/action_controller/filters.rb +752 -0
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +184 -0
- data/vendor/rails/actionpack/lib/action_controller/helpers.rb +153 -0
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +121 -0
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +552 -0
- data/vendor/rails/actionpack/lib/action_controller/layout.rb +318 -0
- data/vendor/rails/actionpack/lib/action_controller/macros/auto_complete.rb +53 -0
- data/vendor/rails/actionpack/lib/action_controller/macros/in_place_editing.rb +33 -0
- data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +191 -0
- data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +157 -0
- data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +20 -0
- data/vendor/rails/actionpack/lib/action_controller/pagination.rb +402 -0
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +56 -0
- data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +91 -0
- data/vendor/rails/actionpack/lib/action_controller/request.rb +316 -0
- data/vendor/rails/actionpack/lib/action_controller/rescue.rb +152 -0
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +485 -0
- data/vendor/rails/actionpack/lib/action_controller/response.rb +76 -0
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +1365 -0
- data/vendor/rails/actionpack/lib/action_controller/scaffolding.rb +191 -0
- data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +335 -0
- data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +143 -0
- data/vendor/rails/actionpack/lib/action_controller/session/drb_server.rb +32 -0
- data/vendor/rails/actionpack/lib/action_controller/session/drb_store.rb +35 -0
- data/vendor/rails/actionpack/lib/action_controller/session/mem_cache_store.rb +105 -0
- data/vendor/rails/actionpack/lib/action_controller/session_management.rb +150 -0
- data/vendor/rails/actionpack/lib/action_controller/status_codes.rb +88 -0
- data/vendor/rails/actionpack/lib/action_controller/streaming.rb +141 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb +24 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +26 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.erb +11 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +29 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/missing_template.erb +2 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/missing_template.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.erb +10 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.erb +21 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/unknown_action.erb +2 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/unknown_action.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/edit.erb +7 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/layout.erb +69 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/list.erb +27 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/list.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/new.erb +6 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/new.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/show.erb +9 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/show.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +516 -0
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +124 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +64 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +530 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +828 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +105 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb +11 -0
- data/vendor/rails/actionpack/lib/action_controller/verification.rb +108 -0
- data/vendor/rails/actionpack/lib/action_pack.rb +24 -0
- data/vendor/rails/actionpack/lib/action_pack/version.rb +9 -0
- data/vendor/rails/actionpack/lib/action_view.rb +31 -0
- data/vendor/rails/actionpack/lib/action_view/base.rb +625 -0
- data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +69 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +237 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +405 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +24 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +10 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +128 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +454 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +31 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +609 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +372 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +192 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/java_script_macros_helper.rb +233 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +193 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +833 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +942 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +1088 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/prototype.js +2515 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +152 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/pagination_helper.rb +86 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +913 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/record_identification_helper.rb +20 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +59 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +140 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +108 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +401 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +496 -0
- data/vendor/rails/actionpack/lib/action_view/partials.rb +128 -0
- data/vendor/rails/actionpack/lib/action_view/template_error.rb +102 -0
- data/vendor/rails/actionpack/test/abstract_unit.rb +29 -0
- data/vendor/rails/actionpack/test/active_record_unit.rb +108 -0
- data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +142 -0
- data/vendor/rails/actionpack/test/activerecord/pagination_test.rb +156 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +479 -0
- data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +43 -0
- data/vendor/rails/actionpack/test/controller/assert_select_test.rb +597 -0
- data/vendor/rails/actionpack/test/controller/base_test.rb +134 -0
- data/vendor/rails/actionpack/test/controller/benchmark_test.rb +33 -0
- data/vendor/rails/actionpack/test/controller/caching_test.rb +262 -0
- data/vendor/rails/actionpack/test/controller/capture_test.rb +71 -0
- data/vendor/rails/actionpack/test/controller/cgi_test.rb +432 -0
- data/vendor/rails/actionpack/test/controller/components_test.rb +129 -0
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +139 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +88 -0
- data/vendor/rails/actionpack/test/controller/custom_handler_test.rb +41 -0
- data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +48 -0
- data/vendor/rails/actionpack/test/controller/fake_controllers.rb +16 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +42 -0
- data/vendor/rails/actionpack/test/controller/filters_test.rb +752 -0
- data/vendor/rails/actionpack/test/controller/flash_test.rb +147 -0
- data/vendor/rails/actionpack/test/controller/fragment_store_setting_test.rb +45 -0
- data/vendor/rails/actionpack/test/controller/helper_test.rb +204 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +104 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +69 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +239 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +51 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +125 -0
- data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +42 -0
- data/vendor/rails/actionpack/test/controller/integration_test.rb +187 -0
- data/vendor/rails/actionpack/test/controller/layout_test.rb +202 -0
- data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +358 -0
- data/vendor/rails/actionpack/test/controller/mime_type_test.rb +54 -0
- data/vendor/rails/actionpack/test/controller/new_render_test.rb +769 -0
- data/vendor/rails/actionpack/test/controller/raw_post_test.rb +74 -0
- data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +103 -0
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +180 -0
- data/vendor/rails/actionpack/test/controller/render_test.rb +404 -0
- data/vendor/rails/actionpack/test/controller/request_test.rb +393 -0
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +215 -0
- data/vendor/rails/actionpack/test/controller/resources_test.rb +585 -0
- data/vendor/rails/actionpack/test/controller/routing_test.rb +1902 -0
- data/vendor/rails/actionpack/test/controller/selector_test.rb +628 -0
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +127 -0
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +228 -0
- data/vendor/rails/actionpack/test/controller/session_management_test.rb +156 -0
- data/vendor/rails/actionpack/test/controller/test_test.rb +520 -0
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +218 -0
- data/vendor/rails/actionpack/test/controller/verification_test.rb +242 -0
- data/vendor/rails/actionpack/test/controller/view_paths_test.rb +79 -0
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +181 -0
- data/vendor/rails/actionpack/test/fixtures/addresses/list.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/addresses/list.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/companies.yml +24 -0
- data/vendor/rails/actionpack/test/fixtures/company.rb +9 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rhtml.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rjs.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rxml.rxml +1 -0
- data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +42 -0
- data/vendor/rails/actionpack/test/fixtures/developer.rb +7 -0
- data/vendor/rails/actionpack/test/fixtures/developers.yml +21 -0
- data/vendor/rails/actionpack/test/fixtures/developers_projects.yml +13 -0
- data/vendor/rails/actionpack/test/fixtures/fun/games/hello_world.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/fun/games/hello_world.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +5 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/item.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/layout_test.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/third_party_template_library.mab +1 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/views/hello.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +3 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/builder.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/standard.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/standard.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/yield.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/mona_lisa.jpg +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +5 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/text_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/override/test/hello_world.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/override/test/hello_world.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/project.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/projects.yml +7 -0
- data/vendor/rails/actionpack/test/fixtures/public/404.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/500.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/images/rails.png +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/bank.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/robber.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/bank.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/robber.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/replies.yml +13 -0
- data/vendor/rails/actionpack/test/fixtures/reply.rb +5 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/scope/test/modgreet.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/scope/test/modgreet.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_greeting.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_greeting.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hash_object.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hash_object.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hello.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hello.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial_only.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial_only.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_person.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/_person.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/action_talk_to_layout.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/action_talk_to_layout.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/block_content_for.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/block_content_for.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/capturing.erb +4 -0
- data/vendor/rails/actionpack/test/fixtures/test/capturing.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/content_for.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/content_for.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/delete_with_js.rjs +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/enum_rjs_test.rjs +6 -0
- data/vendor/rails/actionpack/test/fixtures/test/erb_content_for.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/erb_content_for.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_html_erb.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/greeting.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/greeting.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello.builder +4 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.builder +4 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_container.builder +3 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_container.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_layout_false.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_layout_false.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +11 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/list.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/list.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/non_erb_block_content_for.builder +4 -0
- data/vendor/rails/actionpack/test/fixtures/test/non_erb_block_content_for.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/potential_conflicts.erb +4 -0
- data/vendor/rails/actionpack/test/fixtures/test/potential_conflicts.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_to_string_test.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_to_string_test.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/update_element_with_capture.erb +9 -0
- data/vendor/rails/actionpack/test/fixtures/test/update_element_with_capture.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/topic.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/topics.yml +22 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +197 -0
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +367 -0
- data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +72 -0
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +168 -0
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +1394 -0
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +611 -0
- data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +489 -0
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +149 -0
- data/vendor/rails/actionpack/test/template/java_script_macros_helper_test.rb +109 -0
- data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +67 -0
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +89 -0
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +556 -0
- data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +90 -0
- data/vendor/rails/actionpack/test/template/tag_helper_test.rb +74 -0
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +356 -0
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +423 -0
- data/vendor/rails/actionpack/test/testing_sandbox.rb +11 -0
- data/vendor/rails/actionwebservice/CHANGELOG +265 -0
- data/vendor/rails/actionwebservice/MIT-LICENSE +21 -0
- data/vendor/rails/actionwebservice/README +364 -0
- data/vendor/rails/actionwebservice/Rakefile +171 -0
- data/vendor/rails/actionwebservice/TODO +32 -0
- data/vendor/rails/actionwebservice/examples/googlesearch/README +143 -0
- data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb +50 -0
- data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb +57 -0
- data/vendor/rails/actionwebservice/examples/googlesearch/delegated/google_search_service.rb +108 -0
- data/vendor/rails/actionwebservice/examples/googlesearch/delegated/search_controller.rb +7 -0
- data/vendor/rails/actionwebservice/examples/googlesearch/direct/google_search_api.rb +50 -0
- data/vendor/rails/actionwebservice/examples/googlesearch/direct/search_controller.rb +58 -0
- data/vendor/rails/actionwebservice/examples/metaWeblog/README +17 -0
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_api.rb +60 -0
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb +34 -0
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb +67 -0
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb +48 -0
- data/vendor/rails/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb +16 -0
- data/vendor/rails/actionwebservice/install.rb +30 -0
- data/vendor/rails/actionwebservice/lib/action_web_service.rb +66 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/api.rb +301 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/base.rb +42 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/casting.rb +138 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/client.rb +3 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/client/base.rb +28 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/client/soap_client.rb +113 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb +58 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/container.rb +3 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/container/action_controller_container.rb +93 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/container/delegated_container.rb +86 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/container/direct_container.rb +69 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher.rb +2 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/abstract.rb +207 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +379 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/invocation.rb +202 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol.rb +4 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/abstract.rb +112 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb +37 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb +176 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb +235 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +122 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/scaffolding.rb +283 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/struct.rb +68 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb +26 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/support/signature_types.rb +226 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb +65 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml +0 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb +6 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml +0 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.erb +29 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml +0 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.erb +30 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml +0 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/test_invoke.rb +110 -0
- data/vendor/rails/actionwebservice/lib/action_web_service/version.rb +9 -0
- data/vendor/rails/actionwebservice/setup.rb +1379 -0
- data/vendor/rails/actionwebservice/test/abstract_client.rb +183 -0
- data/vendor/rails/actionwebservice/test/abstract_dispatcher.rb +551 -0
- data/vendor/rails/actionwebservice/test/abstract_unit.rb +45 -0
- data/vendor/rails/actionwebservice/test/api_test.rb +102 -0
- data/vendor/rails/actionwebservice/test/apis/auto_load_api.rb +3 -0
- data/vendor/rails/actionwebservice/test/apis/broken_auto_load_api.rb +2 -0
- data/vendor/rails/actionwebservice/test/base_test.rb +42 -0
- data/vendor/rails/actionwebservice/test/casting_test.rb +86 -0
- data/vendor/rails/actionwebservice/test/client_soap_test.rb +153 -0
- data/vendor/rails/actionwebservice/test/client_xmlrpc_test.rb +152 -0
- data/vendor/rails/actionwebservice/test/container_test.rb +73 -0
- data/vendor/rails/actionwebservice/test/dispatcher_action_controller_soap_test.rb +137 -0
- data/vendor/rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb +59 -0
- data/vendor/rails/actionwebservice/test/fixtures/db_definitions/mysql.sql +8 -0
- data/vendor/rails/actionwebservice/test/fixtures/users.yml +12 -0
- data/vendor/rails/actionwebservice/test/gencov +3 -0
- data/vendor/rails/actionwebservice/test/invocation_test.rb +185 -0
- data/vendor/rails/actionwebservice/test/run +6 -0
- data/vendor/rails/actionwebservice/test/scaffolded_controller_test.rb +146 -0
- data/vendor/rails/actionwebservice/test/struct_test.rb +52 -0
- data/vendor/rails/actionwebservice/test/test_invoke_test.rb +112 -0
- data/vendor/rails/activerecord/CHANGELOG +3195 -0
- data/vendor/rails/activerecord/MIT-LICENSE +20 -0
- data/vendor/rails/activerecord/README +360 -0
- data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +64 -0
- data/vendor/rails/activerecord/Rakefile +223 -0
- data/vendor/rails/activerecord/benchmarks/benchmark.rb +26 -0
- data/vendor/rails/activerecord/benchmarks/mysql_benchmark.rb +19 -0
- data/vendor/rails/activerecord/examples/associations.png +0 -0
- data/vendor/rails/activerecord/examples/associations.rb +87 -0
- data/vendor/rails/activerecord/examples/shared_setup.rb +15 -0
- data/vendor/rails/activerecord/examples/validation.rb +85 -0
- data/vendor/rails/activerecord/install.rb +30 -0
- data/vendor/rails/activerecord/lib/active_record.rb +85 -0
- data/vendor/rails/activerecord/lib/active_record/acts/list.rb +253 -0
- data/vendor/rails/activerecord/lib/active_record/acts/nested_set.rb +211 -0
- data/vendor/rails/activerecord/lib/active_record/acts/tree.rb +96 -0
- data/vendor/rails/activerecord/lib/active_record/aggregations.rb +191 -0
- data/vendor/rails/activerecord/lib/active_record/associations.rb +1701 -0
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +212 -0
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +162 -0
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +56 -0
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +50 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +163 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +196 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +245 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +96 -0
- data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +75 -0
- data/vendor/rails/activerecord/lib/active_record/base.rb +2276 -0
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +274 -0
- data/vendor/rails/activerecord/lib/active_record/callbacks.rb +371 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +279 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +135 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +61 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +393 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +303 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +157 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/db2_adapter.rb +228 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/firebird_adapter.rb +728 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb +863 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +421 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/openbase_adapter.rb +349 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +710 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +582 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +415 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +606 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb +666 -0
- data/vendor/rails/activerecord/lib/active_record/deprecated_associations.rb +104 -0
- data/vendor/rails/activerecord/lib/active_record/deprecated_finders.rb +44 -0
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +639 -0
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +137 -0
- data/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +77 -0
- data/vendor/rails/activerecord/lib/active_record/migration.rb +393 -0
- data/vendor/rails/activerecord/lib/active_record/observer.rb +178 -0
- data/vendor/rails/activerecord/lib/active_record/query_cache.rb +111 -0
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +219 -0
- data/vendor/rails/activerecord/lib/active_record/schema.rb +58 -0
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +164 -0
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +50 -0
- data/vendor/rails/activerecord/lib/active_record/transactions.rb +128 -0
- data/vendor/rails/activerecord/lib/active_record/validations.rb +902 -0
- data/vendor/rails/activerecord/lib/active_record/vendor/db2.rb +362 -0
- data/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb +1214 -0
- data/vendor/rails/activerecord/lib/active_record/version.rb +9 -0
- data/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb +15 -0
- data/vendor/rails/activerecord/lib/active_record/wrappings.rb +58 -0
- data/vendor/rails/activerecord/lib/active_record/xml_serialization.rb +327 -0
- data/vendor/rails/activerecord/test/aaa_create_tables_test.rb +59 -0
- data/vendor/rails/activerecord/test/abstract_unit.rb +79 -0
- data/vendor/rails/activerecord/test/active_schema_test_mysql.rb +31 -0
- data/vendor/rails/activerecord/test/adapter_test.rb +87 -0
- data/vendor/rails/activerecord/test/adapter_test_sqlserver.rb +95 -0
- data/vendor/rails/activerecord/test/aggregations_test.rb +95 -0
- data/vendor/rails/activerecord/test/all.sh +8 -0
- data/vendor/rails/activerecord/test/ar_schema_test.rb +33 -0
- data/vendor/rails/activerecord/test/association_inheritance_reload.rb +14 -0
- data/vendor/rails/activerecord/test/associations/callbacks_test.rb +126 -0
- data/vendor/rails/activerecord/test/associations/cascaded_eager_loading_test.rb +138 -0
- data/vendor/rails/activerecord/test/associations/eager_singularization_test.rb +145 -0
- data/vendor/rails/activerecord/test/associations/eager_test.rb +393 -0
- data/vendor/rails/activerecord/test/associations/extension_test.rb +42 -0
- data/vendor/rails/activerecord/test/associations/join_model_test.rb +497 -0
- data/vendor/rails/activerecord/test/associations_test.rb +1880 -0
- data/vendor/rails/activerecord/test/attribute_methods_test.rb +49 -0
- data/vendor/rails/activerecord/test/base_test.rb +1656 -0
- data/vendor/rails/activerecord/test/binary_test.rb +37 -0
- data/vendor/rails/activerecord/test/calculations_test.rb +219 -0
- data/vendor/rails/activerecord/test/callbacks_test.rb +400 -0
- data/vendor/rails/activerecord/test/class_inheritable_attributes_test.rb +32 -0
- data/vendor/rails/activerecord/test/column_alias_test.rb +17 -0
- data/vendor/rails/activerecord/test/connection_test_firebird.rb +8 -0
- data/vendor/rails/activerecord/test/connections/native_db2/connection.rb +25 -0
- data/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +26 -0
- data/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +27 -0
- data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +27 -0
- data/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +21 -0
- data/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +27 -0
- data/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +23 -0
- data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +25 -0
- data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +25 -0
- data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +18 -0
- data/vendor/rails/activerecord/test/connections/native_sqlserver/connection.rb +23 -0
- data/vendor/rails/activerecord/test/connections/native_sqlserver_odbc/connection.rb +25 -0
- data/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +23 -0
- data/vendor/rails/activerecord/test/copy_table_test_sqlite.rb +65 -0
- data/vendor/rails/activerecord/test/datatype_test_postgresql.rb +52 -0
- data/vendor/rails/activerecord/test/default_test_firebird.rb +16 -0
- data/vendor/rails/activerecord/test/defaults_test.rb +60 -0
- data/vendor/rails/activerecord/test/deprecated_associations_test.rb +396 -0
- data/vendor/rails/activerecord/test/deprecated_finder_test.rb +151 -0
- data/vendor/rails/activerecord/test/empty_date_time_test.rb +25 -0
- data/vendor/rails/activerecord/test/finder_test.rb +523 -0
- data/vendor/rails/activerecord/test/fixtures/accounts.yml +28 -0
- data/vendor/rails/activerecord/test/fixtures/all/developers.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/all/people.csv +0 -0
- data/vendor/rails/activerecord/test/fixtures/all/tasks.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/author.rb +99 -0
- data/vendor/rails/activerecord/test/fixtures/author_favorites.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/authors.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/auto_id.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_numeric_first_char +1 -0
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_spaces +1 -0
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/blank_line +3 -0
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/duplicate_attributes +3 -0
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/missing_value +1 -0
- data/vendor/rails/activerecord/test/fixtures/binary.rb +2 -0
- data/vendor/rails/activerecord/test/fixtures/categories.yml +14 -0
- data/vendor/rails/activerecord/test/fixtures/categories/special_categories.yml +9 -0
- data/vendor/rails/activerecord/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/categories_ordered.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/categories_posts.yml +23 -0
- data/vendor/rails/activerecord/test/fixtures/categorization.rb +5 -0
- data/vendor/rails/activerecord/test/fixtures/categorizations.yml +17 -0
- data/vendor/rails/activerecord/test/fixtures/category.rb +20 -0
- data/vendor/rails/activerecord/test/fixtures/column_name.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/comment.rb +23 -0
- data/vendor/rails/activerecord/test/fixtures/comments.yml +59 -0
- data/vendor/rails/activerecord/test/fixtures/companies.yml +55 -0
- data/vendor/rails/activerecord/test/fixtures/company.rb +111 -0
- data/vendor/rails/activerecord/test/fixtures/company_in_module.rb +59 -0
- data/vendor/rails/activerecord/test/fixtures/computer.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/computers.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/course.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/courses.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/customer.rb +55 -0
- data/vendor/rails/activerecord/test/fixtures/customers.yml +17 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.drop.sql +32 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.sql +231 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.sql +5 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.drop.sql +63 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.sql +304 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.sql +6 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.drop.sql +32 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.sql +268 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.drop.sql +1 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.sql +4 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.drop.sql +32 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.sql +234 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.sql +5 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.sql +302 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.sql +7 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.drop.sql +65 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.sql +325 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.sql +6 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.drop.sql +37 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.sql +247 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.sql +4 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +74 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.drop.sql +32 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.sql +215 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.sql +5 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql +34 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.sql +243 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.sql +5 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.drop.sql +34 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.sql +218 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.drop.sql +4 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.sql +5 -0
- data/vendor/rails/activerecord/test/fixtures/default.rb +2 -0
- data/vendor/rails/activerecord/test/fixtures/developer.rb +52 -0
- data/vendor/rails/activerecord/test/fixtures/developers.yml +21 -0
- data/vendor/rails/activerecord/test/fixtures/developers_projects.yml +17 -0
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_action_controller +3 -0
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_active_record +3 -0
- data/vendor/rails/activerecord/test/fixtures/developers_projects/jamis_active_record +2 -0
- data/vendor/rails/activerecord/test/fixtures/edge.rb +5 -0
- data/vendor/rails/activerecord/test/fixtures/edges.yml +6 -0
- data/vendor/rails/activerecord/test/fixtures/entrant.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/entrants.yml +14 -0
- data/vendor/rails/activerecord/test/fixtures/fk_test_has_fk.yml +3 -0
- data/vendor/rails/activerecord/test/fixtures/fk_test_has_pk.yml +2 -0
- data/vendor/rails/activerecord/test/fixtures/flowers.jpg +0 -0
- data/vendor/rails/activerecord/test/fixtures/funny_jokes.yml +10 -0
- data/vendor/rails/activerecord/test/fixtures/joke.rb +6 -0
- data/vendor/rails/activerecord/test/fixtures/keyboard.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/legacy_thing.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/legacy_things.yml +3 -0
- data/vendor/rails/activerecord/test/fixtures/migrations/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/fixtures/migrations/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/fixtures/migrations/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_decimal/1_give_me_big_numbers.rb +15 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/3_foo.rb +7 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1000_people_have_middle_names.rb +9 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/3_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/4_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/fixtures/mixed_case_monkey.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml +6 -0
- data/vendor/rails/activerecord/test/fixtures/mixin.rb +63 -0
- data/vendor/rails/activerecord/test/fixtures/mixins.yml +127 -0
- data/vendor/rails/activerecord/test/fixtures/movie.rb +5 -0
- data/vendor/rails/activerecord/test/fixtures/movies.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/naked/csv/accounts.csv +1 -0
- data/vendor/rails/activerecord/test/fixtures/naked/yml/accounts.yml +1 -0
- data/vendor/rails/activerecord/test/fixtures/naked/yml/companies.yml +1 -0
- data/vendor/rails/activerecord/test/fixtures/naked/yml/courses.yml +1 -0
- data/vendor/rails/activerecord/test/fixtures/order.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/people.yml +3 -0
- data/vendor/rails/activerecord/test/fixtures/person.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/post.rb +58 -0
- data/vendor/rails/activerecord/test/fixtures/posts.yml +48 -0
- data/vendor/rails/activerecord/test/fixtures/project.rb +27 -0
- data/vendor/rails/activerecord/test/fixtures/projects.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/reader.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/readers.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/reply.rb +37 -0
- data/vendor/rails/activerecord/test/fixtures/subject.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/subscriber.rb +6 -0
- data/vendor/rails/activerecord/test/fixtures/subscribers/first +2 -0
- data/vendor/rails/activerecord/test/fixtures/subscribers/second +2 -0
- data/vendor/rails/activerecord/test/fixtures/tag.rb +7 -0
- data/vendor/rails/activerecord/test/fixtures/tagging.rb +6 -0
- data/vendor/rails/activerecord/test/fixtures/taggings.yml +18 -0
- data/vendor/rails/activerecord/test/fixtures/tags.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/task.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/tasks.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/topic.rb +25 -0
- data/vendor/rails/activerecord/test/fixtures/topics.yml +22 -0
- data/vendor/rails/activerecord/test/fixtures/vertex.rb +9 -0
- data/vendor/rails/activerecord/test/fixtures/vertices.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures_test.rb +410 -0
- data/vendor/rails/activerecord/test/inheritance_test.rb +212 -0
- data/vendor/rails/activerecord/test/lifecycle_test.rb +137 -0
- data/vendor/rails/activerecord/test/locking_test.rb +241 -0
- data/vendor/rails/activerecord/test/method_scoping_test.rb +416 -0
- data/vendor/rails/activerecord/test/migration_test.rb +781 -0
- data/vendor/rails/activerecord/test/migration_test_firebird.rb +124 -0
- data/vendor/rails/activerecord/test/mixin_nested_set_test.rb +196 -0
- data/vendor/rails/activerecord/test/mixin_test.rb +550 -0
- data/vendor/rails/activerecord/test/modules_test.rb +34 -0
- data/vendor/rails/activerecord/test/multiple_db_test.rb +60 -0
- data/vendor/rails/activerecord/test/pk_test.rb +101 -0
- data/vendor/rails/activerecord/test/query_cache_test.rb +107 -0
- data/vendor/rails/activerecord/test/readonly_test.rb +107 -0
- data/vendor/rails/activerecord/test/reflection_test.rb +166 -0
- data/vendor/rails/activerecord/test/schema_authorization_test_postgresql.rb +75 -0
- data/vendor/rails/activerecord/test/schema_dumper_test.rb +124 -0
- data/vendor/rails/activerecord/test/schema_test_postgresql.rb +64 -0
- data/vendor/rails/activerecord/test/synonym_test_oracle.rb +17 -0
- data/vendor/rails/activerecord/test/table_name_test_sqlserver.rb +23 -0
- data/vendor/rails/activerecord/test/threaded_connections_test.rb +48 -0
- data/vendor/rails/activerecord/test/transactions_test.rb +268 -0
- data/vendor/rails/activerecord/test/unconnected_test.rb +32 -0
- data/vendor/rails/activerecord/test/validations_test.rb +1131 -0
- data/vendor/rails/activerecord/test/xml_serialization_test.rb +153 -0
- data/vendor/rails/activeresource/CHANGELOG +177 -0
- data/vendor/rails/activeresource/MIT-LICENSE +20 -0
- data/vendor/rails/activeresource/README +235 -0
- data/vendor/rails/activeresource/Rakefile +132 -0
- data/vendor/rails/activeresource/lib/active_resource.rb +47 -0
- data/vendor/rails/activeresource/lib/active_resource/base.rb +424 -0
- data/vendor/rails/activeresource/lib/active_resource/connection.rb +161 -0
- data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +104 -0
- data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +131 -0
- data/vendor/rails/activeresource/lib/active_resource/struct.rb +16 -0
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +161 -0
- data/vendor/rails/activeresource/lib/active_resource/version.rb +9 -0
- data/vendor/rails/activeresource/test/abstract_unit.rb +10 -0
- data/vendor/rails/activeresource/test/authorization_test.rb +82 -0
- data/vendor/rails/activeresource/test/base/custom_methods_test.rb +87 -0
- data/vendor/rails/activeresource/test/base/equality_test.rb +43 -0
- data/vendor/rails/activeresource/test/base/load_test.rb +111 -0
- data/vendor/rails/activeresource/test/base_errors_test.rb +35 -0
- data/vendor/rails/activeresource/test/base_test.rb +390 -0
- data/vendor/rails/activeresource/test/connection_test.rb +148 -0
- data/vendor/rails/activeresource/test/fixtures/beast.rb +14 -0
- data/vendor/rails/activeresource/test/fixtures/person.rb +3 -0
- data/vendor/rails/activeresource/test/fixtures/street_address.rb +4 -0
- data/vendor/rails/activeresource/test/setter_trap.rb +29 -0
- data/vendor/rails/activesupport/CHANGELOG +787 -0
- data/vendor/rails/activesupport/MIT-LICENSE +20 -0
- data/vendor/rails/activesupport/README +43 -0
- data/vendor/rails/activesupport/Rakefile +82 -0
- data/vendor/rails/activesupport/install.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support.rb +46 -0
- data/vendor/rails/activesupport/lib/active_support/caching_tools.rb +62 -0
- data/vendor/rails/activesupport/lib/active_support/clean_logger.rb +78 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +72 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +55 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/formatting.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +50 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/cgi.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +14 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/class.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +48 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +140 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +45 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +173 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +62 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +21 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +221 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/diff.rb +11 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +101 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +53 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +21 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb +11 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +51 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/requires.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/load_error.rb +38 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/logger.rb +16 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +70 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +48 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +41 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +11 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +17 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb +44 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +91 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +54 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/pathname.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb +14 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/proc.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +21 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +58 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +153 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +17 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +42 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/test.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/test/difference.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/behavior.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +239 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +39 -0
- data/vendor/rails/activesupport/lib/active_support/dependencies.rb +539 -0
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +202 -0
- data/vendor/rails/activesupport/lib/active_support/duration.rb +89 -0
- data/vendor/rails/activesupport/lib/active_support/inflections.rb +52 -0
- data/vendor/rails/activesupport/lib/active_support/inflector.rb +275 -0
- data/vendor/rails/activesupport/lib/active_support/json.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +45 -0
- data/vendor/rails/activesupport/lib/active_support/json/variable.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +129 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte/generators/generate_tables.rb +149 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/passthru_handler.rb +9 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +458 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler_proc.rb +43 -0
- data/vendor/rails/activesupport/lib/active_support/option_merger.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +44 -0
- data/vendor/rails/activesupport/lib/active_support/reloadable.rb +60 -0
- data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +180 -0
- data/vendor/rails/activesupport/lib/active_support/values/unicode_tables.dat +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/blankslate.rb +63 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xchar.rb +112 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlbase.rb +145 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlevents.rb +63 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlmarkup.rb +327 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/xml_simple.rb +1021 -0
- data/vendor/rails/activesupport/lib/active_support/version.rb +9 -0
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +38 -0
- data/vendor/rails/activesupport/test/abstract_unit.rb +7 -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/caching_tools_test.rb +79 -0
- data/vendor/rails/activesupport/test/clean_logger_test.rb +87 -0
- data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +182 -0
- data/vendor/rails/activesupport/test/core_ext/blank_test.rb +11 -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 +208 -0
- data/vendor/rails/activesupport/test/core_ext/class_test.rb +36 -0
- data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +21 -0
- data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +152 -0
- data/vendor/rails/activesupport/test/core_ext/duration_test.rb +21 -0
- data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +61 -0
- data/vendor/rails/activesupport/test/core_ext/exception_test.rb +64 -0
- data/vendor/rails/activesupport/test/core_ext/file_test.rb +29 -0
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +622 -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_tests.rb +16 -0
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default.rb +30 -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 +31 -0
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +274 -0
- data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +24 -0
- data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +104 -0
- data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +216 -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 +13 -0
- data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +152 -0
- data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +9 -0
- data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +373 -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 +752 -0
- data/vendor/rails/activesupport/test/deprecation_test.rb +151 -0
- data/vendor/rails/activesupport/test/inflector_test.rb +438 -0
- data/vendor/rails/activesupport/test/json/decoding_test.rb +28 -0
- data/vendor/rails/activesupport/test/json/encoding_test.rb +96 -0
- data/vendor/rails/activesupport/test/multibyte_chars_test.rb +164 -0
- data/vendor/rails/activesupport/test/multibyte_conformance.rb +141 -0
- data/vendor/rails/activesupport/test/multibyte_handler_test.rb +277 -0
- data/vendor/rails/activesupport/test/option_merger_test.rb +50 -0
- data/vendor/rails/activesupport/test/ordered_options_test.rb +80 -0
- data/vendor/rails/activesupport/test/reloadable_test.rb +123 -0
- data/vendor/rails/activesupport/test/test_test.rb +56 -0
- data/vendor/rails/activesupport/test/time_zone_test.rb +91 -0
- data/vendor/rails/activesupport/test/whiny_nil_test.rb +38 -0
- data/vendor/rails/railties/CHANGELOG +1407 -0
- data/vendor/rails/railties/MIT-LICENSE +20 -0
- data/vendor/rails/railties/README +180 -0
- data/vendor/rails/railties/Rakefile +355 -0
- data/vendor/rails/railties/bin/about +3 -0
- data/vendor/rails/railties/bin/console +3 -0
- data/vendor/rails/railties/bin/destroy +3 -0
- data/vendor/rails/railties/bin/generate +3 -0
- data/vendor/rails/railties/bin/performance/benchmarker +3 -0
- data/vendor/rails/railties/bin/performance/profiler +3 -0
- data/vendor/rails/railties/bin/plugin +3 -0
- data/vendor/rails/railties/bin/process/inspector +3 -0
- data/vendor/rails/railties/bin/process/reaper +3 -0
- data/vendor/rails/railties/bin/process/spawner +3 -0
- data/vendor/rails/railties/bin/rails +19 -0
- data/vendor/rails/railties/bin/runner +3 -0
- data/vendor/rails/railties/bin/server +3 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +123 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +9 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info_helper.rb +2 -0
- data/vendor/rails/railties/builtin/rails_info/rails_info_controller.rb +2 -0
- data/vendor/rails/railties/configs/apache.conf +40 -0
- data/vendor/rails/railties/configs/databases/frontbase.yml +28 -0
- data/vendor/rails/railties/configs/databases/mysql.yml +48 -0
- data/vendor/rails/railties/configs/databases/oracle.yml +39 -0
- data/vendor/rails/railties/configs/databases/postgresql.yml +44 -0
- data/vendor/rails/railties/configs/databases/sqlite2.yml +16 -0
- data/vendor/rails/railties/configs/databases/sqlite3.yml +19 -0
- data/vendor/rails/railties/configs/initializers/inflections.rb +8 -0
- data/vendor/rails/railties/configs/initializers/mime_types.rb +3 -0
- data/vendor/rails/railties/configs/lighttpd.conf +54 -0
- data/vendor/rails/railties/configs/routes.rb +27 -0
- data/vendor/rails/railties/dispatches/dispatch.fcgi +24 -0
- data/vendor/rails/railties/dispatches/dispatch.rb +10 -0
- data/vendor/rails/railties/dispatches/gateway.cgi +97 -0
- data/vendor/rails/railties/doc/README_FOR_APP +2 -0
- data/vendor/rails/railties/environments/boot.rb +36 -0
- data/vendor/rails/railties/environments/development.rb +18 -0
- data/vendor/rails/railties/environments/environment.rb +55 -0
- data/vendor/rails/railties/environments/production.rb +18 -0
- data/vendor/rails/railties/environments/test.rb +19 -0
- data/vendor/rails/railties/fresh_rakefile +10 -0
- data/vendor/rails/railties/helpers/application.rb +6 -0
- data/vendor/rails/railties/helpers/application_helper.rb +3 -0
- data/vendor/rails/railties/helpers/test_helper.rb +36 -0
- data/vendor/rails/railties/html/404.html +30 -0
- data/vendor/rails/railties/html/500.html +30 -0
- data/vendor/rails/railties/html/favicon.ico +0 -0
- data/vendor/rails/railties/html/images/rails.png +0 -0
- data/vendor/rails/railties/html/index.html +277 -0
- data/vendor/rails/railties/html/javascripts/application.js +2 -0
- data/vendor/rails/railties/html/javascripts/controls.js +833 -0
- data/vendor/rails/railties/html/javascripts/dragdrop.js +942 -0
- data/vendor/rails/railties/html/javascripts/effects.js +1088 -0
- data/vendor/rails/railties/html/javascripts/prototype.js +2515 -0
- data/vendor/rails/railties/html/robots.txt +1 -0
- data/vendor/rails/railties/lib/code_statistics.rb +107 -0
- data/vendor/rails/railties/lib/commands.rb +17 -0
- data/vendor/rails/railties/lib/commands/about.rb +2 -0
- data/vendor/rails/railties/lib/commands/console.rb +32 -0
- data/vendor/rails/railties/lib/commands/destroy.rb +6 -0
- data/vendor/rails/railties/lib/commands/generate.rb +6 -0
- data/vendor/rails/railties/lib/commands/ncgi/listener +86 -0
- data/vendor/rails/railties/lib/commands/ncgi/tracker +69 -0
- data/vendor/rails/railties/lib/commands/performance/benchmarker.rb +24 -0
- data/vendor/rails/railties/lib/commands/performance/profiler.rb +50 -0
- data/vendor/rails/railties/lib/commands/plugin.rb +918 -0
- data/vendor/rails/railties/lib/commands/process/inspector.rb +68 -0
- data/vendor/rails/railties/lib/commands/process/reaper.rb +149 -0
- data/vendor/rails/railties/lib/commands/process/spawner.rb +209 -0
- data/vendor/rails/railties/lib/commands/process/spinner.rb +57 -0
- data/vendor/rails/railties/lib/commands/runner.rb +48 -0
- data/vendor/rails/railties/lib/commands/server.rb +39 -0
- data/vendor/rails/railties/lib/commands/servers/base.rb +31 -0
- data/vendor/rails/railties/lib/commands/servers/lighttpd.rb +94 -0
- data/vendor/rails/railties/lib/commands/servers/mongrel.rb +69 -0
- data/vendor/rails/railties/lib/commands/servers/webrick.rb +65 -0
- data/vendor/rails/railties/lib/commands/update.rb +4 -0
- data/vendor/rails/railties/lib/console_app.rb +27 -0
- data/vendor/rails/railties/lib/console_sandbox.rb +6 -0
- data/vendor/rails/railties/lib/console_with_helpers.rb +23 -0
- data/vendor/rails/railties/lib/dispatcher.rb +181 -0
- data/vendor/rails/railties/lib/fcgi_handler.rb +207 -0
- data/vendor/rails/railties/lib/initializer.rb +693 -0
- data/vendor/rails/railties/lib/rails/plugin/loader.rb +123 -0
- data/vendor/rails/railties/lib/rails/plugin/locator.rb +59 -0
- data/vendor/rails/railties/lib/rails/version.rb +9 -0
- data/vendor/rails/railties/lib/rails_generator.rb +43 -0
- data/vendor/rails/railties/lib/rails_generator/base.rb +261 -0
- data/vendor/rails/railties/lib/rails_generator/commands.rb +581 -0
- data/vendor/rails/railties/lib/rails_generator/generated_attribute.rb +42 -0
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/USAGE +16 -0
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +175 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/USAGE +30 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/controller_generator.rb +37 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +10 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +18 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/helper.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.html.erb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/USAGE +14 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +16 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +10 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/USAGE +18 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +34 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb +3 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +13 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +37 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.erb +3 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +14 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/migration_generator.rb +7 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/templates/migration.rb +7 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE +26 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +38 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +11 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb +13 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/model.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +10 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/USAGE +15 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/observer_generator.rb +16 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/observer.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +10 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/USAGE +35 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +39 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +20 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/README +13 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile +22 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/USAGE +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/generator.rb +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/init.rb +1 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/install.rb +1 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/plugin.rb +1 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/tasks.rake +4 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +1 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE +30 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +63 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/USAGE +18 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/controller.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/fixtures.yml +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +20 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/helper.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/migration.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/model.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/unit_test.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/USAGE +37 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +92 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +85 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/fixtures.yml +11 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +57 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/helper.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +17 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/migration.rb +13 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/model.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +74 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/unit_test.rb +10 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +19 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +24 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +18 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +10 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/USAGE +15 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +18 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/templates/migration.rb +16 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/USAGE +28 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/api_definition.rb +5 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/controller.rb +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/functional_test.rb +19 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/web_service_generator.rb +29 -0
- data/vendor/rails/railties/lib/rails_generator/lookup.rb +209 -0
- data/vendor/rails/railties/lib/rails_generator/manifest.rb +53 -0
- data/vendor/rails/railties/lib/rails_generator/options.rb +143 -0
- data/vendor/rails/railties/lib/rails_generator/scripts.rb +83 -0
- data/vendor/rails/railties/lib/rails_generator/scripts/destroy.rb +30 -0
- data/vendor/rails/railties/lib/rails_generator/scripts/generate.rb +7 -0
- data/vendor/rails/railties/lib/rails_generator/scripts/update.rb +12 -0
- data/vendor/rails/railties/lib/rails_generator/simple_logger.rb +46 -0
- data/vendor/rails/railties/lib/rails_generator/spec.rb +44 -0
- data/vendor/rails/railties/lib/railties_path.rb +1 -0
- data/vendor/rails/railties/lib/ruby_version_check.rb +17 -0
- data/vendor/rails/railties/lib/rubyprof_ext.rb +35 -0
- data/vendor/rails/railties/lib/tasks/annotations.rake +84 -0
- data/vendor/rails/railties/lib/tasks/databases.rake +187 -0
- data/vendor/rails/railties/lib/tasks/documentation.rake +82 -0
- data/vendor/rails/railties/lib/tasks/framework.rake +112 -0
- data/vendor/rails/railties/lib/tasks/log.rake +9 -0
- data/vendor/rails/railties/lib/tasks/misc.rake +4 -0
- data/vendor/rails/railties/lib/tasks/pre_namespace_aliases.rake +53 -0
- data/vendor/rails/railties/lib/tasks/rails.rb +8 -0
- data/vendor/rails/railties/lib/tasks/statistics.rake +18 -0
- data/vendor/rails/railties/lib/tasks/testing.rake +120 -0
- data/vendor/rails/railties/lib/tasks/tmp.rake +37 -0
- data/vendor/rails/railties/lib/test_help.rb +17 -0
- data/vendor/rails/railties/lib/webrick_server.rb +165 -0
- data/vendor/rails/railties/test/abstract_unit.rb +17 -0
- data/vendor/rails/railties/test/dispatcher_test.rb +139 -0
- data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +266 -0
- data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +1 -0
- data/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
- data/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +2 -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/init.rb +7 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +2 -0
- data/vendor/rails/railties/test/initializer_test.rb +22 -0
- data/vendor/rails/railties/test/mocks/dispatcher.rb +13 -0
- data/vendor/rails/railties/test/mocks/fcgi.rb +15 -0
- data/vendor/rails/railties/test/mocks/routes.rb +6 -0
- data/vendor/rails/railties/test/mocks/stubbed_breakpoint.rb +2 -0
- data/vendor/rails/railties/test/mocks/stubbed_kernel.rb +5 -0
- data/vendor/rails/railties/test/plugin_loader_test.rb +78 -0
- data/vendor/rails/railties/test/plugin_locator_test.rb +41 -0
- data/vendor/rails/railties/test/plugin_test_helper.rb +18 -0
- data/vendor/rails/railties/test/rails_generator_test.rb +137 -0
- data/vendor/rails/railties/test/rails_info_controller_test.rb +48 -0
- data/vendor/rails/railties/test/rails_info_test.rb +98 -0
- metadata +1802 -8
@@ -0,0 +1,2217 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview Zapatec Transport library. Used to fetch data from the server,
|
3
|
+
* parse and serialize XML and JSON data.
|
4
|
+
*
|
5
|
+
* <pre>
|
6
|
+
* Copyright (c) 2004-2006 by Zapatec, Inc.
|
7
|
+
* http://www.zapatec.com
|
8
|
+
* 1700 MLK Way, Berkeley, California,
|
9
|
+
* 94709, U.S.A.
|
10
|
+
* All rights reserved.
|
11
|
+
* </pre>
|
12
|
+
*/
|
13
|
+
|
14
|
+
// $Id: transport.js 4976 2006-11-02 00:10:50Z alex $
|
15
|
+
|
16
|
+
if (typeof Zapatec == 'undefined') {
|
17
|
+
/**
|
18
|
+
* Namespace definition.
|
19
|
+
* @constructor
|
20
|
+
*/
|
21
|
+
Zapatec = function() {};
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @constructor
|
26
|
+
*/
|
27
|
+
Zapatec.Transport = function() {};
|
28
|
+
|
29
|
+
// Determine most current versions of ActiveX objects available
|
30
|
+
if (typeof ActiveXObject != 'undefined') {
|
31
|
+
|
32
|
+
/**
|
33
|
+
* String variable with most current version of XMLDOM ActiveX object name
|
34
|
+
* available.
|
35
|
+
* @private
|
36
|
+
*/
|
37
|
+
Zapatec.Transport.XMLDOM = null;
|
38
|
+
|
39
|
+
/**
|
40
|
+
* String variable with Most current version of XMLHTTP ActiveX object name
|
41
|
+
* available.
|
42
|
+
* @private
|
43
|
+
*/
|
44
|
+
Zapatec.Transport.XMLHTTP = null;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @ignore
|
48
|
+
* Returns first available ActiveX object name from the given list.
|
49
|
+
*
|
50
|
+
* @param {object} arrVersions List of ActiveX object names to test
|
51
|
+
* @return First available ActiveX object name or null
|
52
|
+
* @type string
|
53
|
+
*/
|
54
|
+
Zapatec.Transport.pickActiveXVersion = function(arrVersions) {
|
55
|
+
for (var iVn = 0; iVn < arrVersions.length; iVn++) {
|
56
|
+
try {
|
57
|
+
var objDocument = new ActiveXObject(arrVersions[iVn]);
|
58
|
+
// If it gets to this point, the string worked
|
59
|
+
return arrVersions[iVn];
|
60
|
+
} catch (objException) {};
|
61
|
+
}
|
62
|
+
return null;
|
63
|
+
};
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Most current version of XMLDOM ActiveX object.
|
67
|
+
* @private
|
68
|
+
*/
|
69
|
+
Zapatec.Transport.XMLDOM = Zapatec.Transport.pickActiveXVersion([
|
70
|
+
'Msxml2.DOMDocument.4.0',
|
71
|
+
'Msxml2.DOMDocument.3.0',
|
72
|
+
'MSXML2.DOMDocument',
|
73
|
+
'MSXML.DOMDocument',
|
74
|
+
'Microsoft.XMLDOM'
|
75
|
+
]);
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Most current version of XMLHTTP ActiveX object.
|
79
|
+
* @private
|
80
|
+
*/
|
81
|
+
Zapatec.Transport.XMLHTTP = Zapatec.Transport.pickActiveXVersion([
|
82
|
+
'Msxml2.XMLHTTP.4.0',
|
83
|
+
'MSXML2.XMLHTTP.3.0',
|
84
|
+
'MSXML2.XMLHTTP',
|
85
|
+
'Microsoft.XMLHTTP'
|
86
|
+
]);
|
87
|
+
|
88
|
+
// We don't need this any more
|
89
|
+
Zapatec.Transport.pickActiveXVersion = null;
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Creates cross browser XMLHttpRequest object.
|
95
|
+
*
|
96
|
+
* @return New XMLHttpRequest object.
|
97
|
+
* @type object
|
98
|
+
*/
|
99
|
+
Zapatec.Transport.createXmlHttpRequest = function() {
|
100
|
+
if (typeof ActiveXObject != 'undefined') {
|
101
|
+
try {
|
102
|
+
return new ActiveXObject(Zapatec.Transport.XMLHTTP);
|
103
|
+
} catch (objException) {};
|
104
|
+
}
|
105
|
+
if (typeof XMLHttpRequest != 'undefined') {
|
106
|
+
return new XMLHttpRequest();
|
107
|
+
}
|
108
|
+
return null;
|
109
|
+
};
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Checks if animated GIF is already displayed in the specified div.
|
113
|
+
*
|
114
|
+
* <pre>
|
115
|
+
* Arguments object format:
|
116
|
+
* {
|
117
|
+
* busyContainer: [object or string] element where to put animated GIF,
|
118
|
+
* busyImage: [string, optional] image name
|
119
|
+
* }
|
120
|
+
* </pre>
|
121
|
+
*
|
122
|
+
* @private
|
123
|
+
* @param {object} objArgs Arguments object
|
124
|
+
* @return True if image is displayed
|
125
|
+
* @type boolean
|
126
|
+
*/
|
127
|
+
Zapatec.Transport.isBusy = function(objArgs) {
|
128
|
+
// Get container
|
129
|
+
var objContainer = objArgs.busyContainer;
|
130
|
+
if (typeof objContainer == 'string') {
|
131
|
+
objContainer = document.getElementById(objContainer);
|
132
|
+
}
|
133
|
+
if (!objContainer) {
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
// Get image name
|
137
|
+
var strImage = objArgs.busyImage;
|
138
|
+
if (typeof strImage != 'string') {
|
139
|
+
strImage = '';
|
140
|
+
}
|
141
|
+
strImage = strImage.split('/').pop();
|
142
|
+
if (!strImage.length) {
|
143
|
+
strImage = 'zpbusy.gif';
|
144
|
+
}
|
145
|
+
// Check if image is displayed
|
146
|
+
var objFC = objContainer.firstChild;
|
147
|
+
if (objFC) {
|
148
|
+
objFC = objFC.firstChild;
|
149
|
+
if (objFC) {
|
150
|
+
objFC = objFC.firstChild;
|
151
|
+
if (objFC && objFC.tagName && objFC.tagName.toLowerCase() == 'img') {
|
152
|
+
var strSrc = objFC.getAttribute('src');
|
153
|
+
if (typeof strSrc == 'string' && strSrc.length) {
|
154
|
+
// Get last token
|
155
|
+
strSrc = strSrc.split('/').pop();
|
156
|
+
if (strSrc == strImage) {
|
157
|
+
return true;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
return false;
|
164
|
+
};
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Shows animated GIF in the specified div.
|
168
|
+
*
|
169
|
+
* <pre>
|
170
|
+
* Arguments object format:
|
171
|
+
* {
|
172
|
+
* busyContainer: [object or string] element where to put animated GIF,
|
173
|
+
* busyImage: [string, optional] image name,
|
174
|
+
* busyImageWidth: [number or string, optional] image width,
|
175
|
+
* busyImageHeight: [number or string, optional] image height
|
176
|
+
* }
|
177
|
+
* </pre>
|
178
|
+
*
|
179
|
+
* @private
|
180
|
+
* @param {object} objArgs Arguments object
|
181
|
+
*/
|
182
|
+
Zapatec.Transport.showBusy = function(objArgs) {
|
183
|
+
// Make sure image is not displayed yet
|
184
|
+
if (Zapatec.Transport.isBusy(objArgs)) {
|
185
|
+
return;
|
186
|
+
}
|
187
|
+
// Get container
|
188
|
+
var objContainer = objArgs.busyContainer;
|
189
|
+
if (typeof objContainer == 'string') {
|
190
|
+
objContainer = document.getElementById(objContainer);
|
191
|
+
}
|
192
|
+
if (!objContainer) {
|
193
|
+
return;
|
194
|
+
}
|
195
|
+
// Get image name and dimensions
|
196
|
+
var strImage = objArgs.busyImage;
|
197
|
+
var strImageWidth = objArgs.busyImageWidth;
|
198
|
+
var strImageHeight = objArgs.busyImageHeight;
|
199
|
+
if (typeof strImage != 'string' || !strImage.length) {
|
200
|
+
strImage = 'zpbusy.gif';
|
201
|
+
} else {
|
202
|
+
if (typeof strImageWidth == 'number' ||
|
203
|
+
(typeof strImageWidth == 'string' && /\d$/.test(strImageWidth))) {
|
204
|
+
strImageWidth += 'px';
|
205
|
+
}
|
206
|
+
if (typeof strImageHeight == 'number' ||
|
207
|
+
(typeof strImageHeight == 'string' && /\d$/.test(strImageHeight))) {
|
208
|
+
strImageHeight += 'px';
|
209
|
+
}
|
210
|
+
}
|
211
|
+
if (!strImageWidth) {
|
212
|
+
strImageWidth = '65px';
|
213
|
+
}
|
214
|
+
if (!strImageHeight) {
|
215
|
+
strImageHeight = '35px';
|
216
|
+
}
|
217
|
+
// Get path
|
218
|
+
var strPath = '';
|
219
|
+
// Check if path is specified
|
220
|
+
if (strImage.indexOf('/') < 0) {
|
221
|
+
// Use default path
|
222
|
+
strPath = Zapatec.Transport.getPath('transport.js');
|
223
|
+
}
|
224
|
+
// Form tag
|
225
|
+
var arrImgTag = [];
|
226
|
+
arrImgTag.push('<img src="');
|
227
|
+
arrImgTag.push(strPath);
|
228
|
+
arrImgTag.push(strImage);
|
229
|
+
arrImgTag.push('"');
|
230
|
+
if (strImageWidth || strImageHeight) {
|
231
|
+
arrImgTag.push(' style="');
|
232
|
+
if (strImageWidth) {
|
233
|
+
arrImgTag.push('width:');
|
234
|
+
arrImgTag.push(strImageWidth);
|
235
|
+
arrImgTag.push(';');
|
236
|
+
}
|
237
|
+
if (strImageHeight) {
|
238
|
+
arrImgTag.push('height:');
|
239
|
+
arrImgTag.push(strImageHeight);
|
240
|
+
}
|
241
|
+
arrImgTag.push('"');
|
242
|
+
}
|
243
|
+
arrImgTag.push(' />');
|
244
|
+
strImgTag = arrImgTag.join('');
|
245
|
+
// Get container dimensions
|
246
|
+
var iContainerWidth = objContainer.offsetWidth;
|
247
|
+
var iContainerHeight = objContainer.offsetHeight;
|
248
|
+
// Display image
|
249
|
+
var objBusyContainer = Zapatec.Utils.createElement('div');
|
250
|
+
objBusyContainer.style.position = 'relative';
|
251
|
+
objBusyContainer.style.zIndex = 2147483583;
|
252
|
+
var objBusy = Zapatec.Utils.createElement('div', objBusyContainer);
|
253
|
+
objBusy.style.position = 'absolute';
|
254
|
+
objBusy.innerHTML = strImgTag;
|
255
|
+
if (objContainer.firstChild) {
|
256
|
+
objContainer.insertBefore(objBusyContainer, objContainer.firstChild);
|
257
|
+
} else {
|
258
|
+
objContainer.appendChild(objBusyContainer);
|
259
|
+
}
|
260
|
+
// Move to the center of container
|
261
|
+
var iBusyWidth = objBusy.offsetWidth;
|
262
|
+
var iBusyHeight = objBusy.offsetHeight;
|
263
|
+
if (iContainerWidth > iBusyWidth) {
|
264
|
+
objBusy.style.left = objContainer.scrollLeft +
|
265
|
+
(iContainerWidth - iBusyWidth) / 2 + 'px';
|
266
|
+
}
|
267
|
+
if (iContainerHeight > iBusyHeight) {
|
268
|
+
objBusy.style.top = objContainer.scrollTop +
|
269
|
+
(iContainerHeight - iBusyHeight) / 2 + 'px';
|
270
|
+
}
|
271
|
+
};
|
272
|
+
|
273
|
+
/**
|
274
|
+
* Removes animated GIF which was put by {@link Zapatec.Transport#showBusyGif}
|
275
|
+
* from the specified div.
|
276
|
+
*
|
277
|
+
* <pre>
|
278
|
+
* Arguments object format:
|
279
|
+
* {
|
280
|
+
* busyContainer: [object or string] element where to put animated GIF,
|
281
|
+
* busyImage: [string, optional] image name
|
282
|
+
* }
|
283
|
+
* </pre>
|
284
|
+
*
|
285
|
+
* @private
|
286
|
+
* @param {object} objArgs Arguments object
|
287
|
+
*/
|
288
|
+
Zapatec.Transport.removeBusy = function(objArgs) {
|
289
|
+
// Get container
|
290
|
+
var objContainer = objArgs.busyContainer;
|
291
|
+
if (typeof objContainer == 'string') {
|
292
|
+
objContainer = document.getElementById(objContainer);
|
293
|
+
}
|
294
|
+
if (!objContainer) {
|
295
|
+
return;
|
296
|
+
}
|
297
|
+
// Make sure image is displayed
|
298
|
+
if (Zapatec.Transport.isBusy(objArgs)) {
|
299
|
+
// Remove image
|
300
|
+
objContainer.removeChild(objContainer.firstChild);
|
301
|
+
}
|
302
|
+
};
|
303
|
+
|
304
|
+
/**
|
305
|
+
* Fetches specified URL using new XMLHttpRequest object.
|
306
|
+
*
|
307
|
+
* <pre>
|
308
|
+
* Asynchronous mode is recommended because it is safer and there is no risk of
|
309
|
+
* having your script hang in case of network problem. Synchronous mode means
|
310
|
+
* that the code will hang until a response comes back.
|
311
|
+
*
|
312
|
+
* When request is completed, one of provided callback functions is called:
|
313
|
+
* onLoad on success or onError on error. In synchronous mode onLoad callback
|
314
|
+
* can be omitted. Instead use returned object.
|
315
|
+
*
|
316
|
+
* onLoad callback function receives XMLHttpRequest object as argument and may
|
317
|
+
* use its various properties like responseText, responseXML, etc.
|
318
|
+
*
|
319
|
+
* onError callback function receives following object:
|
320
|
+
* {
|
321
|
+
* errorCode: server status number (404, etc.) [number],
|
322
|
+
* errorDescription: human readable error description [string]
|
323
|
+
* }
|
324
|
+
*
|
325
|
+
* Note: Some browsers implement caching for GET requests. Caching can be
|
326
|
+
* prevented by adding 'r=' + Math.random() parameter to URL.
|
327
|
+
*
|
328
|
+
* If you use POST method, content argument should be something like
|
329
|
+
* 'var1=value1&var2=value2' with urlencoded values. If you wish to send other
|
330
|
+
* content, set appropriate contentType. E.g. 'multipart/form-data', 'text/xml',
|
331
|
+
* etc.
|
332
|
+
*
|
333
|
+
* If server response contains non-ASCII characters, server must send
|
334
|
+
* corresponding content-type header. E.g.
|
335
|
+
* "Content-type: text/plain; charset=utf-8" or
|
336
|
+
* "Content-type: text/plain; charset=windows-1251".
|
337
|
+
*
|
338
|
+
* Arguments object format:
|
339
|
+
* {
|
340
|
+
* url: [string] relative or absolute URL to fetch,
|
341
|
+
* method: [string, optional] method ('GET', 'POST', 'HEAD', 'PUT'),
|
342
|
+
* async: [boolean, optional] use asynchronous mode (default: true),
|
343
|
+
* contentType: [string, optional] content type when using POST,
|
344
|
+
* content: [string or object, optional] postable string or DOM object data
|
345
|
+
* when using POST,
|
346
|
+
* onLoad: [function, optional] function reference to call on success,
|
347
|
+
* onError: [function, optional] function reference to call on error,
|
348
|
+
* username: [string, optional] username,
|
349
|
+
* password: [string, optional] password,
|
350
|
+
* busyContainer: [object or string, optional] element or id of element where
|
351
|
+
* to put "Busy" animated GIF,
|
352
|
+
* busyImage: [string, optional] image name,
|
353
|
+
* busyImageWidth: [number or string, optional] image width,
|
354
|
+
* busyImageHeight: [number or string, optional] image height
|
355
|
+
* }
|
356
|
+
* </pre>
|
357
|
+
*
|
358
|
+
* @param {object} objArgs Arguments object
|
359
|
+
* @return In synchronous mode XMLHttpRequest object or null. In asynchronous
|
360
|
+
* mode always null.
|
361
|
+
* @type object
|
362
|
+
*/
|
363
|
+
Zapatec.Transport.fetch = function(objArgs) {
|
364
|
+
// Check arguments
|
365
|
+
if (objArgs == null || typeof objArgs != 'object') {
|
366
|
+
return null;
|
367
|
+
}
|
368
|
+
if (!objArgs.url) {
|
369
|
+
return null;
|
370
|
+
}
|
371
|
+
if (!objArgs.method) {
|
372
|
+
objArgs.method = 'GET';
|
373
|
+
}
|
374
|
+
if (typeof objArgs.async == 'undefined') {
|
375
|
+
objArgs.async = true;
|
376
|
+
}
|
377
|
+
if (!objArgs.contentType && objArgs.method.toUpperCase() == 'POST') {
|
378
|
+
objArgs.contentType = 'application/x-www-form-urlencoded';
|
379
|
+
}
|
380
|
+
if (!objArgs.content) {
|
381
|
+
objArgs.content = null;
|
382
|
+
}
|
383
|
+
if (!objArgs.onLoad) {
|
384
|
+
objArgs.onLoad = null;
|
385
|
+
}
|
386
|
+
if (!objArgs.onError) {
|
387
|
+
objArgs.onError = null;
|
388
|
+
}
|
389
|
+
// Request URL
|
390
|
+
var objRequest = Zapatec.Transport.createXmlHttpRequest();
|
391
|
+
if (objRequest == null) {
|
392
|
+
return null;
|
393
|
+
}
|
394
|
+
// Show "Busy" animated GIF
|
395
|
+
Zapatec.Transport.showBusy(objArgs);
|
396
|
+
// IE 6 calls onreadystatechange and then raises exception if local file was
|
397
|
+
// not found. This flag is used to prevent duplicate onError calls.
|
398
|
+
var boolErrorDisplayed = false;
|
399
|
+
// Onready handler
|
400
|
+
var funcOnReady = function () {
|
401
|
+
// Remove "Busy" animated GIF
|
402
|
+
Zapatec.Transport.removeBusy(objArgs);
|
403
|
+
// Process response
|
404
|
+
try {
|
405
|
+
if (objRequest.status == 200 || objRequest.status == 304 ||
|
406
|
+
(location.protocol == 'file:' && !objRequest.status)) {
|
407
|
+
// OK or found, but determined unchanged and loaded from cache
|
408
|
+
if (typeof objArgs.onLoad == 'function') {
|
409
|
+
objArgs.onLoad(objRequest);
|
410
|
+
}
|
411
|
+
} else if (!boolErrorDisplayed) {
|
412
|
+
boolErrorDisplayed = true;
|
413
|
+
// 404 Not found, etc.
|
414
|
+
Zapatec.Transport.displayError(objRequest.status,
|
415
|
+
"Error: Can't fetch " + objArgs.url + '.\n' +
|
416
|
+
(objRequest.statusText || ''),
|
417
|
+
objArgs.onError);
|
418
|
+
}
|
419
|
+
} catch (objException) {
|
420
|
+
// Firefox 1.5 raises exception on attempt to access any property of
|
421
|
+
// objRequest if URL was not found
|
422
|
+
if (!boolErrorDisplayed) {
|
423
|
+
boolErrorDisplayed = true;
|
424
|
+
if (objException.name &&
|
425
|
+
objException.name == 'NS_ERROR_NOT_AVAILABLE') {
|
426
|
+
Zapatec.Transport.displayError(0,
|
427
|
+
"Error: Can't fetch " + objArgs.url + '.\nFile not found.',
|
428
|
+
objArgs.onError);
|
429
|
+
} else {
|
430
|
+
Zapatec.Transport.displayError(0,
|
431
|
+
"Error: Can't fetch " + objArgs.url + '.\n' +
|
432
|
+
(objException.message || ''),
|
433
|
+
objArgs.onError);
|
434
|
+
}
|
435
|
+
}
|
436
|
+
};
|
437
|
+
};
|
438
|
+
try {
|
439
|
+
// Open request
|
440
|
+
if (typeof objArgs.username != 'undefined' &&
|
441
|
+
typeof objArgs.password != 'undefined') {
|
442
|
+
objRequest.open(objArgs.method, objArgs.url, objArgs.async,
|
443
|
+
objArgs.username, objArgs.password);
|
444
|
+
} else {
|
445
|
+
objRequest.open(objArgs.method, objArgs.url, objArgs.async);
|
446
|
+
}
|
447
|
+
// Prevent duplicate funcOnReady call in synchronous mode
|
448
|
+
if (objArgs.async) {
|
449
|
+
// Set onreadystatechange handler
|
450
|
+
objRequest.onreadystatechange = function () {
|
451
|
+
if (objRequest.readyState == 4) {
|
452
|
+
// Request complete
|
453
|
+
funcOnReady();
|
454
|
+
// Prevent memory leak
|
455
|
+
objRequest.onreadystatechange = {};
|
456
|
+
}
|
457
|
+
};
|
458
|
+
}
|
459
|
+
// Set content type if needed
|
460
|
+
if (objArgs.contentType) {
|
461
|
+
objRequest.setRequestHeader('Content-Type', objArgs.contentType);
|
462
|
+
}
|
463
|
+
// Send request
|
464
|
+
objRequest.send(objArgs.content);
|
465
|
+
// In synchronous mode the result is ready on the next line
|
466
|
+
if (!objArgs.async) {
|
467
|
+
funcOnReady();
|
468
|
+
return objRequest;
|
469
|
+
}
|
470
|
+
} catch (objException) {
|
471
|
+
// Remove "Busy" animated GIF
|
472
|
+
Zapatec.Transport.removeBusy(objArgs);
|
473
|
+
// Process error
|
474
|
+
if (!boolErrorDisplayed) {
|
475
|
+
boolErrorDisplayed = true;
|
476
|
+
if (objException.name &&
|
477
|
+
objException.name == 'NS_ERROR_FILE_NOT_FOUND') {
|
478
|
+
Zapatec.Transport.displayError(0,
|
479
|
+
"Error: Can't fetch " + objArgs.url + '.\nFile not found.',
|
480
|
+
objArgs.onError);
|
481
|
+
} else {
|
482
|
+
Zapatec.Transport.displayError(0,
|
483
|
+
"Error: Can't fetch " + objArgs.url + '.\n' +
|
484
|
+
(objException.message || ''),
|
485
|
+
objArgs.onError);
|
486
|
+
}
|
487
|
+
}
|
488
|
+
};
|
489
|
+
return null;
|
490
|
+
};
|
491
|
+
|
492
|
+
/**
|
493
|
+
* Parses HTML fragment into HTMLElement object.
|
494
|
+
*
|
495
|
+
* @param {string} strHtml HTML fragment
|
496
|
+
* @return Div element which contains parsed HTML fragment
|
497
|
+
* @type object
|
498
|
+
*/
|
499
|
+
Zapatec.Transport.parseHtml = function(strHtml) {
|
500
|
+
// Convert to string
|
501
|
+
strHtml += '';
|
502
|
+
// Remove leading whitespace characters because Firefox and Opera don't parse
|
503
|
+
// fragment that starts from whitespace character
|
504
|
+
strHtml = strHtml.replace(/^\s+/g, '');
|
505
|
+
// Create temporaty container
|
506
|
+
var objTempContainer = null;
|
507
|
+
if (document.createElementNS) {
|
508
|
+
// use the XHTML namespace
|
509
|
+
objTempContainer =
|
510
|
+
document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
|
511
|
+
} else {
|
512
|
+
objTempContainer = document.createElement('div');
|
513
|
+
}
|
514
|
+
// Parse HTML fragment
|
515
|
+
objTempContainer.innerHTML = strHtml;
|
516
|
+
// Return container element
|
517
|
+
return objTempContainer;
|
518
|
+
};
|
519
|
+
|
520
|
+
/**
|
521
|
+
* Evaluates javascript in global scope.
|
522
|
+
*
|
523
|
+
* <p><b>
|
524
|
+
* Note: Global variables must be declared without "var" keyword. Otherwise
|
525
|
+
* they will be ignored by Safari.
|
526
|
+
* </b></p>
|
527
|
+
*
|
528
|
+
* @param {string} strScript Script to evaluate
|
529
|
+
*/
|
530
|
+
Zapatec.Transport.evalGlobalScope = function(strScript) {
|
531
|
+
if (typeof strScript != 'string' || !strScript.match(/\S/)) {
|
532
|
+
return;
|
533
|
+
}
|
534
|
+
if (window.execScript) {
|
535
|
+
// IE
|
536
|
+
window.execScript(strScript, 'javascript');
|
537
|
+
} else if (window.eval) {
|
538
|
+
// Others
|
539
|
+
window.eval(strScript);
|
540
|
+
/*
|
541
|
+
This should never be reached
|
542
|
+
} else {
|
543
|
+
var funcScript = new Function(strScript);
|
544
|
+
funcScript.call(window);
|
545
|
+
*/
|
546
|
+
}
|
547
|
+
};
|
548
|
+
|
549
|
+
/**
|
550
|
+
* Assigns passed HTML fragment to the specified element's innerHTML property
|
551
|
+
* and evaluates in global scope javascripts found in the fragment.
|
552
|
+
*
|
553
|
+
* <pre>
|
554
|
+
* Arguments object format:
|
555
|
+
* {
|
556
|
+
* html: [string] HTML fragment,
|
557
|
+
* container: [object or string, optional] element or id of element to put
|
558
|
+
* HTML fragment into
|
559
|
+
* }
|
560
|
+
* </pre>
|
561
|
+
*
|
562
|
+
* <p><b>
|
563
|
+
* Note: Scripts are executed after HTML fragment is assigned to innerHTML.
|
564
|
+
* If external scripts are used, they are loaded asynchronously and execution
|
565
|
+
* sequence is not preserved.
|
566
|
+
* </b></p>
|
567
|
+
*
|
568
|
+
* <p><b>
|
569
|
+
* Note: Global variables must be declared without "var" keyword. Otherwise
|
570
|
+
* they will be ignored by Safari.
|
571
|
+
* </b></p>
|
572
|
+
*
|
573
|
+
* @param {object} objArgs Arguments object
|
574
|
+
*/
|
575
|
+
Zapatec.Transport.setInnerHtml = function(objArgs) {
|
576
|
+
// Check arguments
|
577
|
+
if (!objArgs || typeof objArgs.html != 'string') {
|
578
|
+
return;
|
579
|
+
}
|
580
|
+
var strHtml = objArgs.html;
|
581
|
+
// Get container
|
582
|
+
var objContainer = null;
|
583
|
+
if (typeof objArgs.container == 'string') {
|
584
|
+
objContainer = document.getElementById(objArgs.container);
|
585
|
+
} else if (typeof objArgs.container == 'object') {
|
586
|
+
objContainer = objArgs.container;
|
587
|
+
}
|
588
|
+
// Extract javascripts
|
589
|
+
var arrScripts = [];
|
590
|
+
if (strHtml.match(/<\s*\/\s*script\s*>/i)) {
|
591
|
+
// Split whole string by </script>
|
592
|
+
var arrTokens = strHtml.split(/<\s*\/\s*script\s*>/i);
|
593
|
+
var arrHtml = [];
|
594
|
+
for (var iToken = arrTokens.length - 1; iToken >= 0; iToken--) {
|
595
|
+
var strToken = arrTokens[iToken];
|
596
|
+
if (strToken.match(/\S/)) {
|
597
|
+
// Search <script ... > in the middle of each token
|
598
|
+
var arrMatch = strToken.match(/<\s*script([^>]*)>/i);
|
599
|
+
if (arrMatch) {
|
600
|
+
// Separate HTML from javascript
|
601
|
+
var arrCouple = strToken.split(/<\s*script[^>]*>/i);
|
602
|
+
// IE doesn't put empty tokens into the array
|
603
|
+
while (arrCouple.length < 2) {
|
604
|
+
if (strToken.match(/^<\s*script[^>]*>/i)) {
|
605
|
+
// HTML part is absent
|
606
|
+
arrCouple.unshift('');
|
607
|
+
} else {
|
608
|
+
// javascript part is absent
|
609
|
+
arrCouple.push('');
|
610
|
+
}
|
611
|
+
}
|
612
|
+
// Save HTML fragment
|
613
|
+
arrHtml.unshift(arrCouple[0]);
|
614
|
+
// Get script attributes
|
615
|
+
var strAttrs = arrMatch[1];
|
616
|
+
// Get script text
|
617
|
+
var srtScript = arrCouple[1];
|
618
|
+
// Ignore script text if "src" attribute is present
|
619
|
+
if (strAttrs.match(/\s+src\s*=/i)) {
|
620
|
+
srtScript = '';
|
621
|
+
} else {
|
622
|
+
// Fix functions: function aaa() -> aaa = function()
|
623
|
+
srtScript = srtScript.replace(/function\s+([^(]+)/g, '$1=function');
|
624
|
+
}
|
625
|
+
arrScripts.push([strAttrs, srtScript]);
|
626
|
+
} else if (iToken < arrTokens.length - 1) {
|
627
|
+
// On error assume this token is a part of previous token
|
628
|
+
arrTokens[iToken - 1] += '</script>' + strToken;
|
629
|
+
} else {
|
630
|
+
// If this is last token, assume it is HTML fragment
|
631
|
+
arrHtml.unshift(strToken);
|
632
|
+
}
|
633
|
+
} else {
|
634
|
+
// Empty token
|
635
|
+
arrHtml.unshift(strToken);
|
636
|
+
}
|
637
|
+
}
|
638
|
+
// Get HTML part
|
639
|
+
strHtml = arrHtml.join('');
|
640
|
+
}
|
641
|
+
// Set inner HTML
|
642
|
+
if (objContainer) {
|
643
|
+
// Opera hack
|
644
|
+
if (window.opera) {
|
645
|
+
// Without this line Opera will not form correct DOM structure if HTML
|
646
|
+
// fragment contains forms
|
647
|
+
objContainer.innerHTML = '<form></form>';
|
648
|
+
}
|
649
|
+
objContainer.innerHTML = strHtml;
|
650
|
+
}
|
651
|
+
// Evaluate javascripts
|
652
|
+
for (var iScript = 0; iScript < arrScripts.length; iScript++) {
|
653
|
+
if (arrScripts[iScript][1].length) {
|
654
|
+
// Evaluate in global scope
|
655
|
+
Zapatec.Transport.evalGlobalScope(arrScripts[iScript][1]);
|
656
|
+
}
|
657
|
+
// Load external script
|
658
|
+
var strAttrs = arrScripts[iScript][0];
|
659
|
+
strAttrs = strAttrs.replace(/\s+/g, ' ').replace(/^\s/, '')
|
660
|
+
.replace(/\s$/, '').replace(/ = /g, '=');
|
661
|
+
if (strAttrs.indexOf('src=') >= 0) {
|
662
|
+
// Get container
|
663
|
+
var objContainer = document.body;
|
664
|
+
if (!objContainer) {
|
665
|
+
objContainer = document.getElementsByTagName('head')[0];
|
666
|
+
if (!objContainer) {
|
667
|
+
objContainer = document;
|
668
|
+
}
|
669
|
+
}
|
670
|
+
// Get attributes
|
671
|
+
var arrAttrs = strAttrs.split(' ');
|
672
|
+
// Load script
|
673
|
+
var objScript = Zapatec.Utils.createElement('script');
|
674
|
+
for (var iAttr = 0; iAttr < arrAttrs.length; iAttr++) {
|
675
|
+
var arrAttr = arrAttrs[iAttr].split('=');
|
676
|
+
if (arrAttr.length > 1) {
|
677
|
+
objScript.setAttribute(arrAttr[0],
|
678
|
+
arrAttr[1].match(/^[\s|"|']*([\s|\S]*[^'|"])[\s|"|']*$/)[1]);
|
679
|
+
} else {
|
680
|
+
objScript.setAttribute(arrAttr[0], arrAttr[0]);
|
681
|
+
}
|
682
|
+
}
|
683
|
+
// It's important for Safari to assign attributes before appending
|
684
|
+
objContainer.appendChild(objScript);
|
685
|
+
}
|
686
|
+
}
|
687
|
+
};
|
688
|
+
|
689
|
+
/**
|
690
|
+
* Fetches and parses XML document from the specified URL.
|
691
|
+
*
|
692
|
+
* <pre>
|
693
|
+
* When XML document is fetched and parsed, one of provided callback functions
|
694
|
+
* is called: onLoad on success or onError on error. In synchronous mode onLoad
|
695
|
+
* callback can be omitted. Instead use returned object.
|
696
|
+
*
|
697
|
+
* onLoad callback function receives XMLDocument object as argument and may use
|
698
|
+
* its documentElement and other properties.
|
699
|
+
*
|
700
|
+
* onError callback function receives following object:
|
701
|
+
* {
|
702
|
+
* errorCode: error code [number],
|
703
|
+
* errorDescription: human readable error description [string]
|
704
|
+
* }
|
705
|
+
* Error code will be 0 unless Zapatec.Transport.fetch was used to fetch URL
|
706
|
+
* and there was a problem during fetching.
|
707
|
+
*
|
708
|
+
* If method argument is not defined, more efficient XMLDOM in IE and
|
709
|
+
* document.implementation.createDocument in Mozilla will be used to fetch
|
710
|
+
* and parse document. Otherwise Zapatec.Transport.fetch will be used to fetch
|
711
|
+
* document and Zapatec.Transport.parseXml to parse.
|
712
|
+
*
|
713
|
+
* Note: Some browsers implement caching for GET requests. Caching can be
|
714
|
+
* prevented by adding 'r=' + Math.random() parameter to URL.
|
715
|
+
*
|
716
|
+
* If you use POST method, content argument should be something like
|
717
|
+
* 'var1=value1&var2=value'. If you wish to send other content, set appropriate
|
718
|
+
* contentType. E.g. to send XML string, you should set contentType: 'text/xml'.
|
719
|
+
*
|
720
|
+
* If server response contains non-ASCII characters, encoding must be specified.
|
721
|
+
* E.g. <?xml version="1.0" encoding="utf-8"?> or
|
722
|
+
* <?xml version="1.0" encoding="windows-1251"?>.
|
723
|
+
*
|
724
|
+
* If server response contains non-ASCII characters, server must send
|
725
|
+
* corresponding content-type header. E.g.
|
726
|
+
* "Content-type: text/xml; charset=utf-8" or
|
727
|
+
* "Content-type: text/xml; charset=windows-1251".
|
728
|
+
*
|
729
|
+
* Arguments object format:
|
730
|
+
* {
|
731
|
+
* url: [string] relative or absolute URL to fetch,
|
732
|
+
* method: [string, optional] method ('GET', 'POST', 'HEAD', 'PUT'),
|
733
|
+
* async: [boolean, optional] use asynchronous mode (default: true),
|
734
|
+
* contentType: [string, optional] content type when using POST,
|
735
|
+
* content: [string or object, optional] postable string or DOM object data
|
736
|
+
* when using POST,
|
737
|
+
* onLoad: [function, optional] function reference to call on success,
|
738
|
+
* onError: [function, optional] function reference to call on error,
|
739
|
+
* username: [string, optional] username,
|
740
|
+
* password: [string, optional] password,
|
741
|
+
* busyContainer: [object or string, optional] element or id of element where
|
742
|
+
* to put "Busy" animated GIF,
|
743
|
+
* busyImage: [string, optional] image name,
|
744
|
+
* busyImageWidth: [number or string, optional] image width,
|
745
|
+
* busyImageHeight: [number or string, optional] image height
|
746
|
+
* }
|
747
|
+
* </pre>
|
748
|
+
*
|
749
|
+
* @param {object} objArgs Arguments object
|
750
|
+
* @return In synchronous mode XMLDocument object or null. In asynchronous mode
|
751
|
+
* always null.
|
752
|
+
* @type object
|
753
|
+
*/
|
754
|
+
Zapatec.Transport.fetchXmlDoc = function(objArgs) {
|
755
|
+
// Check arguments
|
756
|
+
if (objArgs == null || typeof objArgs != 'object') {
|
757
|
+
return null;
|
758
|
+
}
|
759
|
+
if (!objArgs.url) {
|
760
|
+
return null;
|
761
|
+
}
|
762
|
+
if (typeof objArgs.async == 'undefined') {
|
763
|
+
objArgs.async = true;
|
764
|
+
}
|
765
|
+
if (!objArgs.onLoad) {
|
766
|
+
objArgs.onLoad = null;
|
767
|
+
}
|
768
|
+
if (!objArgs.onError) {
|
769
|
+
objArgs.onError = null;
|
770
|
+
}
|
771
|
+
// Try more efficient methods first
|
772
|
+
if (!objArgs.method && typeof objArgs.username == 'undefined' &&
|
773
|
+
typeof objArgs.password == 'undefined') {
|
774
|
+
if (document.implementation && document.implementation.createDocument) {
|
775
|
+
// Mozilla
|
776
|
+
var objDocument = null;
|
777
|
+
|
778
|
+
if (!objArgs.reliable) {
|
779
|
+
objArgs.reliable = false;
|
780
|
+
}
|
781
|
+
// Form argument for fetch
|
782
|
+
var objFetchArgs = {};
|
783
|
+
for (var strKey in objArgs) {
|
784
|
+
objFetchArgs[strKey] = objArgs[strKey];
|
785
|
+
}
|
786
|
+
// Prevent duplicate parseXml call in synchronous mode
|
787
|
+
if (objArgs.async) {
|
788
|
+
objFetchArgs.onLoad = function(objRequest) {
|
789
|
+
// Prevent onload being called more than once
|
790
|
+
objFetchArgs.onLoad = null;
|
791
|
+
|
792
|
+
// Parse xml response string
|
793
|
+
var parser = new DOMParser();
|
794
|
+
objDocument = parser.parseFromString(objRequest.responseText, "text/xml");
|
795
|
+
|
796
|
+
// Remove "Busy" animated GIF
|
797
|
+
Zapatec.Transport.removeBusy(objArgs);
|
798
|
+
// Process response
|
799
|
+
Zapatec.Transport.onXmlDocLoad(objDocument, objArgs.onLoad,
|
800
|
+
objArgs.onError);
|
801
|
+
};
|
802
|
+
} else {
|
803
|
+
objFetchArgs.onLoad = null;
|
804
|
+
}
|
805
|
+
// Fetch URL
|
806
|
+
var objRequest = Zapatec.Transport.fetch(objFetchArgs);
|
807
|
+
// In synchronous mode the result is ready on the next line
|
808
|
+
if (!objArgs.async && objRequest) {
|
809
|
+
// Parse xml response string
|
810
|
+
var parser = new DOMParser();
|
811
|
+
objDocument = parser.parseFromString(objRequest.responseText, "text/xml");
|
812
|
+
|
813
|
+
// Remove "Busy" animated GIF
|
814
|
+
Zapatec.Transport.removeBusy(objArgs);
|
815
|
+
// Process response
|
816
|
+
Zapatec.Transport.onXmlDocLoad(objDocument, objArgs.onLoad,
|
817
|
+
objArgs.onError);
|
818
|
+
|
819
|
+
return objDocument;
|
820
|
+
}
|
821
|
+
}
|
822
|
+
if (typeof ActiveXObject != 'undefined') {
|
823
|
+
// IE
|
824
|
+
// Show "Busy" animated GIF
|
825
|
+
Zapatec.Transport.showBusy(objArgs);
|
826
|
+
// Load document
|
827
|
+
try {
|
828
|
+
var objDocument = new ActiveXObject(Zapatec.Transport.XMLDOM);
|
829
|
+
objDocument.async = objArgs.async;
|
830
|
+
// Prevent duplicate onXmlDocLoad call in synchronous mode
|
831
|
+
if (objArgs.async) {
|
832
|
+
objDocument.onreadystatechange = function () {
|
833
|
+
if (objDocument.readyState == 4) {
|
834
|
+
// Remove "Busy" animated GIF
|
835
|
+
Zapatec.Transport.removeBusy(objArgs);
|
836
|
+
// Process response
|
837
|
+
Zapatec.Transport.onXmlDocLoad(objDocument, objArgs.onLoad,
|
838
|
+
objArgs.onError);
|
839
|
+
// Prevent memory leak
|
840
|
+
objDocument.onreadystatechange = {};
|
841
|
+
}
|
842
|
+
};
|
843
|
+
}
|
844
|
+
objDocument.load(objArgs.url);
|
845
|
+
// In synchronous mode the result is ready on the next line
|
846
|
+
if (!objArgs.async) {
|
847
|
+
// Remove "Busy" animated GIF
|
848
|
+
Zapatec.Transport.removeBusy(objArgs);
|
849
|
+
// Process response
|
850
|
+
Zapatec.Transport.onXmlDocLoad(objDocument, objArgs.onLoad,
|
851
|
+
objArgs.onError);
|
852
|
+
return objDocument;
|
853
|
+
}
|
854
|
+
return null;
|
855
|
+
} catch (objException) {
|
856
|
+
// Remove "Busy" animated GIF
|
857
|
+
Zapatec.Transport.removeBusy(objArgs);
|
858
|
+
};
|
859
|
+
}
|
860
|
+
}
|
861
|
+
// Try XMLHttpRequest
|
862
|
+
// Form argument for fetch
|
863
|
+
var objFetchArgs = {};
|
864
|
+
for (var strKey in objArgs) {
|
865
|
+
objFetchArgs[strKey] = objArgs[strKey];
|
866
|
+
}
|
867
|
+
// Prevent duplicate parseXml call in synchronous mode
|
868
|
+
if (objArgs.async) {
|
869
|
+
objFetchArgs.onLoad = function(objRequest) {
|
870
|
+
Zapatec.Transport.parseXml({
|
871
|
+
strXml: objRequest.responseText,
|
872
|
+
onLoad: objArgs.onLoad,
|
873
|
+
onError: objArgs.onError
|
874
|
+
});
|
875
|
+
};
|
876
|
+
} else {
|
877
|
+
objFetchArgs.onLoad = null;
|
878
|
+
}
|
879
|
+
// Fetch URL
|
880
|
+
var objRequest = Zapatec.Transport.fetch(objFetchArgs);
|
881
|
+
// In synchronous mode the result is ready on the next line
|
882
|
+
if (!objArgs.async && objRequest) {
|
883
|
+
return Zapatec.Transport.parseXml({
|
884
|
+
strXml: objRequest.responseText,
|
885
|
+
onLoad: objArgs.onLoad,
|
886
|
+
onError: objArgs.onError
|
887
|
+
});
|
888
|
+
}
|
889
|
+
return null;
|
890
|
+
};
|
891
|
+
|
892
|
+
/**
|
893
|
+
* Parses XML string into XMLDocument object.
|
894
|
+
*
|
895
|
+
* <pre>
|
896
|
+
* When XML string is parsed, one of provided callback functions is called:
|
897
|
+
* onLoad on success or onError on error. In synchronous mode onLoad callback
|
898
|
+
* can be omitted. Instead use returned object.
|
899
|
+
*
|
900
|
+
* onLoad callback function receives XMLDocument object as argument and may use
|
901
|
+
* its documentElement and other properties.
|
902
|
+
*
|
903
|
+
* onError callback function receives following object:
|
904
|
+
* {
|
905
|
+
* errorCode: error code [number],
|
906
|
+
* errorDescription: human readable error description [string]
|
907
|
+
* }
|
908
|
+
* Error code will be always 0.
|
909
|
+
*
|
910
|
+
* Returns XMLDocument object, so onLoad callback function is optional.
|
911
|
+
* Returned value and its documentElement property should be checked before
|
912
|
+
* use because they can be null or undefined.
|
913
|
+
*
|
914
|
+
* If XML string contains non-ASCII characters, encoding must be specified.
|
915
|
+
* E.g. <?xml version="1.0" encoding="utf-8"?> or
|
916
|
+
* <?xml version="1.0" encoding="windows-1251"?>.
|
917
|
+
*
|
918
|
+
* Arguments object format:
|
919
|
+
* {
|
920
|
+
* strXml: XML string to parse [string],
|
921
|
+
* onLoad: function reference to call on success [function] (optional),
|
922
|
+
* onError: function reference to call on error [function] (optional)
|
923
|
+
* }
|
924
|
+
* </pre>
|
925
|
+
*
|
926
|
+
* @param {object} objArgs Arguments object
|
927
|
+
* @return XMLDocument object or null
|
928
|
+
* @type object
|
929
|
+
*/
|
930
|
+
Zapatec.Transport.parseXml = function(objArgs) {
|
931
|
+
if (objArgs == null || typeof objArgs != 'object') {
|
932
|
+
return null;
|
933
|
+
}
|
934
|
+
if (!objArgs.strXml) {
|
935
|
+
return null;
|
936
|
+
}
|
937
|
+
if (!objArgs.onLoad) {
|
938
|
+
objArgs.onLoad = null;
|
939
|
+
}
|
940
|
+
if (!objArgs.onError) {
|
941
|
+
objArgs.onError = null;
|
942
|
+
}
|
943
|
+
if (window.DOMParser) {
|
944
|
+
// Mozilla
|
945
|
+
try {
|
946
|
+
var objDocument = (new DOMParser()).parseFromString(objArgs.strXml,
|
947
|
+
'text/xml');
|
948
|
+
Zapatec.Transport.onXmlDocLoad(objDocument, objArgs.onLoad,
|
949
|
+
objArgs.onError);
|
950
|
+
return objDocument;
|
951
|
+
} catch (objException) {
|
952
|
+
Zapatec.Transport.displayError(0,
|
953
|
+
"Error: Can't parse.\n" +
|
954
|
+
'String does not appear to be a valid XML fragment.',
|
955
|
+
objArgs.onError);
|
956
|
+
};
|
957
|
+
return null;
|
958
|
+
}
|
959
|
+
if (typeof ActiveXObject != 'undefined') {
|
960
|
+
// IE
|
961
|
+
try {
|
962
|
+
var objDocument = new ActiveXObject(Zapatec.Transport.XMLDOM);
|
963
|
+
objDocument.loadXML(objArgs.strXml);
|
964
|
+
Zapatec.Transport.onXmlDocLoad(objDocument, objArgs.onLoad,
|
965
|
+
objArgs.onError);
|
966
|
+
return objDocument;
|
967
|
+
} catch (objException) {};
|
968
|
+
}
|
969
|
+
return null;
|
970
|
+
};
|
971
|
+
|
972
|
+
/**
|
973
|
+
* Checks if there were errors during XML document fetching and parsing and
|
974
|
+
* calls onLoad or onError callback function correspondingly.
|
975
|
+
*
|
976
|
+
* @private
|
977
|
+
* @param {object} objDocument XMLDocument object
|
978
|
+
* @param {function} onLoad Callback function provided by user
|
979
|
+
* @param {function} onError Callback function provided by user
|
980
|
+
*/
|
981
|
+
Zapatec.Transport.onXmlDocLoad = function(objDocument, onLoad, onError) {
|
982
|
+
var strError = null;
|
983
|
+
if (objDocument.parseError) {
|
984
|
+
// Parsing error in IE
|
985
|
+
strError = objDocument.parseError.reason;
|
986
|
+
if (objDocument.parseError.srcText) {
|
987
|
+
strError += 'Location: ' + objDocument.parseError.url +
|
988
|
+
'\nLine number ' + objDocument.parseError.line + ', column ' +
|
989
|
+
objDocument.parseError.linepos + ':\n' +
|
990
|
+
objDocument.parseError.srcText + '\n';
|
991
|
+
}
|
992
|
+
} else if (objDocument.documentElement &&
|
993
|
+
objDocument.documentElement.tagName == 'parsererror') {
|
994
|
+
// If an error is caused while parsing, Mozilla doesn't throw an exception.
|
995
|
+
// Instead, it creates an XML string containing the details of the error:
|
996
|
+
// <parsererror xmlns="http://www.w3.org/1999/xhtml">XML Parsing Error: ...
|
997
|
+
// Check if strings has been generated.
|
998
|
+
strError = objDocument.documentElement.firstChild.data + '\n' +
|
999
|
+
objDocument.documentElement.firstChild.nextSibling.firstChild.data;
|
1000
|
+
} else if (!objDocument.documentElement) {
|
1001
|
+
strError = 'String does not appear to be a valid XML fragment.';
|
1002
|
+
}
|
1003
|
+
if (strError) {
|
1004
|
+
// Parsing error
|
1005
|
+
Zapatec.Transport.displayError(0,
|
1006
|
+
"Error: Can't parse.\n" + strError,
|
1007
|
+
onError);
|
1008
|
+
} else {
|
1009
|
+
// Success
|
1010
|
+
if (typeof onLoad == 'function') {
|
1011
|
+
onLoad(objDocument);
|
1012
|
+
}
|
1013
|
+
}
|
1014
|
+
};
|
1015
|
+
|
1016
|
+
/**
|
1017
|
+
* Serializes XMLDocument object into XML string.
|
1018
|
+
*
|
1019
|
+
* @param {object} objDocument XMLDocument object
|
1020
|
+
* @return XML string
|
1021
|
+
* @type string
|
1022
|
+
*/
|
1023
|
+
Zapatec.Transport.serializeXmlDoc = function(objDocument) {
|
1024
|
+
if (window.XMLSerializer) {
|
1025
|
+
// Mozilla
|
1026
|
+
return (new XMLSerializer).serializeToString(objDocument);
|
1027
|
+
}
|
1028
|
+
if (objDocument.xml) {
|
1029
|
+
// IE
|
1030
|
+
return objDocument.xml;
|
1031
|
+
}
|
1032
|
+
};
|
1033
|
+
|
1034
|
+
/**
|
1035
|
+
* Fetches and parses JSON object from the specified URL.
|
1036
|
+
*
|
1037
|
+
* <pre>
|
1038
|
+
* When JSON object is fetched and parsed, one of provided callback functions
|
1039
|
+
* is called: onLoad on success or onError on error. In synchronous mode onLoad
|
1040
|
+
* callback can be omitted. Instead use returned object.
|
1041
|
+
*
|
1042
|
+
* onLoad callback function receives JSON object as argument.
|
1043
|
+
*
|
1044
|
+
* onError callback function receives following object:
|
1045
|
+
* {
|
1046
|
+
* errorCode: error code [number],
|
1047
|
+
* errorDescription: human readable error description [string]
|
1048
|
+
* }
|
1049
|
+
* Error code will be 0 unless there was a problem during fetching.
|
1050
|
+
*
|
1051
|
+
* Note: Some browsers implement caching for GET requests. Caching can be
|
1052
|
+
* prevented by adding 'r=' + Math.random() parameter to URL.
|
1053
|
+
*
|
1054
|
+
* If you use POST method, content argument should be something like
|
1055
|
+
* 'var1=value1&var2=value'. If you wish to send other content, set appropriate
|
1056
|
+
* contentType. E.g. to send XML string, you should set contentType: 'text/xml'.
|
1057
|
+
*
|
1058
|
+
* If server response contains non-ASCII characters, server must send
|
1059
|
+
* corresponding content-type header. E.g.
|
1060
|
+
* "Content-type: text/plain; charset=utf-8" or
|
1061
|
+
* "Content-type: text/plain; charset=windows-1251".
|
1062
|
+
*
|
1063
|
+
* Arguments object format:
|
1064
|
+
* {
|
1065
|
+
* url: [string] relative or absolute URL to fetch,
|
1066
|
+
* reliable: [boolean, optional] false (string will be parsed) or true
|
1067
|
+
* (evaluated) (default: false),
|
1068
|
+
* method: [string, optional] method ('GET', 'POST', 'HEAD', 'PUT'),
|
1069
|
+
* async: [boolean, optional] use asynchronous mode (default: true),
|
1070
|
+
* contentType: [string, optional] content type when using POST,
|
1071
|
+
* content: [string or object, optional] postable string or DOM object data
|
1072
|
+
* when using POST,
|
1073
|
+
* onLoad: [function, optional] function reference to call on success,
|
1074
|
+
* onError: [function, optional] function reference to call on error,
|
1075
|
+
* username: [string, optional] username,
|
1076
|
+
* password: [string, optional] password,
|
1077
|
+
* busyContainer: [object or string, optional] element or id of element where
|
1078
|
+
* to put "Busy" animated GIF,
|
1079
|
+
* busyImage: [string, optional] image name,
|
1080
|
+
* busyImageWidth: [number or string, optional] image width,
|
1081
|
+
* busyImageHeight: [number or string, optional] image height
|
1082
|
+
* }
|
1083
|
+
* </pre>
|
1084
|
+
*
|
1085
|
+
* @param {object} objArgs Arguments object
|
1086
|
+
* @return In synchronous mode JSON object or null. In asynchronous mode always
|
1087
|
+
* null.
|
1088
|
+
* @type object
|
1089
|
+
*/
|
1090
|
+
Zapatec.Transport.fetchJsonObj = function(objArgs) {
|
1091
|
+
// Check arguments
|
1092
|
+
if (objArgs == null || typeof objArgs != 'object') {
|
1093
|
+
return null;
|
1094
|
+
}
|
1095
|
+
if (!objArgs.url) {
|
1096
|
+
return null;
|
1097
|
+
}
|
1098
|
+
if (typeof objArgs.async == 'undefined') {
|
1099
|
+
objArgs.async = true;
|
1100
|
+
}
|
1101
|
+
if (!objArgs.reliable) {
|
1102
|
+
objArgs.reliable = false;
|
1103
|
+
}
|
1104
|
+
// Form argument for fetch
|
1105
|
+
var objFetchArgs = {};
|
1106
|
+
for (var strKey in objArgs) {
|
1107
|
+
objFetchArgs[strKey] = objArgs[strKey];
|
1108
|
+
}
|
1109
|
+
// Prevent duplicate parseXml call in synchronous mode
|
1110
|
+
if (objArgs.async) {
|
1111
|
+
objFetchArgs.onLoad = function(objRequest) {
|
1112
|
+
Zapatec.Transport.parseJson({
|
1113
|
+
strJson: objRequest.responseText,
|
1114
|
+
reliable: objArgs.reliable,
|
1115
|
+
onLoad: objArgs.onLoad,
|
1116
|
+
onError: objArgs.onError
|
1117
|
+
});
|
1118
|
+
};
|
1119
|
+
} else {
|
1120
|
+
objFetchArgs.onLoad = null;
|
1121
|
+
}
|
1122
|
+
// Fetch URL
|
1123
|
+
var objRequest = Zapatec.Transport.fetch(objFetchArgs);
|
1124
|
+
// In synchronous mode the result is ready on the next line
|
1125
|
+
if (!objArgs.async && objRequest) {
|
1126
|
+
return Zapatec.Transport.parseJson({
|
1127
|
+
strJson: objRequest.responseText,
|
1128
|
+
reliable: objArgs.reliable,
|
1129
|
+
onLoad: objArgs.onLoad,
|
1130
|
+
onError: objArgs.onError
|
1131
|
+
});
|
1132
|
+
}
|
1133
|
+
return null;
|
1134
|
+
};
|
1135
|
+
|
1136
|
+
/**
|
1137
|
+
* Parses JSON string into object.
|
1138
|
+
*
|
1139
|
+
* <pre>
|
1140
|
+
* When JSON string is parsed, one of provided callback functions is called:
|
1141
|
+
* onLoad on success or onError on error.
|
1142
|
+
*
|
1143
|
+
* onLoad callback function receives JSON object as argument.
|
1144
|
+
*
|
1145
|
+
* onError callback function receives following object:
|
1146
|
+
* {
|
1147
|
+
* errorCode: error code [number],
|
1148
|
+
* errorDescription: human readable error description [string]
|
1149
|
+
* }
|
1150
|
+
* Error code will be always 0.
|
1151
|
+
*
|
1152
|
+
* Returns JSON object, so onLoad callback function is optional.
|
1153
|
+
* Returned value should be checked before use because it can be null.
|
1154
|
+
*
|
1155
|
+
* Arguments object format:
|
1156
|
+
* {
|
1157
|
+
* strJson: JSON string to parse [string],
|
1158
|
+
* reliable: false (string will be parsed) or true (evaluated) [boolean]
|
1159
|
+
* (optional, false by default),
|
1160
|
+
* onLoad: function reference to call on success [function] (optional),
|
1161
|
+
* onError: function reference to call on error [function] (optional)
|
1162
|
+
* }
|
1163
|
+
* </pre>
|
1164
|
+
*
|
1165
|
+
* @param {object} objArgs Arguments object
|
1166
|
+
* @return JSON object or null
|
1167
|
+
* @type object
|
1168
|
+
*/
|
1169
|
+
Zapatec.Transport.parseJson = function(objArgs) {
|
1170
|
+
if (objArgs == null || typeof objArgs != 'object') {
|
1171
|
+
return null;
|
1172
|
+
}
|
1173
|
+
if (!objArgs.reliable) {
|
1174
|
+
objArgs.reliable = false;
|
1175
|
+
}
|
1176
|
+
if (!objArgs.onLoad) {
|
1177
|
+
objArgs.onLoad = null;
|
1178
|
+
}
|
1179
|
+
if (!objArgs.onError) {
|
1180
|
+
objArgs.onError = null;
|
1181
|
+
}
|
1182
|
+
var objJson = null;
|
1183
|
+
try {
|
1184
|
+
if (objArgs.reliable) {
|
1185
|
+
if (objArgs.strJson) {
|
1186
|
+
objJson = eval('(' + objArgs.strJson + ')');
|
1187
|
+
}
|
1188
|
+
} else {
|
1189
|
+
objJson = Zapatec.Transport.parseJsonStr(objArgs.strJson);
|
1190
|
+
}
|
1191
|
+
} catch (objException) {
|
1192
|
+
var strError =
|
1193
|
+
"Error: Can't parse.\nString doesn't appear to be a valid JSON fragment: ";
|
1194
|
+
strError += objException.message;
|
1195
|
+
if (typeof objException.text != 'undefined' && objException.text.length) {
|
1196
|
+
strError += '\n' + objException.text;
|
1197
|
+
}
|
1198
|
+
strError += '\n' + objArgs.strJson;
|
1199
|
+
Zapatec.Transport.displayError(0, strError, objArgs.onError);
|
1200
|
+
};
|
1201
|
+
if (typeof objArgs.onLoad == 'function') {
|
1202
|
+
objArgs.onLoad(objJson);
|
1203
|
+
}
|
1204
|
+
return objJson;
|
1205
|
+
};
|
1206
|
+
|
1207
|
+
/**
|
1208
|
+
* Parses JSON string into object.
|
1209
|
+
*
|
1210
|
+
* <pre>
|
1211
|
+
* Was taken with changes from http://json.org/json.js.
|
1212
|
+
*
|
1213
|
+
* Throws exception if parsing error occurs.
|
1214
|
+
*
|
1215
|
+
* JSON format is described at http://json.org/js.html.
|
1216
|
+
* </pre>
|
1217
|
+
*
|
1218
|
+
* @private
|
1219
|
+
* @param {string} text JSON string to parse
|
1220
|
+
* @return JSON object
|
1221
|
+
* @type object
|
1222
|
+
*/
|
1223
|
+
Zapatec.Transport.parseJsonStr = function(text) {
|
1224
|
+
var p = /^\s*(([,:{}\[\]])|"(\\.|[^\x00-\x1f"\\])*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)\s*/,
|
1225
|
+
token,
|
1226
|
+
operator;
|
1227
|
+
function error(m, t) {
|
1228
|
+
throw {
|
1229
|
+
name: 'JSONError',
|
1230
|
+
message: m,
|
1231
|
+
text: t || operator || token
|
1232
|
+
};
|
1233
|
+
}
|
1234
|
+
function next(b) {
|
1235
|
+
if (b && b != operator) {
|
1236
|
+
error("Expected '" + b + "'");
|
1237
|
+
}
|
1238
|
+
if (text) {
|
1239
|
+
var t = p.exec(text);
|
1240
|
+
if (t) {
|
1241
|
+
if (t[2]) {
|
1242
|
+
token = null;
|
1243
|
+
operator = t[2];
|
1244
|
+
} else {
|
1245
|
+
operator = null;
|
1246
|
+
try {
|
1247
|
+
token = eval(t[1]);
|
1248
|
+
} catch (e) {
|
1249
|
+
error("Bad token", t[1]);
|
1250
|
+
}
|
1251
|
+
}
|
1252
|
+
text = text.substring(t[0].length);
|
1253
|
+
} else {
|
1254
|
+
error("Unrecognized token", text);
|
1255
|
+
}
|
1256
|
+
} else {
|
1257
|
+
// undefined changed to null because it is not supported in IE 5.0
|
1258
|
+
token = operator = null;
|
1259
|
+
}
|
1260
|
+
}
|
1261
|
+
function val() {
|
1262
|
+
var k, o;
|
1263
|
+
switch (operator) {
|
1264
|
+
case '{':
|
1265
|
+
next('{');
|
1266
|
+
o = {};
|
1267
|
+
if (operator != '}') {
|
1268
|
+
for (;;) {
|
1269
|
+
if (operator || typeof token != 'string') {
|
1270
|
+
error("Missing key");
|
1271
|
+
}
|
1272
|
+
k = token;
|
1273
|
+
next();
|
1274
|
+
next(':');
|
1275
|
+
o[k] = val();
|
1276
|
+
if (operator != ',') {
|
1277
|
+
break;
|
1278
|
+
}
|
1279
|
+
next(',');
|
1280
|
+
}
|
1281
|
+
}
|
1282
|
+
next('}');
|
1283
|
+
return o;
|
1284
|
+
case '[':
|
1285
|
+
next('[');
|
1286
|
+
o = [];
|
1287
|
+
if (operator != ']') {
|
1288
|
+
for (;;) {
|
1289
|
+
o.push(val());
|
1290
|
+
if (operator != ',') {
|
1291
|
+
break;
|
1292
|
+
}
|
1293
|
+
next(',');
|
1294
|
+
}
|
1295
|
+
}
|
1296
|
+
next(']');
|
1297
|
+
return o;
|
1298
|
+
default:
|
1299
|
+
if (operator !== null) {
|
1300
|
+
error("Missing value");
|
1301
|
+
}
|
1302
|
+
k = token;
|
1303
|
+
next();
|
1304
|
+
return k;
|
1305
|
+
}
|
1306
|
+
}
|
1307
|
+
next();
|
1308
|
+
return val();
|
1309
|
+
};
|
1310
|
+
|
1311
|
+
/**
|
1312
|
+
* Serializes JSON object into JSON string.
|
1313
|
+
*
|
1314
|
+
* Was taken with changes from http://json.org/json.js.
|
1315
|
+
*
|
1316
|
+
* @param {object} v JSON object
|
1317
|
+
* @return JSON string
|
1318
|
+
* @type string
|
1319
|
+
*/
|
1320
|
+
Zapatec.Transport.serializeJsonObj = function(v) {
|
1321
|
+
var a = [];
|
1322
|
+
/*
|
1323
|
+
Emit a string.
|
1324
|
+
*/
|
1325
|
+
function e(s) {
|
1326
|
+
a[a.length] = s;
|
1327
|
+
}
|
1328
|
+
/*
|
1329
|
+
Convert a value.
|
1330
|
+
*/
|
1331
|
+
function g(x) {
|
1332
|
+
var c, i, l, v;
|
1333
|
+
switch (typeof x) {
|
1334
|
+
case 'object':
|
1335
|
+
if (x) {
|
1336
|
+
if (x instanceof Array) {
|
1337
|
+
e('[');
|
1338
|
+
l = a.length;
|
1339
|
+
for (i = 0; i < x.length; i += 1) {
|
1340
|
+
v = x[i];
|
1341
|
+
if (typeof v != 'undefined' &&
|
1342
|
+
typeof v != 'function') {
|
1343
|
+
if (l < a.length) {
|
1344
|
+
e(',');
|
1345
|
+
}
|
1346
|
+
g(v);
|
1347
|
+
}
|
1348
|
+
}
|
1349
|
+
e(']');
|
1350
|
+
return;
|
1351
|
+
} else if (typeof x.toString != 'undefined') {
|
1352
|
+
e('{');
|
1353
|
+
l = a.length;
|
1354
|
+
for (i in x) {
|
1355
|
+
v = x[i];
|
1356
|
+
if (x.hasOwnProperty(i) &&
|
1357
|
+
typeof v != 'undefined' &&
|
1358
|
+
typeof v != 'function') {
|
1359
|
+
if (l < a.length) {
|
1360
|
+
e(',');
|
1361
|
+
}
|
1362
|
+
g(i);
|
1363
|
+
e(':');
|
1364
|
+
g(v);
|
1365
|
+
}
|
1366
|
+
}
|
1367
|
+
return e('}');
|
1368
|
+
}
|
1369
|
+
}
|
1370
|
+
e('null');
|
1371
|
+
return;
|
1372
|
+
case 'number':
|
1373
|
+
e(isFinite(x) ? +x : 'null');
|
1374
|
+
return;
|
1375
|
+
case 'string':
|
1376
|
+
l = x.length;
|
1377
|
+
e('"');
|
1378
|
+
for (i = 0; i < l; i += 1) {
|
1379
|
+
c = x.charAt(i);
|
1380
|
+
if (c >= ' ') {
|
1381
|
+
if (c == '\\' || c == '"') {
|
1382
|
+
e('\\');
|
1383
|
+
}
|
1384
|
+
e(c);
|
1385
|
+
} else {
|
1386
|
+
switch (c) {
|
1387
|
+
case '\b':
|
1388
|
+
e('\\b');
|
1389
|
+
break;
|
1390
|
+
case '\f':
|
1391
|
+
e('\\f');
|
1392
|
+
break;
|
1393
|
+
case '\n':
|
1394
|
+
e('\\n');
|
1395
|
+
break;
|
1396
|
+
case '\r':
|
1397
|
+
e('\\r');
|
1398
|
+
break;
|
1399
|
+
case '\t':
|
1400
|
+
e('\\t');
|
1401
|
+
break;
|
1402
|
+
default:
|
1403
|
+
c = c.charCodeAt();
|
1404
|
+
e('\\u00' + Math.floor(c / 16).toString(16) +
|
1405
|
+
(c % 16).toString(16));
|
1406
|
+
}
|
1407
|
+
}
|
1408
|
+
}
|
1409
|
+
e('"');
|
1410
|
+
return;
|
1411
|
+
case 'boolean':
|
1412
|
+
e(String(x));
|
1413
|
+
return;
|
1414
|
+
default:
|
1415
|
+
e('null');
|
1416
|
+
return;
|
1417
|
+
}
|
1418
|
+
}
|
1419
|
+
g(v);
|
1420
|
+
return a.join('');
|
1421
|
+
};
|
1422
|
+
|
1423
|
+
/**
|
1424
|
+
* Displays error message.
|
1425
|
+
*
|
1426
|
+
* <pre>
|
1427
|
+
* Calls onError callback function provided by user. If there is no onError
|
1428
|
+
* callback function, displays alert with human readable error description.
|
1429
|
+
* onError callback function receives following object:
|
1430
|
+
* {
|
1431
|
+
* errorCode: error code [number],
|
1432
|
+
* errorDescription: human readable error description [string]
|
1433
|
+
* }
|
1434
|
+
* </pre>
|
1435
|
+
*
|
1436
|
+
* @private
|
1437
|
+
* @param {number} iErrCode Error code
|
1438
|
+
* @param {string} strError Human readable error description
|
1439
|
+
* @param {function} onError Callback function provided by user
|
1440
|
+
*/
|
1441
|
+
Zapatec.Transport.displayError = function(iErrCode, strError, onError) {
|
1442
|
+
if (typeof onError == 'function') {
|
1443
|
+
onError({
|
1444
|
+
errorCode: iErrCode,
|
1445
|
+
errorDescription: strError
|
1446
|
+
});
|
1447
|
+
} else {
|
1448
|
+
alert(strError);
|
1449
|
+
}
|
1450
|
+
};
|
1451
|
+
|
1452
|
+
/**
|
1453
|
+
* Translates a URL to the URL relative to the specified or to absolute URL.
|
1454
|
+
*
|
1455
|
+
* <pre>
|
1456
|
+
* Arguments object format:
|
1457
|
+
* {
|
1458
|
+
* url: absolute or relative URL to translate [string] (if absolute, will be
|
1459
|
+
* returned as is),
|
1460
|
+
* relativeTo: "url" will be translated to the URL relative to this absolute
|
1461
|
+
* or relative URL [string] (optional, current page URL by default)
|
1462
|
+
* }
|
1463
|
+
* </pre>
|
1464
|
+
*
|
1465
|
+
* @param {object} objArgs Arguments object
|
1466
|
+
* @return Translated URL
|
1467
|
+
* @type string
|
1468
|
+
*/
|
1469
|
+
Zapatec.Transport.translateUrl = function(objArgs) {
|
1470
|
+
if (!objArgs || !objArgs.url) {
|
1471
|
+
return null;
|
1472
|
+
}
|
1473
|
+
// Cut arguments part from url
|
1474
|
+
var arrFullUrl = objArgs.url.split('?', 2);
|
1475
|
+
var strUrl = arrFullUrl[0];
|
1476
|
+
// Check url
|
1477
|
+
if (strUrl.charAt(0) == '/' || strUrl.indexOf(':') >= 0) {
|
1478
|
+
// Return absolute URL as is
|
1479
|
+
return objArgs.url;
|
1480
|
+
}
|
1481
|
+
// Get relativeTo
|
1482
|
+
var strRelativeTo;
|
1483
|
+
if (typeof objArgs.relativeTo != 'string') {
|
1484
|
+
// By default relative to current page URL
|
1485
|
+
strRelativeTo = document.location.toString().split('?', 2)[0];
|
1486
|
+
} else {
|
1487
|
+
// Remove arguments from relativeTo
|
1488
|
+
strRelativeTo = objArgs.relativeTo.split('?', 2)[0];
|
1489
|
+
// Check relativeTo
|
1490
|
+
if (strRelativeTo.indexOf('/') < 0) {
|
1491
|
+
// Relative to current page URL
|
1492
|
+
strRelativeTo = document.location.toString().split('?', 2)[0];
|
1493
|
+
} else if (strRelativeTo.charAt(0) != '/' &&
|
1494
|
+
strRelativeTo.indexOf(':') < 0) {
|
1495
|
+
// Transform relativeTo to absolute URL to be able to translate URLs
|
1496
|
+
// starting from ../
|
1497
|
+
strRelativeTo = Zapatec.Transport.translateUrl({
|
1498
|
+
url: strRelativeTo
|
1499
|
+
});
|
1500
|
+
}
|
1501
|
+
}
|
1502
|
+
// Split URLs
|
1503
|
+
var arrUrl = strUrl.split('/');
|
1504
|
+
var arrRelativeTo = strRelativeTo.split('/');
|
1505
|
+
// Remove file name
|
1506
|
+
arrRelativeTo.pop();
|
1507
|
+
// Form new URL
|
1508
|
+
for (var iToken = 0; iToken < arrUrl.length; iToken++) {
|
1509
|
+
var strToken = arrUrl[iToken];
|
1510
|
+
if (strToken == '..') {
|
1511
|
+
arrRelativeTo.pop();
|
1512
|
+
} else if (strToken != '.') {
|
1513
|
+
arrRelativeTo.push(strToken);
|
1514
|
+
}
|
1515
|
+
}
|
1516
|
+
arrFullUrl[0] = arrRelativeTo.join('/');
|
1517
|
+
// Restore arguments part
|
1518
|
+
return arrFullUrl.join('?');
|
1519
|
+
};
|
1520
|
+
|
1521
|
+
/**
|
1522
|
+
* Holds currently loading URLs to prevent duplicate loads.
|
1523
|
+
* @private
|
1524
|
+
*/
|
1525
|
+
Zapatec.Transport.loading = {};
|
1526
|
+
|
1527
|
+
/**
|
1528
|
+
* Prevents duplicate loads of the same URL when second request is done before
|
1529
|
+
* first request is completed.
|
1530
|
+
*
|
1531
|
+
* <pre>
|
1532
|
+
* Arguments object format:
|
1533
|
+
* {
|
1534
|
+
* url: [string] absolute URL,
|
1535
|
+
* force: [boolean, optional] force reload if it is already loaded,
|
1536
|
+
* onLoad: [function, optional] function reference to call on success,
|
1537
|
+
* onError: [function, optional] function reference to call on error
|
1538
|
+
* }
|
1539
|
+
*
|
1540
|
+
* Returned object format:
|
1541
|
+
*
|
1542
|
+
* If this URL is already loading by another process:
|
1543
|
+
* {
|
1544
|
+
* loading: [boolean] always true
|
1545
|
+
* }
|
1546
|
+
*
|
1547
|
+
* Otherwise:
|
1548
|
+
* {
|
1549
|
+
* onLoad: [function, optional] replacement for function to call on success,
|
1550
|
+
* onError: [function, optional] replacement for function to call on error
|
1551
|
+
* }
|
1552
|
+
* </pre>
|
1553
|
+
*
|
1554
|
+
* @private
|
1555
|
+
* @param {object} objArgs Arguments object
|
1556
|
+
* @return Returned object
|
1557
|
+
* @type object
|
1558
|
+
*/
|
1559
|
+
Zapatec.Transport.setupEvents = function(objArgs) {
|
1560
|
+
// Check arguments
|
1561
|
+
if (!objArgs) {
|
1562
|
+
return {};
|
1563
|
+
}
|
1564
|
+
// If loading is forced, we don't need to check if it is already loading
|
1565
|
+
// If EventDriven is not available, operate as in older versions
|
1566
|
+
// Check if URL is passed
|
1567
|
+
if (objArgs.force || !Zapatec.EventDriven || !objArgs.url) {
|
1568
|
+
return {
|
1569
|
+
onLoad: objArgs.onLoad,
|
1570
|
+
onError: objArgs.onError
|
1571
|
+
};
|
1572
|
+
}
|
1573
|
+
var strUrl = objArgs.url;
|
1574
|
+
// Add onLoad listener
|
1575
|
+
if (typeof objArgs.onLoad == 'function') {
|
1576
|
+
Zapatec.EventDriven.addEventListener('zpTransportOnLoad' + strUrl,
|
1577
|
+
objArgs.onLoad);
|
1578
|
+
}
|
1579
|
+
// Add onError listener
|
1580
|
+
if (typeof objArgs.onError == 'function') {
|
1581
|
+
Zapatec.EventDriven.addEventListener('zpTransportOnError' + strUrl,
|
1582
|
+
objArgs.onError);
|
1583
|
+
}
|
1584
|
+
// Check if it is already loading
|
1585
|
+
if (Zapatec.Transport.loading[strUrl]) {
|
1586
|
+
return {
|
1587
|
+
loading: true
|
1588
|
+
};
|
1589
|
+
} else {
|
1590
|
+
// Flag
|
1591
|
+
Zapatec.Transport.loading[strUrl] = true;
|
1592
|
+
// Replace original callbacks
|
1593
|
+
return {
|
1594
|
+
onLoad: new Function("\
|
1595
|
+
Zapatec.EventDriven.fireEvent('zpTransportOnLoad" + strUrl + "');\
|
1596
|
+
Zapatec.EventDriven.removeEvent('zpTransportOnLoad" + strUrl + "');\
|
1597
|
+
Zapatec.EventDriven.removeEvent('zpTransportOnError" + strUrl + "');\
|
1598
|
+
Zapatec.Transport.loading['" + strUrl + "'] = false;\
|
1599
|
+
"),
|
1600
|
+
onError: new Function('objError', "\
|
1601
|
+
Zapatec.EventDriven.fireEvent('zpTransportOnError" + strUrl + "',\
|
1602
|
+
objError);\
|
1603
|
+
Zapatec.EventDriven.removeEvent('zpTransportOnLoad" + strUrl + "');\
|
1604
|
+
Zapatec.EventDriven.removeEvent('zpTransportOnError" + strUrl + "');\
|
1605
|
+
Zapatec.Transport.loading['" + strUrl + "'] = false;\
|
1606
|
+
")
|
1607
|
+
};
|
1608
|
+
}
|
1609
|
+
};
|
1610
|
+
|
1611
|
+
/**
|
1612
|
+
* Holds URLs of already loaded JS files to prevent duplicate loads.
|
1613
|
+
* @private
|
1614
|
+
*/
|
1615
|
+
Zapatec.Transport.loadedJS = {};
|
1616
|
+
|
1617
|
+
/**
|
1618
|
+
* Checks if specified JS file is already loaded.
|
1619
|
+
*
|
1620
|
+
* @private
|
1621
|
+
* @param {string} strUrl Absolute or relative URL of JS file
|
1622
|
+
* @param {string} strAbsoluteUrl Optional. Absolute URL of JS file
|
1623
|
+
* @return Loaded or not
|
1624
|
+
* @type boolean
|
1625
|
+
*/
|
1626
|
+
Zapatec.Transport.isLoadedJS = function(strUrl, strAbsoluteUrl) {
|
1627
|
+
// Get absolute URL of the JS file
|
1628
|
+
if (typeof strAbsoluteUrl == 'undefined') {
|
1629
|
+
strAbsoluteUrl = Zapatec.Transport.translateUrl({url: strUrl});
|
1630
|
+
}
|
1631
|
+
// Check in the list of loaded
|
1632
|
+
if (Zapatec.Transport.loadedJS[strAbsoluteUrl]) {
|
1633
|
+
return true;
|
1634
|
+
}
|
1635
|
+
// Try to find script tag
|
1636
|
+
var arrScripts = document.getElementsByTagName('script');
|
1637
|
+
for (var iScript = 0; iScript < arrScripts.length; iScript++) {
|
1638
|
+
var strSrc = arrScripts[iScript].getAttribute('src') || '';
|
1639
|
+
if (strSrc == strUrl) {
|
1640
|
+
// Add this URL to the list of loaded
|
1641
|
+
Zapatec.Transport.loadedJS[strAbsoluteUrl] = true;
|
1642
|
+
return true;
|
1643
|
+
}
|
1644
|
+
}
|
1645
|
+
// Not found
|
1646
|
+
return false;
|
1647
|
+
};
|
1648
|
+
|
1649
|
+
/**
|
1650
|
+
* Returns path to the specified js file. Iterates over all loaded script
|
1651
|
+
* elements starting from the end. Finds specified js file in src attribute of
|
1652
|
+
* the script element. Splits src attribute value and returns path without js
|
1653
|
+
* file name.
|
1654
|
+
*
|
1655
|
+
* @param {string} strScriptFileName Script file name, e.g. 'zpmywidget.js'
|
1656
|
+
* @return Path to the script, e.g. '../src/' or '' if path is not found
|
1657
|
+
* @type string
|
1658
|
+
*/
|
1659
|
+
Zapatec.Transport.getPath = function(strScriptFileName) {
|
1660
|
+
// Get all script elements
|
1661
|
+
var arrScripts = document.getElementsByTagName('script');
|
1662
|
+
// Find the script in the list
|
1663
|
+
for (var iScript = arrScripts.length - 1; iScript >= 0; iScript--) {
|
1664
|
+
var strSrc = arrScripts[iScript].getAttribute('src') || '';
|
1665
|
+
var arrTokens = strSrc.split('/');
|
1666
|
+
// Remove last token
|
1667
|
+
var strLastToken = arrTokens.pop();
|
1668
|
+
if (strLastToken == strScriptFileName) {
|
1669
|
+
return arrTokens.length ? arrTokens.join('/') + '/' : '';
|
1670
|
+
}
|
1671
|
+
}
|
1672
|
+
// Search in loaded JS files
|
1673
|
+
for (var strSrc in Zapatec.Transport.loadedJS) {
|
1674
|
+
var arrTokens = strSrc.split('/');
|
1675
|
+
// Remove last token
|
1676
|
+
var strLastToken = arrTokens.pop();
|
1677
|
+
if (strLastToken == strScriptFileName) {
|
1678
|
+
return arrTokens.length ? arrTokens.join('/') + '/' : '';
|
1679
|
+
}
|
1680
|
+
}
|
1681
|
+
// Not found
|
1682
|
+
return '';
|
1683
|
+
};
|
1684
|
+
|
1685
|
+
/**
|
1686
|
+
* Writes script tag to the document. Checks if specified JS file is already
|
1687
|
+
* loaded unless boolForce argument is true.
|
1688
|
+
*
|
1689
|
+
* <pre>
|
1690
|
+
* Note: This function must be invoked during page load because it uses
|
1691
|
+
* document.write method.
|
1692
|
+
*
|
1693
|
+
* If special Zapatec.doNotInclude flag is set, this function does nothing.
|
1694
|
+
* </pre>
|
1695
|
+
*
|
1696
|
+
* @param {string} strSrc Src attribute value of the script element
|
1697
|
+
* @param {string} strId Optional. Id of the script element
|
1698
|
+
* @param {boolean} boolForce Optional. Force reload if it is already loaded
|
1699
|
+
*/
|
1700
|
+
Zapatec.Transport.include = function(strSrc, strId, boolForce) {
|
1701
|
+
// Check flag
|
1702
|
+
if (Zapatec.doNotInclude) {
|
1703
|
+
return;
|
1704
|
+
}
|
1705
|
+
// Get absolute URL of the JS file
|
1706
|
+
var strAbsoluteUrl = Zapatec.Transport.translateUrl({url: strSrc});
|
1707
|
+
// Check if it is already loaded
|
1708
|
+
if (!boolForce && Zapatec.Transport.isLoadedJS(strSrc, strAbsoluteUrl)) {
|
1709
|
+
return;
|
1710
|
+
}
|
1711
|
+
// Include file
|
1712
|
+
document.write('<script type="text/javascript" src="' + strSrc +
|
1713
|
+
(typeof strId == 'string' ? '" id="' + strId : '') + '"></script>');
|
1714
|
+
// Add this URL to the list of loaded
|
1715
|
+
Zapatec.Transport.loadedJS[strAbsoluteUrl] = true;
|
1716
|
+
};
|
1717
|
+
|
1718
|
+
/**
|
1719
|
+
* Shortcut. The same as Zapatec.Transport#include.
|
1720
|
+
*/
|
1721
|
+
Zapatec.include = Zapatec.Transport.include;
|
1722
|
+
|
1723
|
+
/**
|
1724
|
+
* Includes JS file into the page. Allows URLs from foreign domains. Doesn't
|
1725
|
+
* check if the JS file is already included. File is loaded asynchronously.
|
1726
|
+
*
|
1727
|
+
* <pre>
|
1728
|
+
* If special Zapatec.doNotInclude flag is set, this function does nothing.
|
1729
|
+
* </pre>
|
1730
|
+
*
|
1731
|
+
* @param {string} strSrc Src attribute value of the script element
|
1732
|
+
* @param {string} strId Optional. Id of the script element
|
1733
|
+
*/
|
1734
|
+
Zapatec.Transport.includeJS = function(strSrc, strId) {
|
1735
|
+
// Check flag
|
1736
|
+
if (Zapatec.doNotInclude) {
|
1737
|
+
return;
|
1738
|
+
}
|
1739
|
+
// Include file
|
1740
|
+
var objContainer = document.body;
|
1741
|
+
if (!objContainer) {
|
1742
|
+
objContainer = document.getElementsByTagName('head')[0];
|
1743
|
+
if (!objContainer) {
|
1744
|
+
objContainer = document;
|
1745
|
+
}
|
1746
|
+
}
|
1747
|
+
var objScript = document.createElement('script');
|
1748
|
+
objScript.type = 'text/javascript';
|
1749
|
+
objScript.src = strSrc;
|
1750
|
+
if (typeof strId == 'string') {
|
1751
|
+
objScript.id = strId;
|
1752
|
+
}
|
1753
|
+
// This is important for Safari to assign attributes before appending
|
1754
|
+
objContainer.appendChild(objScript);
|
1755
|
+
};
|
1756
|
+
|
1757
|
+
/**
|
1758
|
+
* Fetches JS file using fetch and evaluates it in local scope.
|
1759
|
+
*
|
1760
|
+
* <pre>
|
1761
|
+
* When JS file is loaded successfully, onLoad callback function is called
|
1762
|
+
* without arguments. URL is added into Zapatec.Transport.loadedJS array
|
1763
|
+
* and will not be fetched again on next function call unless force argument is
|
1764
|
+
* set to true.
|
1765
|
+
*
|
1766
|
+
* onError callback function receives following object:
|
1767
|
+
* {
|
1768
|
+
* errorCode: [number] server status number (404, etc.),
|
1769
|
+
* errorDescription: [string] human readable error description
|
1770
|
+
* }
|
1771
|
+
*
|
1772
|
+
* One of the arguments: module or url is required. When url is passed,
|
1773
|
+
* module argument is ignored.
|
1774
|
+
*
|
1775
|
+
* If module argument is used, function gets all "script" elements using
|
1776
|
+
* getElementsByTagName and searches for the first element having "src"
|
1777
|
+
* attribute value ending with (relativeModule + ".js") (default relativeModule
|
1778
|
+
* value is "transport"). Path to the module is taken from that src attribute
|
1779
|
+
* value and will be the same as path to relativeModule file.
|
1780
|
+
*
|
1781
|
+
* Arguments object format:
|
1782
|
+
* {
|
1783
|
+
* url: [string, optional] absolute or relative URL of JS file,
|
1784
|
+
* module: [string, optional] module name (file name without .js extension);
|
1785
|
+
* ignored when "url" is defined,
|
1786
|
+
* path: [string, optional] path where to search "module" (default is
|
1787
|
+
* Zapatec.zapatecPath if it is defined); ignored when "url" is defined,
|
1788
|
+
* async: [boolean, optional] use asynchronous mode (default: true),
|
1789
|
+
* force: [boolean, optional] force reload if it is already loaded,
|
1790
|
+
* onLoad: [function, optional] function reference to call on success,
|
1791
|
+
* onError: [function, optional] function reference to call on error
|
1792
|
+
* }
|
1793
|
+
*
|
1794
|
+
* Note: If "force" is used, you should add 'r=' + Math.random() parameter to
|
1795
|
+
* URL to prevent loading from browser cache.
|
1796
|
+
*
|
1797
|
+
* If special Zapatec.doNotInclude flag is set, this function just calls onLoad
|
1798
|
+
* callback function.
|
1799
|
+
* </pre>
|
1800
|
+
*
|
1801
|
+
* @param {object} objArgs Arguments object
|
1802
|
+
*/
|
1803
|
+
Zapatec.Transport.loadJS = function(objArgs) {
|
1804
|
+
// Check arguments
|
1805
|
+
if (!(objArgs instanceof Object)) {
|
1806
|
+
return;
|
1807
|
+
}
|
1808
|
+
if (typeof objArgs.async == 'undefined') {
|
1809
|
+
objArgs.async = true;
|
1810
|
+
}
|
1811
|
+
// Get URL of JS file
|
1812
|
+
var strUrl = null;
|
1813
|
+
if (objArgs.url) {
|
1814
|
+
strUrl = objArgs.url;
|
1815
|
+
} else if (objArgs.module) {
|
1816
|
+
var strPath = '';
|
1817
|
+
if (typeof objArgs.path != 'undefined') {
|
1818
|
+
strPath = objArgs.path;
|
1819
|
+
} else if (typeof Zapatec.zapatecPath != 'undefined') {
|
1820
|
+
strPath = Zapatec.zapatecPath;
|
1821
|
+
}
|
1822
|
+
strUrl = strPath + objArgs.module + '.js';
|
1823
|
+
} else {
|
1824
|
+
return;
|
1825
|
+
}
|
1826
|
+
// Get absolute URL of the JS file
|
1827
|
+
var strAbsUrl = Zapatec.Transport.translateUrl({url: strUrl});
|
1828
|
+
// Check arguments
|
1829
|
+
if (!objArgs.onLoad) {
|
1830
|
+
objArgs.onLoad = null;
|
1831
|
+
}
|
1832
|
+
if (!objArgs.onError) {
|
1833
|
+
objArgs.onError = null;
|
1834
|
+
}
|
1835
|
+
// Check if it is already loaded
|
1836
|
+
if (Zapatec.doNotInclude ||
|
1837
|
+
(!objArgs.force && Zapatec.Transport.isLoadedJS(strUrl, strAbsUrl))) {
|
1838
|
+
// onLoad callback
|
1839
|
+
if (typeof objArgs.onLoad == 'function') {
|
1840
|
+
objArgs.onLoad();
|
1841
|
+
}
|
1842
|
+
return;
|
1843
|
+
}
|
1844
|
+
// Setup onLoad and onError events
|
1845
|
+
var objHandlers = Zapatec.Transport.setupEvents({
|
1846
|
+
url: strAbsUrl,
|
1847
|
+
force: objArgs.force,
|
1848
|
+
onLoad: objArgs.onLoad,
|
1849
|
+
onError: objArgs.onError
|
1850
|
+
});
|
1851
|
+
// Don't need to continue if this url is already loading by another process
|
1852
|
+
if (objHandlers.loading) {
|
1853
|
+
return;
|
1854
|
+
}
|
1855
|
+
// Load JS file
|
1856
|
+
Zapatec.Transport.fetch({
|
1857
|
+
url: strUrl,
|
1858
|
+
async: objArgs.async,
|
1859
|
+
onLoad: function(objRequest) {
|
1860
|
+
// Can be loaded in two processes simultaneously
|
1861
|
+
if (objArgs.force || !Zapatec.Transport.loadedJS[strAbsUrl]) {
|
1862
|
+
var arrTokens = strUrl.split('/');
|
1863
|
+
// Remove last token
|
1864
|
+
var strLastToken = arrTokens.pop();
|
1865
|
+
// Store path to current module
|
1866
|
+
Zapatec.lastLoadedModule = arrTokens.join('/') + '/';
|
1867
|
+
// Evaluate code in global scope
|
1868
|
+
Zapatec.Transport.evalGlobalScope(objRequest.responseText);
|
1869
|
+
// clear path to last loaded module
|
1870
|
+
Zapatec.lastLoadedModule = null;
|
1871
|
+
// Add this URL to the list of loaded
|
1872
|
+
Zapatec.Transport.loadedJS[strAbsUrl] = true;
|
1873
|
+
}
|
1874
|
+
// onLoad callback
|
1875
|
+
if (typeof objHandlers.onLoad == 'function') {
|
1876
|
+
objHandlers.onLoad();
|
1877
|
+
}
|
1878
|
+
},
|
1879
|
+
onError: objHandlers.onError
|
1880
|
+
});
|
1881
|
+
};
|
1882
|
+
|
1883
|
+
/**
|
1884
|
+
* Includes CSS file into the page. Allows URLs from foreign domains. Doesn't
|
1885
|
+
* check if the CSS file is already included. File is loaded asynchronously.
|
1886
|
+
* Requires that head section of the page already exists because link tag
|
1887
|
+
* may appear only inside head.
|
1888
|
+
*
|
1889
|
+
* @param {string} strHref Href attribute value of the link element
|
1890
|
+
*/
|
1891
|
+
Zapatec.Transport.includeCSS = function(strHref) {
|
1892
|
+
// May appear only inside head
|
1893
|
+
var objContainer = document.getElementsByTagName('head')[0];
|
1894
|
+
if (!objContainer) {
|
1895
|
+
return;
|
1896
|
+
}
|
1897
|
+
var objLink = document.createElement('link');
|
1898
|
+
objLink.setAttribute('rel', 'stylesheet');
|
1899
|
+
objLink.setAttribute('type', 'text/css');
|
1900
|
+
objLink.setAttribute('href', strHref);
|
1901
|
+
objContainer.appendChild(objLink);
|
1902
|
+
};
|
1903
|
+
|
1904
|
+
/**
|
1905
|
+
* Holds URLs of already loaded CSS files to prevent duplicate loads.
|
1906
|
+
* @private
|
1907
|
+
*/
|
1908
|
+
Zapatec.Transport.loadedCss = {};
|
1909
|
+
|
1910
|
+
/**
|
1911
|
+
* Fetches style sheet using fetch and loads it into the document.
|
1912
|
+
*
|
1913
|
+
* <pre>
|
1914
|
+
* When stylesheet is loaded successfully, onLoad callback function is called
|
1915
|
+
* without arguments. URL is added into Zapatec.Transport.loadedCss array
|
1916
|
+
* and will not be fetched again on next function call unless force argument is
|
1917
|
+
* set to true.
|
1918
|
+
*
|
1919
|
+
* onError callback function receives following object:
|
1920
|
+
* {
|
1921
|
+
* errorCode: server status number (404, etc.) [number],
|
1922
|
+
* errorDescription: human readable error description [string]
|
1923
|
+
* }
|
1924
|
+
*
|
1925
|
+
* Arguments object format:
|
1926
|
+
* {
|
1927
|
+
* url: absolute or relative URL of CSS file [string],
|
1928
|
+
* async: [boolean, optional] use asynchronous mode (default: true),
|
1929
|
+
* force: [boolean, optional] force reload if it is already loaded,
|
1930
|
+
* onLoad: [function, optional] function reference to call on success,
|
1931
|
+
* onError: [function, optional] function reference to call on error
|
1932
|
+
* }
|
1933
|
+
*
|
1934
|
+
* Note: If "force" is used, you should add 'r=' + Math.random() parameter to
|
1935
|
+
* URL to prevent loading from browser cache.
|
1936
|
+
* </pre>
|
1937
|
+
*
|
1938
|
+
* @param {object} objArgs Arguments object
|
1939
|
+
*/
|
1940
|
+
Zapatec.Transport.loadCss = function(objArgs) {
|
1941
|
+
if (Zapatec.StyleSheet) {
|
1942
|
+
Zapatec.Transport.loadCssWithStyleSheet(objArgs);
|
1943
|
+
} else {
|
1944
|
+
// Load Zapatec.StyleSheet class
|
1945
|
+
Zapatec.Transport.loadJS({
|
1946
|
+
module: 'stylesheet',
|
1947
|
+
async: objArgs.async,
|
1948
|
+
onLoad: function() {
|
1949
|
+
Zapatec.Transport.loadCssWithStyleSheet(objArgs);
|
1950
|
+
}
|
1951
|
+
});
|
1952
|
+
}
|
1953
|
+
};
|
1954
|
+
|
1955
|
+
/**
|
1956
|
+
* Fetches style sheet using fetch and loads it into the document.
|
1957
|
+
* Zapatec.StyleSheet must exist.
|
1958
|
+
*
|
1959
|
+
* @private
|
1960
|
+
* @param {object} objArgs Arguments object see
|
1961
|
+
* {@link Zapatec.Transport#loadCss}
|
1962
|
+
*/
|
1963
|
+
Zapatec.Transport.loadCssWithStyleSheet = function(objArgs) {
|
1964
|
+
// Check arguments
|
1965
|
+
if (!(objArgs instanceof Object)) {
|
1966
|
+
return;
|
1967
|
+
}
|
1968
|
+
if (!objArgs.url) {
|
1969
|
+
return;
|
1970
|
+
}
|
1971
|
+
if (typeof objArgs.async == 'undefined') {
|
1972
|
+
objArgs.async = true;
|
1973
|
+
}
|
1974
|
+
// Get absolute URL of the CSS file
|
1975
|
+
var strAbsUrl = Zapatec.Transport.translateUrl({url: objArgs.url});
|
1976
|
+
// Check if it is already loaded
|
1977
|
+
if (!objArgs.force) {
|
1978
|
+
if (Zapatec.Transport.loadedCss[strAbsUrl]) {
|
1979
|
+
// onLoad callback
|
1980
|
+
if (typeof objArgs.onLoad == 'function') {
|
1981
|
+
objArgs.onLoad();
|
1982
|
+
}
|
1983
|
+
return;
|
1984
|
+
}
|
1985
|
+
var arrLinks = document.getElementsByTagName('link');
|
1986
|
+
for (var iLnk = 0; iLnk < arrLinks.length; iLnk++) {
|
1987
|
+
var strHref = arrLinks[iLnk].getAttribute('href') || '';
|
1988
|
+
// Make it absolute
|
1989
|
+
strHref = Zapatec.Transport.translateUrl({url: strHref});
|
1990
|
+
if (strHref == strAbsUrl) {
|
1991
|
+
// Add this url to the list of loaded
|
1992
|
+
Zapatec.Transport.loadedCss[strAbsUrl] = true;
|
1993
|
+
// onLoad callback
|
1994
|
+
if (typeof objArgs.onLoad == 'function') {
|
1995
|
+
objArgs.onLoad();
|
1996
|
+
}
|
1997
|
+
return;
|
1998
|
+
}
|
1999
|
+
}
|
2000
|
+
}
|
2001
|
+
// Setup onLoad and onError events
|
2002
|
+
var objHandlers = Zapatec.Transport.setupEvents({
|
2003
|
+
url: strAbsUrl,
|
2004
|
+
force: objArgs.force,
|
2005
|
+
onLoad: objArgs.onLoad,
|
2006
|
+
onError: objArgs.onError
|
2007
|
+
});
|
2008
|
+
// Don't need to continue if this url is already loading by another process
|
2009
|
+
if (objHandlers.loading) {
|
2010
|
+
return;
|
2011
|
+
}
|
2012
|
+
// Load CSS file
|
2013
|
+
Zapatec.Transport.fetch({
|
2014
|
+
url: objArgs.url,
|
2015
|
+
async: objArgs.async,
|
2016
|
+
onLoad: function(objRequest) {
|
2017
|
+
// Parse CSS file.
|
2018
|
+
// Find URLs and translate them to absolute.
|
2019
|
+
// Find @import rules and load corresponding CSS files.
|
2020
|
+
var strCss = objRequest.responseText;
|
2021
|
+
var arrResultCss = [];
|
2022
|
+
// Will hold image URLs to preload
|
2023
|
+
var arrImgUrls = [];
|
2024
|
+
// Will hold CSS URLs to load
|
2025
|
+
var arrCssUrls = [];
|
2026
|
+
// Move first cursor to the beginning of the string
|
2027
|
+
var iPos = 0;
|
2028
|
+
// Move second cursor to the pattern
|
2029
|
+
var iNextPos = strCss.indexOf('url(', iPos);
|
2030
|
+
while (iNextPos >= 0) {
|
2031
|
+
// Move first cursor to the URL
|
2032
|
+
iNextPos += 4;
|
2033
|
+
// Check if this is @import rule
|
2034
|
+
var strToken = strCss.substring(iPos, iNextPos);
|
2035
|
+
var boolIsImport = /@import\s+url\($/.test(strToken);
|
2036
|
+
// Add part of the string before URL
|
2037
|
+
arrResultCss.push(strToken);
|
2038
|
+
// Move second cursor to the new location to start the search from
|
2039
|
+
iPos = iNextPos;
|
2040
|
+
// Search the end of URL
|
2041
|
+
iNextPos = strCss.indexOf(')', iPos);
|
2042
|
+
if (iNextPos >= 0) {
|
2043
|
+
// Remove quotes
|
2044
|
+
var strImgUrl = strCss.substring(iPos, iNextPos);
|
2045
|
+
strImgUrl = strImgUrl.replace(/['"]/g, '');
|
2046
|
+
// Translate image URL relative to CSS file URL
|
2047
|
+
strImgUrl = Zapatec.Transport.translateUrl({
|
2048
|
+
url: strImgUrl,
|
2049
|
+
relativeTo: objArgs.url
|
2050
|
+
});
|
2051
|
+
// Convert to absolute URL
|
2052
|
+
strImgUrl = Zapatec.Transport.translateUrl({
|
2053
|
+
url: strImgUrl
|
2054
|
+
});
|
2055
|
+
// Add translated URL
|
2056
|
+
arrResultCss.push(strImgUrl);
|
2057
|
+
// Add URL to the list
|
2058
|
+
if (boolIsImport) {
|
2059
|
+
// Add CSS URL to load list
|
2060
|
+
arrCssUrls.push(strImgUrl);
|
2061
|
+
} else {
|
2062
|
+
// Add image URL to preload list
|
2063
|
+
arrImgUrls.push(strImgUrl);
|
2064
|
+
}
|
2065
|
+
// Move second cursor to the new location to start the search from
|
2066
|
+
iPos = iNextPos;
|
2067
|
+
// Search next pattern
|
2068
|
+
iNextPos = strCss.indexOf('url(', iPos);
|
2069
|
+
}
|
2070
|
+
}
|
2071
|
+
// Add the rest of string
|
2072
|
+
arrResultCss.push(strCss.substr(iPos));
|
2073
|
+
// Get translated CSS text
|
2074
|
+
strCss = arrResultCss.join('');
|
2075
|
+
// Load CSS files
|
2076
|
+
Zapatec.Transport.loadCssList({
|
2077
|
+
urls: arrCssUrls,
|
2078
|
+
async: objArgs.async,
|
2079
|
+
onLoad: function() {
|
2080
|
+
// Add style sheet rules into the page
|
2081
|
+
var objStyleSheet = new Zapatec.StyleSheet();
|
2082
|
+
objStyleSheet.addParse(strCss);
|
2083
|
+
// Fire event
|
2084
|
+
if (typeof objHandlers.onLoad == 'function') {
|
2085
|
+
objHandlers.onLoad();
|
2086
|
+
}
|
2087
|
+
}
|
2088
|
+
});
|
2089
|
+
// Add this URL to the list of loaded
|
2090
|
+
Zapatec.Transport.loadedCss[strAbsUrl] = true;
|
2091
|
+
// Preload images
|
2092
|
+
Zapatec.Transport.preloadImages({
|
2093
|
+
urls: arrImgUrls,
|
2094
|
+
timeout: 60000 // 1 minute
|
2095
|
+
});
|
2096
|
+
},
|
2097
|
+
onError: objHandlers.onError
|
2098
|
+
});
|
2099
|
+
};
|
2100
|
+
|
2101
|
+
/**
|
2102
|
+
* Loads several CSS files one by one it into the document.
|
2103
|
+
*
|
2104
|
+
* <pre>
|
2105
|
+
* This function behaves differently from other Zapatec.Transport functions.
|
2106
|
+
* onLoad callback function will be called in any case, even if errors occured
|
2107
|
+
* during loading. If there are multiple errors, onError callback function will
|
2108
|
+
* be called once for every passed URL that wasn't loaded successfully.
|
2109
|
+
*
|
2110
|
+
* onLoad callback function is called without arguments.
|
2111
|
+
*
|
2112
|
+
* onError callback function receives following object:
|
2113
|
+
* {
|
2114
|
+
* errorCode: server status number (404, etc.) [number],
|
2115
|
+
* errorDescription: human readable error description [string]
|
2116
|
+
* }
|
2117
|
+
*
|
2118
|
+
* Arguments object format:
|
2119
|
+
* {
|
2120
|
+
* urls: array of absolute or relative URLs of CSS files to load [object]
|
2121
|
+
* (files will be loaded in order they appear in the array),
|
2122
|
+
* async: [boolean, optional] use asynchronous mode (default: true),
|
2123
|
+
* force: [boolean, optional] force reload if it is already loaded,
|
2124
|
+
* onLoad: function reference to call on completion [function] (optional),
|
2125
|
+
* onError: function reference to call on error [function] (optional)
|
2126
|
+
* }
|
2127
|
+
*
|
2128
|
+
* Note: If "force" is used, you should add 'r=' + Math.random() parameter to
|
2129
|
+
* URL to prevent loading from browser cache.
|
2130
|
+
* </pre>
|
2131
|
+
*
|
2132
|
+
* @param {object} objArgs Arguments object
|
2133
|
+
*/
|
2134
|
+
Zapatec.Transport.loadCssList = function(objArgs) {
|
2135
|
+
// Check arguments
|
2136
|
+
if (!(objArgs instanceof Object)) {
|
2137
|
+
return;
|
2138
|
+
}
|
2139
|
+
if (typeof objArgs.async == 'undefined') {
|
2140
|
+
objArgs.async = true;
|
2141
|
+
}
|
2142
|
+
if (!objArgs.onLoad) {
|
2143
|
+
objArgs.onLoad = null;
|
2144
|
+
}
|
2145
|
+
if (!objArgs.onError) {
|
2146
|
+
objArgs.onError = null;
|
2147
|
+
}
|
2148
|
+
if (!objArgs.urls || !objArgs.urls.length) {
|
2149
|
+
// onLoad callback
|
2150
|
+
if (typeof objArgs.onLoad == 'function') {
|
2151
|
+
objArgs.onLoad();
|
2152
|
+
}
|
2153
|
+
return;
|
2154
|
+
}
|
2155
|
+
// Get first URL in the array
|
2156
|
+
var strUrl = objArgs.urls.shift();
|
2157
|
+
// CSS file onLoad handler
|
2158
|
+
var funcOnLoad = function() {
|
2159
|
+
// Load the rest of URLs
|
2160
|
+
Zapatec.Transport.loadCssList({
|
2161
|
+
urls: objArgs.urls,
|
2162
|
+
async: objArgs.async,
|
2163
|
+
force: objArgs.force,
|
2164
|
+
onLoad: objArgs.onLoad,
|
2165
|
+
onError: objArgs.onError
|
2166
|
+
});
|
2167
|
+
};
|
2168
|
+
// Load CSS file
|
2169
|
+
Zapatec.Transport.loadCss({
|
2170
|
+
url: strUrl,
|
2171
|
+
async: objArgs.async,
|
2172
|
+
force: objArgs.force,
|
2173
|
+
onLoad: funcOnLoad,
|
2174
|
+
onError: function(objError) {
|
2175
|
+
Zapatec.Transport.displayError(objError.errorCode,
|
2176
|
+
objError.errorDescription, objArgs.onError);
|
2177
|
+
funcOnLoad();
|
2178
|
+
}
|
2179
|
+
});
|
2180
|
+
};
|
2181
|
+
|
2182
|
+
/**
|
2183
|
+
* Holds image preloads.
|
2184
|
+
* @private
|
2185
|
+
*/
|
2186
|
+
Zapatec.Transport.imagePreloads = [];
|
2187
|
+
|
2188
|
+
/**
|
2189
|
+
* Preloads one or several images at once. See Zapatec.PreloadImages class
|
2190
|
+
* (utils/preloadimages.js) for details.
|
2191
|
+
*
|
2192
|
+
* <pre>
|
2193
|
+
* Arguments object format:
|
2194
|
+
* {
|
2195
|
+
* urls: [object] array of absolute or relative image URLs to preload,
|
2196
|
+
* onLoad: [function, optional] onload event handler,
|
2197
|
+
* timeout: [number, optional] number of milliseconds to wait for onload
|
2198
|
+
* event before forcing it
|
2199
|
+
* }
|
2200
|
+
* </pre>
|
2201
|
+
*
|
2202
|
+
* @param {object} objArgs Arguments object
|
2203
|
+
*/
|
2204
|
+
Zapatec.Transport.preloadImages = function(objArgs) {
|
2205
|
+
if (Zapatec.PreloadImages) {
|
2206
|
+
Zapatec.Transport.imagePreloads.push(new Zapatec.PreloadImages(objArgs));
|
2207
|
+
} else {
|
2208
|
+
// Load preloadimages.js module
|
2209
|
+
Zapatec.Transport.loadJS({
|
2210
|
+
module: 'preloadimages',
|
2211
|
+
onLoad: function() {
|
2212
|
+
Zapatec.Transport.imagePreloads.push(
|
2213
|
+
new Zapatec.PreloadImages(objArgs));
|
2214
|
+
}
|
2215
|
+
});
|
2216
|
+
}
|
2217
|
+
};
|