test_server 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.bowerrc +4 -0
- data/.gitignore +19 -0
- data/.rdebugrc +7 -0
- data/.rspec +3 -0
- data/.simplecov +8 -0
- data/.travis.yml +8 -0
- data/.yardopts +5 -0
- data/Gemfile +55 -0
- data/LICENSE.md +22 -0
- data/README.md +29 -0
- data/Rakefile +107 -0
- data/app/assets/javascripts/application.js +65 -0
- data/app/assets/stylesheets/application.scss +150 -0
- data/app/controllers/application_controller.rb +71 -0
- data/app/controllers/assets_controller.rb +72 -0
- data/app/controllers/javascript_controller.rb +31 -0
- data/app/controllers/streaming_controller.rb +52 -0
- data/app/controllers/string_controller.rb +51 -0
- data/app/views/application.haml +19 -0
- data/app/views/xhr/show.haml +38 -0
- data/bin/test_server +10 -0
- data/bower.json +8 -0
- data/config.ru +51 -0
- data/files/config.yaml +1 -0
- data/files/example-config.erb +12 -0
- data/lib/test_server/access_logger.rb +13 -0
- data/lib/test_server/actions/create_directory.rb +33 -0
- data/lib/test_server/actions/create_file.rb +55 -0
- data/lib/test_server/actions/create_output.rb +36 -0
- data/lib/test_server/actions/handle_error.rb +39 -0
- data/lib/test_server/actions/initialize_application.rb +56 -0
- data/lib/test_server/actions/reload_configuration.rb +21 -0
- data/lib/test_server/actions/send_signal.rb +32 -0
- data/lib/test_server/cli/helper.rb +12 -0
- data/lib/test_server/cli/main.rb +105 -0
- data/lib/test_server/cli/reload.rb +40 -0
- data/lib/test_server/config.rb +107 -0
- data/lib/test_server/data.rb +23 -0
- data/lib/test_server/encoder.rb +39 -0
- data/lib/test_server/encoders/base64.rb +14 -0
- data/lib/test_server/encoders/base64_strict.rb +14 -0
- data/lib/test_server/encoders/gzip.rb +14 -0
- data/lib/test_server/encoders/null.rb +14 -0
- data/lib/test_server/erb_generator.rb +35 -0
- data/lib/test_server/error_handler.rb +109 -0
- data/lib/test_server/error_messages.rb +67 -0
- data/lib/test_server/exceptions.rb +39 -0
- data/lib/test_server/locales/en.yml +72 -0
- data/lib/test_server/main.rb +31 -0
- data/lib/test_server/null_access_logger.rb +6 -0
- data/lib/test_server/process_environment.rb +23 -0
- data/lib/test_server/server.rb +19 -0
- data/lib/test_server/server_commands/puma.rb +37 -0
- data/lib/test_server/server_commands/rackup.rb +44 -0
- data/lib/test_server/template_file.rb +19 -0
- data/lib/test_server/template_repository.rb +22 -0
- data/lib/test_server/ui_logger.rb +37 -0
- data/lib/test_server/version.rb +4 -0
- data/lib/test_server/web_helper.rb +66 -0
- data/lib/test_server.rb +78 -0
- data/share/archlinux/Makefile +7 -0
- data/share/archlinux/PKGBUILD.sh.erb +110 -0
- data/share/archlinux/config.yaml.erb +10 -0
- data/share/archlinux/defaults.sh.erb +3 -0
- data/share/archlinux/startup.sh.erb +9 -0
- data/share/archlinux/test_server.install +65 -0
- data/share/archlinux/tmpfiles.conf.erb +2 -0
- data/share/systemd/test_server.service +9 -0
- data/share/systemd/test_server.service.erb +11 -0
- data/share/systemd/test_server.socket +10 -0
- data/spec/encoder_spec.rb +50 -0
- data/spec/encoders/base64_spec.rb +18 -0
- data/spec/encoders/base64_strict_spec.rb +18 -0
- data/spec/encoders/gzip_spec.rb +18 -0
- data/spec/encoders/null_spec.rb +18 -0
- data/spec/error_handler_spec.rb +155 -0
- data/spec/features/fetch_data_via_javascript_spec.rb +19 -0
- data/spec/features/fetch_test_data_plain_spec.rb +109 -0
- data/spec/features/fetch_test_data_via_streaming_spec.rb +53 -0
- data/spec/features/helper_spec.rb +125 -0
- data/spec/process_environment_spec.rb +44 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/support/capybara.rb +16 -0
- data/spec/support/debugging.rb +3 -0
- data/spec/support/encoding.rb +1 -0
- data/spec/support/environment.rb +33 -0
- data/spec/support/example.rb +16 -0
- data/spec/support/filesystem.rb +19 -0
- data/spec/support/html.rb +20 -0
- data/spec/support/matcher.rb +17 -0
- data/spec/support/pretty_print.xsl +46 -0
- data/spec/support/reporting.rb +8 -0
- data/spec/support/rspec.rb +5 -0
- data/spec/support/string.rb +2 -0
- data/spec/support/timeout.rb +18 -0
- data/test_server.gemspec +40 -0
- data/vendor/assets/components/bootstrap-sass/.bower.json +25 -0
- data/vendor/assets/components/bootstrap-sass/CNAME +1 -0
- data/vendor/assets/components/bootstrap-sass/CONTRIBUTING.md +61 -0
- data/vendor/assets/components/bootstrap-sass/DOCS-LICENSE +319 -0
- data/vendor/assets/components/bootstrap-sass/Gemfile +5 -0
- data/vendor/assets/components/bootstrap-sass/Gruntfile.js +244 -0
- data/vendor/assets/components/bootstrap-sass/LICENSE +176 -0
- data/vendor/assets/components/bootstrap-sass/LICENSE-MIT +21 -0
- data/vendor/assets/components/bootstrap-sass/README.md +277 -0
- data/vendor/assets/components/bootstrap-sass/Rakefile +44 -0
- data/vendor/assets/components/bootstrap-sass/_config.yml +25 -0
- data/vendor/assets/components/bootstrap-sass/_includes/ads.html +1 -0
- data/vendor/assets/components/bootstrap-sass/_includes/footer.html +34 -0
- data/vendor/assets/components/bootstrap-sass/_includes/header.html +42 -0
- data/vendor/assets/components/bootstrap-sass/_includes/nav-about.html +12 -0
- data/vendor/assets/components/bootstrap-sass/_includes/nav-components.html +137 -0
- data/vendor/assets/components/bootstrap-sass/_includes/nav-css.html +99 -0
- data/vendor/assets/components/bootstrap-sass/_includes/nav-customize.html +40 -0
- data/vendor/assets/components/bootstrap-sass/_includes/nav-getting-started.html +44 -0
- data/vendor/assets/components/bootstrap-sass/_includes/nav-javascript.html +88 -0
- data/vendor/assets/components/bootstrap-sass/_includes/nav-main.html +37 -0
- data/vendor/assets/components/bootstrap-sass/_includes/old-bs-docs.html +8 -0
- data/vendor/assets/components/bootstrap-sass/_includes/social-buttons.html +16 -0
- data/vendor/assets/components/bootstrap-sass/_layouts/default.html +79 -0
- data/vendor/assets/components/bootstrap-sass/_layouts/home.html +47 -0
- data/vendor/assets/components/bootstrap-sass/about.html +93 -0
- data/vendor/assets/components/bootstrap-sass/bower.json +11 -0
- data/vendor/assets/components/bootstrap-sass/browserstack.json +37 -0
- data/vendor/assets/components/bootstrap-sass/components.html +3689 -0
- data/vendor/assets/components/bootstrap-sass/composer.json +28 -0
- data/vendor/assets/components/bootstrap-sass/css.html +2674 -0
- data/vendor/assets/components/bootstrap-sass/customize.html +1715 -0
- data/vendor/assets/components/bootstrap-sass/dist/css/bootstrap-theme.css +427 -0
- data/vendor/assets/components/bootstrap-sass/dist/css/bootstrap-theme.min.css +1 -0
- data/vendor/assets/components/bootstrap-sass/dist/css/bootstrap.css +6350 -0
- data/vendor/assets/components/bootstrap-sass/dist/css/bootstrap.min.css +1 -0
- data/vendor/assets/components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/vendor/assets/components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/vendor/assets/components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/vendor/assets/components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/vendor/assets/components/bootstrap-sass/dist/js/bootstrap.js +2002 -0
- data/vendor/assets/components/bootstrap-sass/dist/js/bootstrap.min.js +9 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/css/docs.css +1195 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/css/pygments-manni.css +66 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/ico/apple-touch-icon-144-precomposed.png +0 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/ico/favicon.png +0 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/application.js +103 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/customizer.js +332 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/filesaver.js +169 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/holder.js +404 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/ie8-responsive-file-warning.js +12 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/jszip.js +1467 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/less.js +9 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/raw-files.js +3 -0
- data/vendor/assets/components/bootstrap-sass/docs-assets/js/uglify.js +14 -0
- data/vendor/assets/components/bootstrap-sass/examples/carousel/carousel.css +148 -0
- data/vendor/assets/components/bootstrap-sass/examples/carousel/index.html +206 -0
- data/vendor/assets/components/bootstrap-sass/examples/grid/grid.css +28 -0
- data/vendor/assets/components/bootstrap-sass/examples/grid/index.html +148 -0
- data/vendor/assets/components/bootstrap-sass/examples/jumbotron/index.html +99 -0
- data/vendor/assets/components/bootstrap-sass/examples/jumbotron/jumbotron.css +5 -0
- data/vendor/assets/components/bootstrap-sass/examples/jumbotron-narrow/index.html +82 -0
- data/vendor/assets/components/bootstrap-sass/examples/jumbotron-narrow/jumbotron-narrow.css +79 -0
- data/vendor/assets/components/bootstrap-sass/examples/justified-nav/index.html +83 -0
- data/vendor/assets/components/bootstrap-sass/examples/justified-nav/justified-nav.css +88 -0
- data/vendor/assets/components/bootstrap-sass/examples/navbar/index.html +88 -0
- data/vendor/assets/components/bootstrap-sass/examples/navbar/navbar.css +8 -0
- data/vendor/assets/components/bootstrap-sass/examples/navbar-fixed-top/index.html +91 -0
- data/vendor/assets/components/bootstrap-sass/examples/navbar-fixed-top/navbar-fixed-top.css +4 -0
- data/vendor/assets/components/bootstrap-sass/examples/navbar-static-top/index.html +92 -0
- data/vendor/assets/components/bootstrap-sass/examples/navbar-static-top/navbar-static-top.css +7 -0
- data/vendor/assets/components/bootstrap-sass/examples/non-responsive/index.html +101 -0
- data/vendor/assets/components/bootstrap-sass/examples/non-responsive/non-responsive.css +116 -0
- data/vendor/assets/components/bootstrap-sass/examples/offcanvas/index.html +130 -0
- data/vendor/assets/components/bootstrap-sass/examples/offcanvas/offcanvas.css +50 -0
- data/vendor/assets/components/bootstrap-sass/examples/offcanvas/offcanvas.js +5 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/carousel.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/grid.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/jumbotron-narrow.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/jumbotron.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/justified-nav.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/navbar-fixed.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/navbar-static.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/navbar.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/non-responsive.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/offcanvas.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/sign-in.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/starter-template.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/sticky-footer-navbar.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/sticky-footer.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/screenshots/theme.jpg +0 -0
- data/vendor/assets/components/bootstrap-sass/examples/signin/index.html +50 -0
- data/vendor/assets/components/bootstrap-sass/examples/signin/signin.css +40 -0
- data/vendor/assets/components/bootstrap-sass/examples/starter-template/index.html +68 -0
- data/vendor/assets/components/bootstrap-sass/examples/starter-template/starter-template.css +7 -0
- data/vendor/assets/components/bootstrap-sass/examples/sticky-footer/index.html +55 -0
- data/vendor/assets/components/bootstrap-sass/examples/sticky-footer/sticky-footer.css +38 -0
- data/vendor/assets/components/bootstrap-sass/examples/sticky-footer-navbar/index.html +91 -0
- data/vendor/assets/components/bootstrap-sass/examples/sticky-footer-navbar/sticky-footer-navbar.css +45 -0
- data/vendor/assets/components/bootstrap-sass/examples/theme/index.html +384 -0
- data/vendor/assets/components/bootstrap-sass/examples/theme/theme.css +14 -0
- data/vendor/assets/components/bootstrap-sass/fonts/glyphicons-halflings-regular.eot +0 -0
- data/vendor/assets/components/bootstrap-sass/fonts/glyphicons-halflings-regular.svg +229 -0
- data/vendor/assets/components/bootstrap-sass/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/vendor/assets/components/bootstrap-sass/fonts/glyphicons-halflings-regular.woff +0 -0
- data/vendor/assets/components/bootstrap-sass/getting-started.html +1021 -0
- data/vendor/assets/components/bootstrap-sass/index.html +16 -0
- data/vendor/assets/components/bootstrap-sass/javascript.html +1983 -0
- data/vendor/assets/components/bootstrap-sass/js/affix.js +126 -0
- data/vendor/assets/components/bootstrap-sass/js/alert.js +98 -0
- data/vendor/assets/components/bootstrap-sass/js/button.js +109 -0
- data/vendor/assets/components/bootstrap-sass/js/carousel.js +217 -0
- data/vendor/assets/components/bootstrap-sass/js/collapse.js +179 -0
- data/vendor/assets/components/bootstrap-sass/js/dropdown.js +154 -0
- data/vendor/assets/components/bootstrap-sass/js/modal.js +246 -0
- data/vendor/assets/components/bootstrap-sass/js/popover.js +117 -0
- data/vendor/assets/components/bootstrap-sass/js/scrollspy.js +158 -0
- data/vendor/assets/components/bootstrap-sass/js/tab.js +135 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/index.html +52 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/affix.js +25 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/alert.js +62 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/button.js +116 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/carousel.js +87 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/collapse.js +164 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/dropdown.js +219 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/modal.js +196 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/phantom.js +69 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/popover.js +133 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/scrollspy.js +37 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/tab.js +86 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/tooltip.js +437 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/unit/transition.js +13 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/vendor/jquery.js +6 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/vendor/qunit.css +232 -0
- data/vendor/assets/components/bootstrap-sass/js/tests/vendor/qunit.js +1510 -0
- data/vendor/assets/components/bootstrap-sass/js/tooltip.js +386 -0
- data/vendor/assets/components/bootstrap-sass/js/transition.js +56 -0
- data/vendor/assets/components/bootstrap-sass/lib/_alerts.scss +67 -0
- data/vendor/assets/components/bootstrap-sass/lib/_badges.scss +51 -0
- data/vendor/assets/components/bootstrap-sass/lib/_breadcrumbs.scss +23 -0
- data/vendor/assets/components/bootstrap-sass/lib/_button-groups.scss +253 -0
- data/vendor/assets/components/bootstrap-sass/lib/_buttons.scss +158 -0
- data/vendor/assets/components/bootstrap-sass/lib/_carousel.scss +231 -0
- data/vendor/assets/components/bootstrap-sass/lib/_close.scss +35 -0
- data/vendor/assets/components/bootstrap-sass/lib/_code.scss +53 -0
- data/vendor/assets/components/bootstrap-sass/lib/_component-animations.scss +29 -0
- data/vendor/assets/components/bootstrap-sass/lib/_dropdowns.scss +193 -0
- data/vendor/assets/components/bootstrap-sass/lib/_forms.scss +363 -0
- data/vendor/assets/components/bootstrap-sass/lib/_glyphicons.scss +237 -0
- data/vendor/assets/components/bootstrap-sass/lib/_grid.scss +93 -0
- data/vendor/assets/components/bootstrap-sass/lib/_input-groups.scss +136 -0
- data/vendor/assets/components/bootstrap-sass/lib/_jumbotron.scss +40 -0
- data/vendor/assets/components/bootstrap-sass/lib/_labels.scss +58 -0
- data/vendor/assets/components/bootstrap-sass/lib/_list-group.scss +88 -0
- data/vendor/assets/components/bootstrap-sass/lib/_media.scss +56 -0
- data/vendor/assets/components/bootstrap-sass/lib/_mixins.scss +861 -0
- data/vendor/assets/components/bootstrap-sass/lib/_modals.scss +132 -0
- data/vendor/assets/components/bootstrap-sass/lib/_navbar.scss +628 -0
- data/vendor/assets/components/bootstrap-sass/lib/_navs.scss +262 -0
- data/vendor/assets/components/bootstrap-sass/lib/_normalize.scss +406 -0
- data/vendor/assets/components/bootstrap-sass/lib/_pager.scss +55 -0
- data/vendor/assets/components/bootstrap-sass/lib/_pagination.scss +85 -0
- data/vendor/assets/components/bootstrap-sass/lib/_panels.scss +172 -0
- data/vendor/assets/components/bootstrap-sass/lib/_popovers.scss +133 -0
- data/vendor/assets/components/bootstrap-sass/lib/_print.scss +105 -0
- data/vendor/assets/components/bootstrap-sass/lib/_progress-bars.scss +92 -0
- data/vendor/assets/components/bootstrap-sass/lib/_responsive-utilities.scss +198 -0
- data/vendor/assets/components/bootstrap-sass/lib/_scaffolding.scss +119 -0
- data/vendor/assets/components/bootstrap-sass/lib/_tables.scss +244 -0
- data/vendor/assets/components/bootstrap-sass/lib/_theme.scss +247 -0
- data/vendor/assets/components/bootstrap-sass/lib/_thumbnails.scss +32 -0
- data/vendor/assets/components/bootstrap-sass/lib/_tooltip.scss +95 -0
- data/vendor/assets/components/bootstrap-sass/lib/_type.scss +279 -0
- data/vendor/assets/components/bootstrap-sass/lib/_utilities.scss +56 -0
- data/vendor/assets/components/bootstrap-sass/lib/_variables.scss +637 -0
- data/vendor/assets/components/bootstrap-sass/lib/_wells.scss +29 -0
- data/vendor/assets/components/bootstrap-sass/lib/bootstrap.scss +49 -0
- data/vendor/assets/components/bootstrap-sass/package.json +40 -0
- data/vendor/assets/components/jquery/.bower.json +37 -0
- data/vendor/assets/components/jquery/MIT-LICENSE.txt +21 -0
- data/vendor/assets/components/jquery/bower.json +27 -0
- data/vendor/assets/components/jquery/dist/jquery.js +9174 -0
- data/vendor/assets/components/jquery/dist/jquery.min.js +5 -0
- data/vendor/assets/components/jquery/dist/jquery.min.map +1 -0
- data/vendor/assets/components/jquery/src/ajax/jsonp.js +89 -0
- data/vendor/assets/components/jquery/src/ajax/load.js +75 -0
- data/vendor/assets/components/jquery/src/ajax/parseJSON.js +13 -0
- data/vendor/assets/components/jquery/src/ajax/parseXML.js +28 -0
- data/vendor/assets/components/jquery/src/ajax/script.js +64 -0
- data/vendor/assets/components/jquery/src/ajax/var/nonce.js +5 -0
- data/vendor/assets/components/jquery/src/ajax/var/rquery.js +3 -0
- data/vendor/assets/components/jquery/src/ajax/xhr.js +135 -0
- data/vendor/assets/components/jquery/src/ajax.js +806 -0
- data/vendor/assets/components/jquery/src/attributes/attr.js +143 -0
- data/vendor/assets/components/jquery/src/attributes/classes.js +158 -0
- data/vendor/assets/components/jquery/src/attributes/prop.js +96 -0
- data/vendor/assets/components/jquery/src/attributes/support.js +35 -0
- data/vendor/assets/components/jquery/src/attributes/val.js +163 -0
- data/vendor/assets/components/jquery/src/attributes.js +11 -0
- data/vendor/assets/components/jquery/src/callbacks.js +205 -0
- data/vendor/assets/components/jquery/src/core/access.js +60 -0
- data/vendor/assets/components/jquery/src/core/init.js +123 -0
- data/vendor/assets/components/jquery/src/core/parseHTML.js +39 -0
- data/vendor/assets/components/jquery/src/core/ready.js +97 -0
- data/vendor/assets/components/jquery/src/core/var/rsingleTag.js +4 -0
- data/vendor/assets/components/jquery/src/core.js +498 -0
- data/vendor/assets/components/jquery/src/css/addGetHookIf.js +24 -0
- data/vendor/assets/components/jquery/src/css/curCSS.js +57 -0
- data/vendor/assets/components/jquery/src/css/defaultDisplay.js +70 -0
- data/vendor/assets/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/vendor/assets/components/jquery/src/css/support.js +91 -0
- data/vendor/assets/components/jquery/src/css/swap.js +28 -0
- data/vendor/assets/components/jquery/src/css/var/cssExpand.js +3 -0
- data/vendor/assets/components/jquery/src/css/var/getStyles.js +5 -0
- data/vendor/assets/components/jquery/src/css/var/isHidden.js +13 -0
- data/vendor/assets/components/jquery/src/css/var/rmargin.js +3 -0
- data/vendor/assets/components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/vendor/assets/components/jquery/src/css.js +451 -0
- data/vendor/assets/components/jquery/src/data/Data.js +181 -0
- data/vendor/assets/components/jquery/src/data/accepts.js +20 -0
- data/vendor/assets/components/jquery/src/data/var/data_priv.js +5 -0
- data/vendor/assets/components/jquery/src/data/var/data_user.js +5 -0
- data/vendor/assets/components/jquery/src/data.js +175 -0
- data/vendor/assets/components/jquery/src/deferred.js +149 -0
- data/vendor/assets/components/jquery/src/deprecated.js +13 -0
- data/vendor/assets/components/jquery/src/dimensions.js +50 -0
- data/vendor/assets/components/jquery/src/effects/Tween.js +114 -0
- data/vendor/assets/components/jquery/src/effects/animatedSelector.js +13 -0
- data/vendor/assets/components/jquery/src/effects.js +647 -0
- data/vendor/assets/components/jquery/src/event/alias.js +39 -0
- data/vendor/assets/components/jquery/src/event/support.js +9 -0
- data/vendor/assets/components/jquery/src/event.js +868 -0
- data/vendor/assets/components/jquery/src/exports/amd.js +24 -0
- data/vendor/assets/components/jquery/src/exports/global.js +32 -0
- data/vendor/assets/components/jquery/src/intro.js +44 -0
- data/vendor/assets/components/jquery/src/jquery.js +36 -0
- data/vendor/assets/components/jquery/src/manipulation/_evalUrl.js +18 -0
- data/vendor/assets/components/jquery/src/manipulation/support.js +31 -0
- data/vendor/assets/components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/vendor/assets/components/jquery/src/manipulation.js +582 -0
- data/vendor/assets/components/jquery/src/offset.js +204 -0
- data/vendor/assets/components/jquery/src/outro.js +1 -0
- data/vendor/assets/components/jquery/src/queue/delay.js +22 -0
- data/vendor/assets/components/jquery/src/queue.js +142 -0
- data/vendor/assets/components/jquery/src/selector-native.js +172 -0
- data/vendor/assets/components/jquery/src/selector-sizzle.js +14 -0
- data/vendor/assets/components/jquery/src/selector.js +1 -0
- data/vendor/assets/components/jquery/src/serialize.js +111 -0
- data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.js +2034 -0
- data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/vendor/assets/components/jquery/src/traversing/findFilter.js +100 -0
- data/vendor/assets/components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/vendor/assets/components/jquery/src/traversing.js +200 -0
- data/vendor/assets/components/jquery/src/var/arr.js +3 -0
- data/vendor/assets/components/jquery/src/var/class2type.js +4 -0
- data/vendor/assets/components/jquery/src/var/concat.js +5 -0
- data/vendor/assets/components/jquery/src/var/hasOwn.js +5 -0
- data/vendor/assets/components/jquery/src/var/indexOf.js +5 -0
- data/vendor/assets/components/jquery/src/var/pnum.js +3 -0
- data/vendor/assets/components/jquery/src/var/push.js +5 -0
- data/vendor/assets/components/jquery/src/var/rnotwhite.js +3 -0
- data/vendor/assets/components/jquery/src/var/slice.js +5 -0
- data/vendor/assets/components/jquery/src/var/strundefined.js +3 -0
- data/vendor/assets/components/jquery/src/var/support.js +4 -0
- data/vendor/assets/components/jquery/src/var/toString.js +5 -0
- data/vendor/assets/components/jquery/src/wrap.js +78 -0
- data/vendor/assets/components/open-sans/.bower.json +36 -0
- data/vendor/assets/components/open-sans/bower.json +27 -0
- data/vendor/assets/components/open-sans/css/open-sans.css +91 -0
- data/vendor/assets/components/open-sans/css/open-sans.min.css +1 -0
- data/vendor/assets/components/open-sans/fonts/bold/opensans-bold-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/bold/opensans-bold-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/bold/opensans-bold-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/bold/opensans-bold-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/bold-italic/opensans-bold-italic-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/bold-italic/opensans-bold-italic-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/bold-italic/opensans-bold-italic-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/bold-italic/opensans-bold-italic-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/extrabold/opensans-extrabold-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/extrabold/opensans-extrabold-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/extrabold/opensans-extrabold-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/extrabold/opensans-extrabold-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/italic/opensans-italic-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/italic/opensans-italic-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/italic/opensans-italic-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/italic/opensans-italic-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/light/opensans-light-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/light/opensans-light-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/light/opensans-light-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/light/opensans-light-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/light-italic/opensans-light-italic-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/light-italic/opensans-light-italic-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/light-italic/opensans-light-italic-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/light-italic/opensans-light-italic-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/regular/opensans-regular-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/regular/opensans-regular-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/regular/opensans-regular-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/regular/opensans-regular-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/semibold/opensans-semibold-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/semibold/opensans-semibold-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/semibold/opensans-semibold-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/semibold/opensans-semibold-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont.eot +0 -0
- data/vendor/assets/components/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont.svg +958 -0
- data/vendor/assets/components/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont.ttf +0 -0
- data/vendor/assets/components/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont.woff +0 -0
- data/vendor/assets/components/open-sans/scss/_base.scss +19 -0
- data/vendor/assets/components/open-sans/scss/_bold-italic.scss +8 -0
- data/vendor/assets/components/open-sans/scss/_bold.scss +4 -0
- data/vendor/assets/components/open-sans/scss/_extrabold-italic.scss +8 -0
- data/vendor/assets/components/open-sans/scss/_extrabold.scss +4 -0
- data/vendor/assets/components/open-sans/scss/_italic.scss +8 -0
- data/vendor/assets/components/open-sans/scss/_light-italic.scss +8 -0
- data/vendor/assets/components/open-sans/scss/_light.scss +4 -0
- data/vendor/assets/components/open-sans/scss/_regular.scss +4 -0
- data/vendor/assets/components/open-sans/scss/_semibold-italic.scss +8 -0
- data/vendor/assets/components/open-sans/scss/_semibold.scss +4 -0
- data/vendor/assets/components/open-sans/scss/open-sans.scss +15 -0
- metadata +795 -0
@@ -0,0 +1,806 @@
|
|
1
|
+
define([
|
2
|
+
"./core",
|
3
|
+
"./var/rnotwhite",
|
4
|
+
"./ajax/var/nonce",
|
5
|
+
"./ajax/var/rquery",
|
6
|
+
"./core/init",
|
7
|
+
"./ajax/parseJSON",
|
8
|
+
"./ajax/parseXML",
|
9
|
+
"./deferred"
|
10
|
+
], function( jQuery, rnotwhite, nonce, rquery ) {
|
11
|
+
|
12
|
+
var
|
13
|
+
// Document location
|
14
|
+
ajaxLocParts,
|
15
|
+
ajaxLocation,
|
16
|
+
|
17
|
+
rhash = /#.*$/,
|
18
|
+
rts = /([?&])_=[^&]*/,
|
19
|
+
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
|
20
|
+
// #7653, #8125, #8152: local protocol detection
|
21
|
+
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
|
22
|
+
rnoContent = /^(?:GET|HEAD)$/,
|
23
|
+
rprotocol = /^\/\//,
|
24
|
+
rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
|
25
|
+
|
26
|
+
/* Prefilters
|
27
|
+
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
|
28
|
+
* 2) These are called:
|
29
|
+
* - BEFORE asking for a transport
|
30
|
+
* - AFTER param serialization (s.data is a string if s.processData is true)
|
31
|
+
* 3) key is the dataType
|
32
|
+
* 4) the catchall symbol "*" can be used
|
33
|
+
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
|
34
|
+
*/
|
35
|
+
prefilters = {},
|
36
|
+
|
37
|
+
/* Transports bindings
|
38
|
+
* 1) key is the dataType
|
39
|
+
* 2) the catchall symbol "*" can be used
|
40
|
+
* 3) selection will start with transport dataType and THEN go to "*" if needed
|
41
|
+
*/
|
42
|
+
transports = {},
|
43
|
+
|
44
|
+
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
45
|
+
allTypes = "*/".concat("*");
|
46
|
+
|
47
|
+
// #8138, IE may throw an exception when accessing
|
48
|
+
// a field from window.location if document.domain has been set
|
49
|
+
try {
|
50
|
+
ajaxLocation = location.href;
|
51
|
+
} catch( e ) {
|
52
|
+
// Use the href attribute of an A element
|
53
|
+
// since IE will modify it given document.location
|
54
|
+
ajaxLocation = document.createElement( "a" );
|
55
|
+
ajaxLocation.href = "";
|
56
|
+
ajaxLocation = ajaxLocation.href;
|
57
|
+
}
|
58
|
+
|
59
|
+
// Segment location into parts
|
60
|
+
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
61
|
+
|
62
|
+
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
63
|
+
function addToPrefiltersOrTransports( structure ) {
|
64
|
+
|
65
|
+
// dataTypeExpression is optional and defaults to "*"
|
66
|
+
return function( dataTypeExpression, func ) {
|
67
|
+
|
68
|
+
if ( typeof dataTypeExpression !== "string" ) {
|
69
|
+
func = dataTypeExpression;
|
70
|
+
dataTypeExpression = "*";
|
71
|
+
}
|
72
|
+
|
73
|
+
var dataType,
|
74
|
+
i = 0,
|
75
|
+
dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
|
76
|
+
|
77
|
+
if ( jQuery.isFunction( func ) ) {
|
78
|
+
// For each dataType in the dataTypeExpression
|
79
|
+
while ( (dataType = dataTypes[i++]) ) {
|
80
|
+
// Prepend if requested
|
81
|
+
if ( dataType[0] === "+" ) {
|
82
|
+
dataType = dataType.slice( 1 ) || "*";
|
83
|
+
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
|
84
|
+
|
85
|
+
// Otherwise append
|
86
|
+
} else {
|
87
|
+
(structure[ dataType ] = structure[ dataType ] || []).push( func );
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
};
|
92
|
+
}
|
93
|
+
|
94
|
+
// Base inspection function for prefilters and transports
|
95
|
+
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
|
96
|
+
|
97
|
+
var inspected = {},
|
98
|
+
seekingTransport = ( structure === transports );
|
99
|
+
|
100
|
+
function inspect( dataType ) {
|
101
|
+
var selected;
|
102
|
+
inspected[ dataType ] = true;
|
103
|
+
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
|
104
|
+
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
|
105
|
+
if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
|
106
|
+
options.dataTypes.unshift( dataTypeOrTransport );
|
107
|
+
inspect( dataTypeOrTransport );
|
108
|
+
return false;
|
109
|
+
} else if ( seekingTransport ) {
|
110
|
+
return !( selected = dataTypeOrTransport );
|
111
|
+
}
|
112
|
+
});
|
113
|
+
return selected;
|
114
|
+
}
|
115
|
+
|
116
|
+
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
|
117
|
+
}
|
118
|
+
|
119
|
+
// A special extend for ajax options
|
120
|
+
// that takes "flat" options (not to be deep extended)
|
121
|
+
// Fixes #9887
|
122
|
+
function ajaxExtend( target, src ) {
|
123
|
+
var key, deep,
|
124
|
+
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
125
|
+
|
126
|
+
for ( key in src ) {
|
127
|
+
if ( src[ key ] !== undefined ) {
|
128
|
+
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
|
129
|
+
}
|
130
|
+
}
|
131
|
+
if ( deep ) {
|
132
|
+
jQuery.extend( true, target, deep );
|
133
|
+
}
|
134
|
+
|
135
|
+
return target;
|
136
|
+
}
|
137
|
+
|
138
|
+
/* Handles responses to an ajax request:
|
139
|
+
* - finds the right dataType (mediates between content-type and expected dataType)
|
140
|
+
* - returns the corresponding response
|
141
|
+
*/
|
142
|
+
function ajaxHandleResponses( s, jqXHR, responses ) {
|
143
|
+
|
144
|
+
var ct, type, finalDataType, firstDataType,
|
145
|
+
contents = s.contents,
|
146
|
+
dataTypes = s.dataTypes;
|
147
|
+
|
148
|
+
// Remove auto dataType and get content-type in the process
|
149
|
+
while ( dataTypes[ 0 ] === "*" ) {
|
150
|
+
dataTypes.shift();
|
151
|
+
if ( ct === undefined ) {
|
152
|
+
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
// Check if we're dealing with a known content-type
|
157
|
+
if ( ct ) {
|
158
|
+
for ( type in contents ) {
|
159
|
+
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
160
|
+
dataTypes.unshift( type );
|
161
|
+
break;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
// Check to see if we have a response for the expected dataType
|
167
|
+
if ( dataTypes[ 0 ] in responses ) {
|
168
|
+
finalDataType = dataTypes[ 0 ];
|
169
|
+
} else {
|
170
|
+
// Try convertible dataTypes
|
171
|
+
for ( type in responses ) {
|
172
|
+
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
173
|
+
finalDataType = type;
|
174
|
+
break;
|
175
|
+
}
|
176
|
+
if ( !firstDataType ) {
|
177
|
+
firstDataType = type;
|
178
|
+
}
|
179
|
+
}
|
180
|
+
// Or just use first one
|
181
|
+
finalDataType = finalDataType || firstDataType;
|
182
|
+
}
|
183
|
+
|
184
|
+
// If we found a dataType
|
185
|
+
// We add the dataType to the list if needed
|
186
|
+
// and return the corresponding response
|
187
|
+
if ( finalDataType ) {
|
188
|
+
if ( finalDataType !== dataTypes[ 0 ] ) {
|
189
|
+
dataTypes.unshift( finalDataType );
|
190
|
+
}
|
191
|
+
return responses[ finalDataType ];
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
/* Chain conversions given the request and the original response
|
196
|
+
* Also sets the responseXXX fields on the jqXHR instance
|
197
|
+
*/
|
198
|
+
function ajaxConvert( s, response, jqXHR, isSuccess ) {
|
199
|
+
var conv2, current, conv, tmp, prev,
|
200
|
+
converters = {},
|
201
|
+
// Work with a copy of dataTypes in case we need to modify it for conversion
|
202
|
+
dataTypes = s.dataTypes.slice();
|
203
|
+
|
204
|
+
// Create converters map with lowercased keys
|
205
|
+
if ( dataTypes[ 1 ] ) {
|
206
|
+
for ( conv in s.converters ) {
|
207
|
+
converters[ conv.toLowerCase() ] = s.converters[ conv ];
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
current = dataTypes.shift();
|
212
|
+
|
213
|
+
// Convert to each sequential dataType
|
214
|
+
while ( current ) {
|
215
|
+
|
216
|
+
if ( s.responseFields[ current ] ) {
|
217
|
+
jqXHR[ s.responseFields[ current ] ] = response;
|
218
|
+
}
|
219
|
+
|
220
|
+
// Apply the dataFilter if provided
|
221
|
+
if ( !prev && isSuccess && s.dataFilter ) {
|
222
|
+
response = s.dataFilter( response, s.dataType );
|
223
|
+
}
|
224
|
+
|
225
|
+
prev = current;
|
226
|
+
current = dataTypes.shift();
|
227
|
+
|
228
|
+
if ( current ) {
|
229
|
+
|
230
|
+
// There's only work to do if current dataType is non-auto
|
231
|
+
if ( current === "*" ) {
|
232
|
+
|
233
|
+
current = prev;
|
234
|
+
|
235
|
+
// Convert response if prev dataType is non-auto and differs from current
|
236
|
+
} else if ( prev !== "*" && prev !== current ) {
|
237
|
+
|
238
|
+
// Seek a direct converter
|
239
|
+
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
|
240
|
+
|
241
|
+
// If none found, seek a pair
|
242
|
+
if ( !conv ) {
|
243
|
+
for ( conv2 in converters ) {
|
244
|
+
|
245
|
+
// If conv2 outputs current
|
246
|
+
tmp = conv2.split( " " );
|
247
|
+
if ( tmp[ 1 ] === current ) {
|
248
|
+
|
249
|
+
// If prev can be converted to accepted input
|
250
|
+
conv = converters[ prev + " " + tmp[ 0 ] ] ||
|
251
|
+
converters[ "* " + tmp[ 0 ] ];
|
252
|
+
if ( conv ) {
|
253
|
+
// Condense equivalence converters
|
254
|
+
if ( conv === true ) {
|
255
|
+
conv = converters[ conv2 ];
|
256
|
+
|
257
|
+
// Otherwise, insert the intermediate dataType
|
258
|
+
} else if ( converters[ conv2 ] !== true ) {
|
259
|
+
current = tmp[ 0 ];
|
260
|
+
dataTypes.unshift( tmp[ 1 ] );
|
261
|
+
}
|
262
|
+
break;
|
263
|
+
}
|
264
|
+
}
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
// Apply converter (if not an equivalence)
|
269
|
+
if ( conv !== true ) {
|
270
|
+
|
271
|
+
// Unless errors are allowed to bubble, catch and return them
|
272
|
+
if ( conv && s[ "throws" ] ) {
|
273
|
+
response = conv( response );
|
274
|
+
} else {
|
275
|
+
try {
|
276
|
+
response = conv( response );
|
277
|
+
} catch ( e ) {
|
278
|
+
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
|
279
|
+
}
|
280
|
+
}
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
}
|
285
|
+
|
286
|
+
return { state: "success", data: response };
|
287
|
+
}
|
288
|
+
|
289
|
+
jQuery.extend({
|
290
|
+
|
291
|
+
// Counter for holding the number of active queries
|
292
|
+
active: 0,
|
293
|
+
|
294
|
+
// Last-Modified header cache for next request
|
295
|
+
lastModified: {},
|
296
|
+
etag: {},
|
297
|
+
|
298
|
+
ajaxSettings: {
|
299
|
+
url: ajaxLocation,
|
300
|
+
type: "GET",
|
301
|
+
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
|
302
|
+
global: true,
|
303
|
+
processData: true,
|
304
|
+
async: true,
|
305
|
+
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
|
306
|
+
/*
|
307
|
+
timeout: 0,
|
308
|
+
data: null,
|
309
|
+
dataType: null,
|
310
|
+
username: null,
|
311
|
+
password: null,
|
312
|
+
cache: null,
|
313
|
+
throws: false,
|
314
|
+
traditional: false,
|
315
|
+
headers: {},
|
316
|
+
*/
|
317
|
+
|
318
|
+
accepts: {
|
319
|
+
"*": allTypes,
|
320
|
+
text: "text/plain",
|
321
|
+
html: "text/html",
|
322
|
+
xml: "application/xml, text/xml",
|
323
|
+
json: "application/json, text/javascript"
|
324
|
+
},
|
325
|
+
|
326
|
+
contents: {
|
327
|
+
xml: /xml/,
|
328
|
+
html: /html/,
|
329
|
+
json: /json/
|
330
|
+
},
|
331
|
+
|
332
|
+
responseFields: {
|
333
|
+
xml: "responseXML",
|
334
|
+
text: "responseText",
|
335
|
+
json: "responseJSON"
|
336
|
+
},
|
337
|
+
|
338
|
+
// Data converters
|
339
|
+
// Keys separate source (or catchall "*") and destination types with a single space
|
340
|
+
converters: {
|
341
|
+
|
342
|
+
// Convert anything to text
|
343
|
+
"* text": String,
|
344
|
+
|
345
|
+
// Text to html (true = no transformation)
|
346
|
+
"text html": true,
|
347
|
+
|
348
|
+
// Evaluate text as a json expression
|
349
|
+
"text json": jQuery.parseJSON,
|
350
|
+
|
351
|
+
// Parse text as xml
|
352
|
+
"text xml": jQuery.parseXML
|
353
|
+
},
|
354
|
+
|
355
|
+
// For options that shouldn't be deep extended:
|
356
|
+
// you can add your own custom options here if
|
357
|
+
// and when you create one that shouldn't be
|
358
|
+
// deep extended (see ajaxExtend)
|
359
|
+
flatOptions: {
|
360
|
+
url: true,
|
361
|
+
context: true
|
362
|
+
}
|
363
|
+
},
|
364
|
+
|
365
|
+
// Creates a full fledged settings object into target
|
366
|
+
// with both ajaxSettings and settings fields.
|
367
|
+
// If target is omitted, writes into ajaxSettings.
|
368
|
+
ajaxSetup: function( target, settings ) {
|
369
|
+
return settings ?
|
370
|
+
|
371
|
+
// Building a settings object
|
372
|
+
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
|
373
|
+
|
374
|
+
// Extending ajaxSettings
|
375
|
+
ajaxExtend( jQuery.ajaxSettings, target );
|
376
|
+
},
|
377
|
+
|
378
|
+
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
|
379
|
+
ajaxTransport: addToPrefiltersOrTransports( transports ),
|
380
|
+
|
381
|
+
// Main method
|
382
|
+
ajax: function( url, options ) {
|
383
|
+
|
384
|
+
// If url is an object, simulate pre-1.5 signature
|
385
|
+
if ( typeof url === "object" ) {
|
386
|
+
options = url;
|
387
|
+
url = undefined;
|
388
|
+
}
|
389
|
+
|
390
|
+
// Force options to be an object
|
391
|
+
options = options || {};
|
392
|
+
|
393
|
+
var transport,
|
394
|
+
// URL without anti-cache param
|
395
|
+
cacheURL,
|
396
|
+
// Response headers
|
397
|
+
responseHeadersString,
|
398
|
+
responseHeaders,
|
399
|
+
// timeout handle
|
400
|
+
timeoutTimer,
|
401
|
+
// Cross-domain detection vars
|
402
|
+
parts,
|
403
|
+
// To know if global events are to be dispatched
|
404
|
+
fireGlobals,
|
405
|
+
// Loop variable
|
406
|
+
i,
|
407
|
+
// Create the final options object
|
408
|
+
s = jQuery.ajaxSetup( {}, options ),
|
409
|
+
// Callbacks context
|
410
|
+
callbackContext = s.context || s,
|
411
|
+
// Context for global events is callbackContext if it is a DOM node or jQuery collection
|
412
|
+
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
|
413
|
+
jQuery( callbackContext ) :
|
414
|
+
jQuery.event,
|
415
|
+
// Deferreds
|
416
|
+
deferred = jQuery.Deferred(),
|
417
|
+
completeDeferred = jQuery.Callbacks("once memory"),
|
418
|
+
// Status-dependent callbacks
|
419
|
+
statusCode = s.statusCode || {},
|
420
|
+
// Headers (they are sent all at once)
|
421
|
+
requestHeaders = {},
|
422
|
+
requestHeadersNames = {},
|
423
|
+
// The jqXHR state
|
424
|
+
state = 0,
|
425
|
+
// Default abort message
|
426
|
+
strAbort = "canceled",
|
427
|
+
// Fake xhr
|
428
|
+
jqXHR = {
|
429
|
+
readyState: 0,
|
430
|
+
|
431
|
+
// Builds headers hashtable if needed
|
432
|
+
getResponseHeader: function( key ) {
|
433
|
+
var match;
|
434
|
+
if ( state === 2 ) {
|
435
|
+
if ( !responseHeaders ) {
|
436
|
+
responseHeaders = {};
|
437
|
+
while ( (match = rheaders.exec( responseHeadersString )) ) {
|
438
|
+
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
|
439
|
+
}
|
440
|
+
}
|
441
|
+
match = responseHeaders[ key.toLowerCase() ];
|
442
|
+
}
|
443
|
+
return match == null ? null : match;
|
444
|
+
},
|
445
|
+
|
446
|
+
// Raw string
|
447
|
+
getAllResponseHeaders: function() {
|
448
|
+
return state === 2 ? responseHeadersString : null;
|
449
|
+
},
|
450
|
+
|
451
|
+
// Caches the header
|
452
|
+
setRequestHeader: function( name, value ) {
|
453
|
+
var lname = name.toLowerCase();
|
454
|
+
if ( !state ) {
|
455
|
+
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
|
456
|
+
requestHeaders[ name ] = value;
|
457
|
+
}
|
458
|
+
return this;
|
459
|
+
},
|
460
|
+
|
461
|
+
// Overrides response content-type header
|
462
|
+
overrideMimeType: function( type ) {
|
463
|
+
if ( !state ) {
|
464
|
+
s.mimeType = type;
|
465
|
+
}
|
466
|
+
return this;
|
467
|
+
},
|
468
|
+
|
469
|
+
// Status-dependent callbacks
|
470
|
+
statusCode: function( map ) {
|
471
|
+
var code;
|
472
|
+
if ( map ) {
|
473
|
+
if ( state < 2 ) {
|
474
|
+
for ( code in map ) {
|
475
|
+
// Lazy-add the new callback in a way that preserves old ones
|
476
|
+
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
|
477
|
+
}
|
478
|
+
} else {
|
479
|
+
// Execute the appropriate callbacks
|
480
|
+
jqXHR.always( map[ jqXHR.status ] );
|
481
|
+
}
|
482
|
+
}
|
483
|
+
return this;
|
484
|
+
},
|
485
|
+
|
486
|
+
// Cancel the request
|
487
|
+
abort: function( statusText ) {
|
488
|
+
var finalText = statusText || strAbort;
|
489
|
+
if ( transport ) {
|
490
|
+
transport.abort( finalText );
|
491
|
+
}
|
492
|
+
done( 0, finalText );
|
493
|
+
return this;
|
494
|
+
}
|
495
|
+
};
|
496
|
+
|
497
|
+
// Attach deferreds
|
498
|
+
deferred.promise( jqXHR ).complete = completeDeferred.add;
|
499
|
+
jqXHR.success = jqXHR.done;
|
500
|
+
jqXHR.error = jqXHR.fail;
|
501
|
+
|
502
|
+
// Remove hash character (#7531: and string promotion)
|
503
|
+
// Add protocol if not provided (prefilters might expect it)
|
504
|
+
// Handle falsy url in the settings object (#10093: consistency with old signature)
|
505
|
+
// We also use the url parameter if available
|
506
|
+
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
|
507
|
+
.replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
|
508
|
+
|
509
|
+
// Alias method option to type as per ticket #12004
|
510
|
+
s.type = options.method || options.type || s.method || s.type;
|
511
|
+
|
512
|
+
// Extract dataTypes list
|
513
|
+
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
|
514
|
+
|
515
|
+
// A cross-domain request is in order when we have a protocol:host:port mismatch
|
516
|
+
if ( s.crossDomain == null ) {
|
517
|
+
parts = rurl.exec( s.url.toLowerCase() );
|
518
|
+
s.crossDomain = !!( parts &&
|
519
|
+
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
|
520
|
+
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
|
521
|
+
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
|
522
|
+
);
|
523
|
+
}
|
524
|
+
|
525
|
+
// Convert data if not already a string
|
526
|
+
if ( s.data && s.processData && typeof s.data !== "string" ) {
|
527
|
+
s.data = jQuery.param( s.data, s.traditional );
|
528
|
+
}
|
529
|
+
|
530
|
+
// Apply prefilters
|
531
|
+
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
532
|
+
|
533
|
+
// If request was aborted inside a prefilter, stop there
|
534
|
+
if ( state === 2 ) {
|
535
|
+
return jqXHR;
|
536
|
+
}
|
537
|
+
|
538
|
+
// We can fire global events as of now if asked to
|
539
|
+
fireGlobals = s.global;
|
540
|
+
|
541
|
+
// Watch for a new set of requests
|
542
|
+
if ( fireGlobals && jQuery.active++ === 0 ) {
|
543
|
+
jQuery.event.trigger("ajaxStart");
|
544
|
+
}
|
545
|
+
|
546
|
+
// Uppercase the type
|
547
|
+
s.type = s.type.toUpperCase();
|
548
|
+
|
549
|
+
// Determine if request has content
|
550
|
+
s.hasContent = !rnoContent.test( s.type );
|
551
|
+
|
552
|
+
// Save the URL in case we're toying with the If-Modified-Since
|
553
|
+
// and/or If-None-Match header later on
|
554
|
+
cacheURL = s.url;
|
555
|
+
|
556
|
+
// More options handling for requests with no content
|
557
|
+
if ( !s.hasContent ) {
|
558
|
+
|
559
|
+
// If data is available, append data to url
|
560
|
+
if ( s.data ) {
|
561
|
+
cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
|
562
|
+
// #9682: remove data so that it's not used in an eventual retry
|
563
|
+
delete s.data;
|
564
|
+
}
|
565
|
+
|
566
|
+
// Add anti-cache in url if needed
|
567
|
+
if ( s.cache === false ) {
|
568
|
+
s.url = rts.test( cacheURL ) ?
|
569
|
+
|
570
|
+
// If there is already a '_' parameter, set its value
|
571
|
+
cacheURL.replace( rts, "$1_=" + nonce++ ) :
|
572
|
+
|
573
|
+
// Otherwise add one to the end
|
574
|
+
cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
|
575
|
+
}
|
576
|
+
}
|
577
|
+
|
578
|
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
579
|
+
if ( s.ifModified ) {
|
580
|
+
if ( jQuery.lastModified[ cacheURL ] ) {
|
581
|
+
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
|
582
|
+
}
|
583
|
+
if ( jQuery.etag[ cacheURL ] ) {
|
584
|
+
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
|
585
|
+
}
|
586
|
+
}
|
587
|
+
|
588
|
+
// Set the correct header, if data is being sent
|
589
|
+
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
590
|
+
jqXHR.setRequestHeader( "Content-Type", s.contentType );
|
591
|
+
}
|
592
|
+
|
593
|
+
// Set the Accepts header for the server, depending on the dataType
|
594
|
+
jqXHR.setRequestHeader(
|
595
|
+
"Accept",
|
596
|
+
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
|
597
|
+
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
|
598
|
+
s.accepts[ "*" ]
|
599
|
+
);
|
600
|
+
|
601
|
+
// Check for headers option
|
602
|
+
for ( i in s.headers ) {
|
603
|
+
jqXHR.setRequestHeader( i, s.headers[ i ] );
|
604
|
+
}
|
605
|
+
|
606
|
+
// Allow custom headers/mimetypes and early abort
|
607
|
+
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
608
|
+
// Abort if not done already and return
|
609
|
+
return jqXHR.abort();
|
610
|
+
}
|
611
|
+
|
612
|
+
// aborting is no longer a cancellation
|
613
|
+
strAbort = "abort";
|
614
|
+
|
615
|
+
// Install callbacks on deferreds
|
616
|
+
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
617
|
+
jqXHR[ i ]( s[ i ] );
|
618
|
+
}
|
619
|
+
|
620
|
+
// Get transport
|
621
|
+
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
622
|
+
|
623
|
+
// If no transport, we auto-abort
|
624
|
+
if ( !transport ) {
|
625
|
+
done( -1, "No Transport" );
|
626
|
+
} else {
|
627
|
+
jqXHR.readyState = 1;
|
628
|
+
|
629
|
+
// Send global event
|
630
|
+
if ( fireGlobals ) {
|
631
|
+
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
632
|
+
}
|
633
|
+
// Timeout
|
634
|
+
if ( s.async && s.timeout > 0 ) {
|
635
|
+
timeoutTimer = setTimeout(function() {
|
636
|
+
jqXHR.abort("timeout");
|
637
|
+
}, s.timeout );
|
638
|
+
}
|
639
|
+
|
640
|
+
try {
|
641
|
+
state = 1;
|
642
|
+
transport.send( requestHeaders, done );
|
643
|
+
} catch ( e ) {
|
644
|
+
// Propagate exception as error if not done
|
645
|
+
if ( state < 2 ) {
|
646
|
+
done( -1, e );
|
647
|
+
// Simply rethrow otherwise
|
648
|
+
} else {
|
649
|
+
throw e;
|
650
|
+
}
|
651
|
+
}
|
652
|
+
}
|
653
|
+
|
654
|
+
// Callback for when everything is done
|
655
|
+
function done( status, nativeStatusText, responses, headers ) {
|
656
|
+
var isSuccess, success, error, response, modified,
|
657
|
+
statusText = nativeStatusText;
|
658
|
+
|
659
|
+
// Called once
|
660
|
+
if ( state === 2 ) {
|
661
|
+
return;
|
662
|
+
}
|
663
|
+
|
664
|
+
// State is "done" now
|
665
|
+
state = 2;
|
666
|
+
|
667
|
+
// Clear timeout if it exists
|
668
|
+
if ( timeoutTimer ) {
|
669
|
+
clearTimeout( timeoutTimer );
|
670
|
+
}
|
671
|
+
|
672
|
+
// Dereference transport for early garbage collection
|
673
|
+
// (no matter how long the jqXHR object will be used)
|
674
|
+
transport = undefined;
|
675
|
+
|
676
|
+
// Cache response headers
|
677
|
+
responseHeadersString = headers || "";
|
678
|
+
|
679
|
+
// Set readyState
|
680
|
+
jqXHR.readyState = status > 0 ? 4 : 0;
|
681
|
+
|
682
|
+
// Determine if successful
|
683
|
+
isSuccess = status >= 200 && status < 300 || status === 304;
|
684
|
+
|
685
|
+
// Get response data
|
686
|
+
if ( responses ) {
|
687
|
+
response = ajaxHandleResponses( s, jqXHR, responses );
|
688
|
+
}
|
689
|
+
|
690
|
+
// Convert no matter what (that way responseXXX fields are always set)
|
691
|
+
response = ajaxConvert( s, response, jqXHR, isSuccess );
|
692
|
+
|
693
|
+
// If successful, handle type chaining
|
694
|
+
if ( isSuccess ) {
|
695
|
+
|
696
|
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
697
|
+
if ( s.ifModified ) {
|
698
|
+
modified = jqXHR.getResponseHeader("Last-Modified");
|
699
|
+
if ( modified ) {
|
700
|
+
jQuery.lastModified[ cacheURL ] = modified;
|
701
|
+
}
|
702
|
+
modified = jqXHR.getResponseHeader("etag");
|
703
|
+
if ( modified ) {
|
704
|
+
jQuery.etag[ cacheURL ] = modified;
|
705
|
+
}
|
706
|
+
}
|
707
|
+
|
708
|
+
// if no content
|
709
|
+
if ( status === 204 || s.type === "HEAD" ) {
|
710
|
+
statusText = "nocontent";
|
711
|
+
|
712
|
+
// if not modified
|
713
|
+
} else if ( status === 304 ) {
|
714
|
+
statusText = "notmodified";
|
715
|
+
|
716
|
+
// If we have data, let's convert it
|
717
|
+
} else {
|
718
|
+
statusText = response.state;
|
719
|
+
success = response.data;
|
720
|
+
error = response.error;
|
721
|
+
isSuccess = !error;
|
722
|
+
}
|
723
|
+
} else {
|
724
|
+
// We extract error from statusText
|
725
|
+
// then normalize statusText and status for non-aborts
|
726
|
+
error = statusText;
|
727
|
+
if ( status || !statusText ) {
|
728
|
+
statusText = "error";
|
729
|
+
if ( status < 0 ) {
|
730
|
+
status = 0;
|
731
|
+
}
|
732
|
+
}
|
733
|
+
}
|
734
|
+
|
735
|
+
// Set data for the fake xhr object
|
736
|
+
jqXHR.status = status;
|
737
|
+
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
|
738
|
+
|
739
|
+
// Success/Error
|
740
|
+
if ( isSuccess ) {
|
741
|
+
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
742
|
+
} else {
|
743
|
+
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
744
|
+
}
|
745
|
+
|
746
|
+
// Status-dependent callbacks
|
747
|
+
jqXHR.statusCode( statusCode );
|
748
|
+
statusCode = undefined;
|
749
|
+
|
750
|
+
if ( fireGlobals ) {
|
751
|
+
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
|
752
|
+
[ jqXHR, s, isSuccess ? success : error ] );
|
753
|
+
}
|
754
|
+
|
755
|
+
// Complete
|
756
|
+
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
757
|
+
|
758
|
+
if ( fireGlobals ) {
|
759
|
+
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
760
|
+
// Handle the global AJAX counter
|
761
|
+
if ( !( --jQuery.active ) ) {
|
762
|
+
jQuery.event.trigger("ajaxStop");
|
763
|
+
}
|
764
|
+
}
|
765
|
+
}
|
766
|
+
|
767
|
+
return jqXHR;
|
768
|
+
},
|
769
|
+
|
770
|
+
getJSON: function( url, data, callback ) {
|
771
|
+
return jQuery.get( url, data, callback, "json" );
|
772
|
+
},
|
773
|
+
|
774
|
+
getScript: function( url, callback ) {
|
775
|
+
return jQuery.get( url, undefined, callback, "script" );
|
776
|
+
}
|
777
|
+
});
|
778
|
+
|
779
|
+
jQuery.each( [ "get", "post" ], function( i, method ) {
|
780
|
+
jQuery[ method ] = function( url, data, callback, type ) {
|
781
|
+
// shift arguments if data argument was omitted
|
782
|
+
if ( jQuery.isFunction( data ) ) {
|
783
|
+
type = type || callback;
|
784
|
+
callback = data;
|
785
|
+
data = undefined;
|
786
|
+
}
|
787
|
+
|
788
|
+
return jQuery.ajax({
|
789
|
+
url: url,
|
790
|
+
type: method,
|
791
|
+
dataType: type,
|
792
|
+
data: data,
|
793
|
+
success: callback
|
794
|
+
});
|
795
|
+
};
|
796
|
+
});
|
797
|
+
|
798
|
+
// Attach a bunch of functions for handling common AJAX events
|
799
|
+
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
|
800
|
+
jQuery.fn[ type ] = function( fn ) {
|
801
|
+
return this.on( type, fn );
|
802
|
+
};
|
803
|
+
});
|
804
|
+
|
805
|
+
return jQuery;
|
806
|
+
});
|