From feeb4c35fb8ccca632863ebfcbdee877d72d992a Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Wed, 6 Nov 2019 22:10:12 -0500 Subject: [PATCH] Convert to Hugo based docuapi --- .editorconfig | 4 +- .gitignore | 27 +- .gitmodules | 3 + .hugo/version | 1 + CHANGELOG.md | 162 - CODE_OF_CONDUCT.md | 46 - Gemfile | 11 - Gemfile.lock | 129 - Vagrantfile | 44 - assets/scss/slate/docuapi_overrides.scss | 129 + config.rb | 58 - config.toml | 56 + content/100-getstarted.md | 14 + content/101-authentication.md | 34 + content/102-verbs.md | 15 + .../103-responses.md | 87 +- .../200-administration.md | 8 +- content/201-service-connections.md | 72 + .../202-organizations.md | 115 +- .../_users.md => content/203-users.md | 123 +- .../204-environments.md | 127 +- content/205-usage.md | 75 + .../_compute.md => content/300-compute.md | 14 +- content/400-compute.md | 6 + .../_instances.md => content/401-instances.md | 350 +- content/402-templates.md | 105 + .../_ssh_keys.md => content/403-ssh-keys.md | 40 +- content/404-affinity-groups.md | 157 + content/500-networking.md | 6 + .../compute/_vpcs.md => content/501-vpcs.md | 110 +- .../_networks.md => content/502-networks.md | 141 +- .../503-network-acls.md | 179 +- .../504-public-ips.md | 103 +- .../505-port-forwarding-rules.md | 119 +- .../506-load-balancer-rules.md | 164 +- content/507-nics.md | 200 + content/508-remote-access-vpns.md | 85 + .../_vpn_users.md => content/509-vpn-users.md | 32 +- content/510-s2s-vpns.md | 231 + content/600-storage.md | 6 + .../_volumes.md => content/601-volumes.md | 94 +- content/602-snapshots.md | 95 + .../_offerings.md => content/700-offerings.md | 7 +- .../701-vpc-offerings.md | 39 +- .../702-network-offerings.md | 39 +- content/703-compute-offerings.md | 103 + .../704-disk-offerings.md | 43 +- .../compute/_zones.md => content/800-zones.md | 31 +- font-selection.json | 148 - go.mod | 11 + go.sum | 10 + hugow | 437 + layouts/partials/hook_head_end.html | 13 + layouts/partials/hook_left_sidebar_end.html | 7 + lib/multilang.rb | 16 - lib/nesting_unique_head.rb | 22 - lib/toc_data.rb | 31 - lib/unique_head.rb | 24 - source/fonts/slate.eot | Bin 1876 -> 0 bytes source/fonts/slate.svg | 14 - source/fonts/slate.ttf | Bin 1720 -> 0 bytes source/fonts/slate.woff | Bin 1796 -> 0 bytes source/fonts/slate.woff2 | Bin 796 -> 0 bytes source/images/navbar.png | Bin 96 -> 0 bytes source/images/service_environment.png | Bin 27627 -> 0 bytes source/includes/_error_codes.md | 1 - source/includes/_errors.md | 22 - .../administration/_service_connections.md | 72 - source/includes/administration/_usage.md | 70 - source/includes/compute/_affinity_groups.md | 164 - source/includes/compute/_compute.md | 1 - source/includes/compute/_compute_offerings.md | 98 - source/includes/compute/_networking.md | 1 - source/includes/compute/_nics.md | 199 - .../includes/compute/_remote_access_vpns.md | 79 - source/includes/compute/_s2s_vpns.md | 226 - source/includes/compute/_snapshots.md | 90 - source/includes/compute/_storage.md | 1 - source/includes/compute/_templates.md | 97 - source/index.html.md | 52 - source/javascripts/all.js | 2 - source/javascripts/all_nosearch.js | 16 - source/javascripts/app/_lang.js | 180 - source/javascripts/app/_search.js | 98 - source/javascripts/app/_toc.js | 122 - source/javascripts/lib/_energize.js | 169 - source/javascripts/lib/_imagesloaded.min.js | 7 - source/javascripts/lib/_jquery.highlight.js | 108 - source/javascripts/lib/_jquery.js | 10253 ---------------- source/javascripts/lib/_lunr.js | 1910 --- source/layouts/layout.erb | 119 - source/stylesheets/_icon-font.scss | 38 - source/stylesheets/_normalize.scss | 427 - source/stylesheets/_rtl.scss | 140 - source/stylesheets/_variables.scss | 104 - source/stylesheets/print.css.scss | 147 - source/stylesheets/screen.css.scss | 615 - static/.gitkeep | 0 static/_headers | 4 + {source => static}/favicon.png | Bin {source => static}/images/logo.png | Bin themes/docuapi | 1 + 102 files changed, 2862 insertions(+), 17343 deletions(-) create mode 100644 .gitmodules create mode 100644 .hugo/version delete mode 100644 CHANGELOG.md delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 Gemfile delete mode 100644 Gemfile.lock delete mode 100644 Vagrantfile create mode 100644 assets/scss/slate/docuapi_overrides.scss delete mode 100644 config.rb create mode 100644 config.toml create mode 100644 content/100-getstarted.md create mode 100644 content/101-authentication.md create mode 100644 content/102-verbs.md rename source/includes/_getting_started.md => content/103-responses.md (55%) rename source/includes/_administration.md => content/200-administration.md (88%) create mode 100644 content/201-service-connections.md rename source/includes/administration/_organizations.md => content/202-organizations.md (61%) rename source/includes/administration/_users.md => content/203-users.md (64%) rename source/includes/administration/_environments.md => content/204-environments.md (59%) create mode 100644 content/205-usage.md rename source/includes/_compute.md => content/300-compute.md (85%) create mode 100644 content/400-compute.md rename source/includes/compute/_instances.md => content/401-instances.md (52%) create mode 100644 content/402-templates.md rename source/includes/compute/_ssh_keys.md => content/403-ssh-keys.md (52%) create mode 100644 content/404-affinity-groups.md create mode 100644 content/500-networking.md rename source/includes/compute/_vpcs.md => content/501-vpcs.md (60%) rename source/includes/compute/_networks.md => content/502-networks.md (56%) rename source/includes/compute/_network_acls.md => content/503-network-acls.md (52%) rename source/includes/compute/_public_ips.md => content/504-public-ips.md (50%) rename source/includes/compute/_port_forwarding_rules.md => content/505-port-forwarding-rules.md (51%) rename source/includes/compute/_load_balancer_rules.md => content/506-load-balancer-rules.md (51%) create mode 100644 content/507-nics.md create mode 100644 content/508-remote-access-vpns.md rename source/includes/compute/_vpn_users.md => content/509-vpn-users.md (51%) create mode 100644 content/510-s2s-vpns.md create mode 100644 content/600-storage.md rename source/includes/compute/_volumes.md => content/601-volumes.md (64%) create mode 100644 content/602-snapshots.md rename source/includes/compute/_offerings.md => content/700-offerings.md (82%) rename source/includes/compute/_vpc_offerings.md => content/701-vpc-offerings.md (65%) rename source/includes/compute/_network_offerings.md => content/702-network-offerings.md (69%) create mode 100644 content/703-compute-offerings.md rename source/includes/compute/_disk_offerings.md => content/704-disk-offerings.md (59%) rename source/includes/compute/_zones.md => content/800-zones.md (66%) delete mode 100755 font-selection.json create mode 100644 go.mod create mode 100644 go.sum create mode 100755 hugow create mode 100644 layouts/partials/hook_head_end.html create mode 100644 layouts/partials/hook_left_sidebar_end.html delete mode 100644 lib/multilang.rb delete mode 100644 lib/nesting_unique_head.rb delete mode 100644 lib/toc_data.rb delete mode 100644 lib/unique_head.rb delete mode 100644 source/fonts/slate.eot delete mode 100644 source/fonts/slate.svg delete mode 100644 source/fonts/slate.ttf delete mode 100644 source/fonts/slate.woff delete mode 100644 source/fonts/slate.woff2 delete mode 100644 source/images/navbar.png delete mode 100644 source/images/service_environment.png delete mode 100644 source/includes/_error_codes.md delete mode 100644 source/includes/_errors.md delete mode 100644 source/includes/administration/_service_connections.md delete mode 100644 source/includes/administration/_usage.md delete mode 100644 source/includes/compute/_affinity_groups.md delete mode 100644 source/includes/compute/_compute.md delete mode 100644 source/includes/compute/_compute_offerings.md delete mode 100644 source/includes/compute/_networking.md delete mode 100644 source/includes/compute/_nics.md delete mode 100644 source/includes/compute/_remote_access_vpns.md delete mode 100644 source/includes/compute/_s2s_vpns.md delete mode 100644 source/includes/compute/_snapshots.md delete mode 100644 source/includes/compute/_storage.md delete mode 100644 source/includes/compute/_templates.md delete mode 100644 source/index.html.md delete mode 100644 source/javascripts/all.js delete mode 100644 source/javascripts/all_nosearch.js delete mode 100644 source/javascripts/app/_lang.js delete mode 100644 source/javascripts/app/_search.js delete mode 100644 source/javascripts/app/_toc.js delete mode 100644 source/javascripts/lib/_energize.js delete mode 100644 source/javascripts/lib/_imagesloaded.min.js delete mode 100644 source/javascripts/lib/_jquery.highlight.js delete mode 100644 source/javascripts/lib/_jquery.js delete mode 100644 source/javascripts/lib/_lunr.js delete mode 100644 source/layouts/layout.erb delete mode 100644 source/stylesheets/_icon-font.scss delete mode 100644 source/stylesheets/_normalize.scss delete mode 100644 source/stylesheets/_rtl.scss delete mode 100644 source/stylesheets/_variables.scss delete mode 100644 source/stylesheets/print.css.scss delete mode 100644 source/stylesheets/screen.css.scss create mode 100644 static/.gitkeep create mode 100644 static/_headers rename {source => static}/favicon.png (100%) rename {source => static}/images/logo.png (100%) create mode 160000 themes/docuapi diff --git a/.editorconfig b/.editorconfig index b54e172c0db..bcf4e4fef4d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,8 +11,8 @@ indent_style = space indent_size = 2 trim_trailing_whitespace = true -[*.rb] -charset = utf-8 +[*.html] +indent_size = 4 [*.md] trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 10501583560..4a9c8acd0e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,5 @@ -*.gem -*.rbc -.bundle -.config -coverage -InstalledFiles -lib/bundler/man -pkg -rdoc -spec/reports -test/tmp -test/version_tmp -tmp -*.DS_STORE -build/ -.cache -.vagrant -.sass-cache - -# YARD artifacts -.yardoc -_yardoc -doc/ +public/ +resources +.hugo/* +!.hugo/version .idea/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..2546cc14a7e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/docuapi"] + path = themes/docuapi + url = https://github.com/bep/docuapi.git diff --git a/.hugo/version b/.hugo/version new file mode 100644 index 00000000000..e989b78d23a --- /dev/null +++ b/.hugo/version @@ -0,0 +1 @@ +0.59.1/extended diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 218f5caa99e..00000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,162 +0,0 @@ -# Changelog - -## Version 2.3.1 - -*July 5, 2018* - -- Update `sprockets` in `Gemfile.lock` to fix security warnings - -## Version 2.3 - -*July 5, 2018* - -- Allows strikethrough in markdown by default. -- Upgrades jQuery to 3.2.1, thanks to [Tomi Takussaari](https://github.com/TomiTakussaari) -- Fixes invalid HTML in `layout.erb`, thanks to [Eric Scouten](https://github.com/scouten) for pointing out -- Hopefully fixes Vagrant memory issues, thanks to [Petter Blomberg](https://github.com/p-blomberg) for the suggestion -- Cleans HTML in headers before setting `document.title`, thanks to [Dan Levy](https://github.com/justsml) -- Allows trailing whitespace in markdown files, thanks to [Samuel Cousin](https://github.com/kuzyn) -- Fixes pushState/replaceState problems with scrolling not changing the document hash, thanks to [Andrey Fedorov](https://github.com/anfedorov) -- Removes some outdated examples, thanks [@al-tr](https://github.com/al-tr), [Jerome Dahdah](https://github.com/jdahdah), and [Ricardo Castro](https://github.com/mccricardo) -- Fixes `nav-padding` bug, thanks [Jerome Dahdah](https://github.com/jdahdah) -- Code style fixes thanks to [Sebastian Zaremba](https://github.com/vassyz) -- Nokogiri version bump thanks to [Grey Baker](https://github.com/greysteil) -- Fix to default `index.md` text thanks to [Nick Busey](https://github.com/NickBusey) - -Thanks to everyone who contributed to this release! - -## Version 2.2 - -*January 19, 2018* - -- Fixes bugs with some non-roman languages not generating unique headers -- Adds editorconfig, thanks to [Jay Thomas](https://github.com/jaythomas) -- Adds optional `NestingUniqueHeadCounter`, thanks to [Vladimir Morozov](https://github.com/greenhost87) -- Small fixes to typos and language, thx [Emir Ribić](https://github.com/ribice), [Gregor Martynus](https://github.com/gr2m), and [Martius](https://github.com/martiuslim)! -- Adds links to Spectrum chat for questions in README and ISSUE_TEMPLATE - -## Version 2.1 - -*October 30, 2017* - -- Right-to-left text stylesheet option, thanks to [Mohammad Hossein Rabiee](https://github.com/mhrabiee) -- Fix for HTML5 history state bug, thanks to [Zach Toolson](https://github.com/ztoolson) -- Small styling changes, typo fixes, small bug fixes from [Marian Friedmann](https://github.com/rnarian), [Ben Wilhelm](https://github.com/benwilhelm), [Fouad Matin](https://github.com/fouad), [Nicolas Bonduel](https://github.com/NicolasBonduel), [Christian Oliff](https://github.com/coliff) - -Thanks to everyone who submitted PRs for this version! - -## Version 2.0 - -*July 17, 2017* - -- All-new statically generated table of contents - - Should be much faster loading and scrolling for large pages - - Smaller Javascript file sizes - - Avoids the problem with the last link in the ToC not ever highlighting if the section was shorter than the page - - Fixes control-click not opening in a new page - - Automatically updates the HTML title as you scroll -- Updated design - - New default colors! - - New spacings and sizes! - - System-default typefaces, just like GitHub -- Added search input delay on large corpuses to reduce lag -- We even bumped the major version cause hey, why not? -- Various small bug fixes - -Thanks to everyone who helped debug or wrote code for this version! It was a serious community effort, and I couldn't have done it alone. - -## Version 1.5 - -*February 23, 2017* - -- Add [multiple tabs per programming language](https://github.com/lord/slate/wiki/Multiple-language-tabs-per-programming-language) feature -- Upgrade Middleman to add Ruby 1.4.0 compatibility -- Switch default code highlighting color scheme to better highlight JSON -- Various small typo and bug fixes - -## Version 1.4 - -*November 24, 2016* - -- Upgrade Middleman and Rouge gems, should hopefully solve a number of bugs -- Update some links in README -- Fix broken Vagrant startup script -- Fix some problems with deploy.sh help message -- Fix bug with language tabs not hiding properly if no error -- Add `!default` to SASS variables -- Fix bug with logo margin -- Bump tested Ruby versions in .travis.yml - -## Version 1.3.3 - -*June 11, 2016* - -Documentation and example changes. - -## Version 1.3.2 - -*February 3, 2016* - -A small bugfix for slightly incorrect background colors on code samples in some cases. - -## Version 1.3.1 - -*January 31, 2016* - -A small bugfix for incorrect whitespace in code blocks. - -## Version 1.3 - -*January 27, 2016* - -We've upgraded Middleman and a number of other dependencies, which should fix quite a few bugs. - -Instead of `rake build` and `rake deploy`, you should now run `bundle exec middleman build --clean` to build your server, and `./deploy.sh` to deploy it to Github Pages. - -## Version 1.2 - -*June 20, 2015* - -**Fixes:** - -- Remove crash on invalid languages -- Update Tocify to scroll to the highlighted header in the Table of Contents -- Fix variable leak and update search algorithms -- Update Python examples to be valid Python -- Update gems -- More misc. bugfixes of Javascript errors -- Add Dockerfile -- Remove unused gems -- Optimize images, fonts, and generated asset files -- Add chinese font support -- Remove RedCarpet header ID patch -- Update language tabs to not disturb existing query strings - -## Version 1.1 - -*July 27, 2014* - -**Fixes:** - -- Finally, a fix for the redcarpet upgrade bug - -## Version 1.0 - -*July 2, 2014* - -[View Issues](https://github.com/tripit/slate/issues?milestone=1&state=closed) - -**Features:** - -- Responsive designs for phones and tablets -- Started tagging versions - -**Fixes:** - -- Fixed 'unrecognized expression' error -- Fixed #undefined hash bug -- Fixed bug where the current language tab would be unselected -- Fixed bug where tocify wouldn't highlight the current section while searching -- Fixed bug where ids of header tags would have special characters that caused problems -- Updated layout so that pages with disabled search wouldn't load search.js -- Cleaned up Javascript diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index cc17fd98d59..00000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@lord.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 79d41fff6dd..00000000000 --- a/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -ruby '>=2.3.1' -source 'https://rubygems.org' - -# Middleman -gem 'middleman', '~>4.2.1' -gem 'middleman-syntax', '~> 3.0.0' -gem 'middleman-autoprefixer', '~> 2.7.0' -gem 'middleman-sprockets', '~> 4.1.0' -gem 'rouge', '~> 2.0.5' -gem 'redcarpet', '~> 3.4.0' -gem 'nokogiri', '~> 1.8.2' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index eebb95a9694..00000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,129 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (5.0.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.5.0) - public_suffix (~> 2.0, >= 2.0.2) - autoprefixer-rails (6.6.1) - execjs - backports (3.6.8) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) - compass-import-once (1.0.5) - sass (>= 3.2, < 3.5) - concurrent-ruby (1.0.5) - contracts (0.13.0) - dotenv (2.2.0) - erubis (2.7.0) - execjs (2.7.0) - fast_blank (1.0.0) - fastimage (2.0.1) - addressable (~> 2) - ffi (1.9.17) - haml (4.0.7) - tilt - hamster (3.0.0) - concurrent-ruby (~> 1.0) - hashie (3.5.1) - i18n (0.7.0) - kramdown (1.13.2) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - memoist (0.15.0) - middleman (4.2.1) - coffee-script (~> 2.2) - compass-import-once (= 1.0.5) - haml (>= 4.0.5) - kramdown (~> 1.2) - middleman-cli (= 4.2.1) - middleman-core (= 4.2.1) - sass (>= 3.4.0, < 4.0) - middleman-autoprefixer (2.7.1) - autoprefixer-rails (>= 6.5.2, < 7.0.0) - middleman-core (>= 3.3.3) - middleman-cli (4.2.1) - thor (>= 0.17.0, < 2.0) - middleman-core (4.2.1) - activesupport (>= 4.2, < 5.1) - addressable (~> 2.3) - backports (~> 3.6) - bundler (~> 1.1) - contracts (~> 0.13.0) - dotenv - erubis - execjs (~> 2.0) - fast_blank - fastimage (~> 2.0) - hamster (~> 3.0) - hashie (~> 3.4) - i18n (~> 0.7.0) - listen (~> 3.0.0) - memoist (~> 0.14) - padrino-helpers (~> 0.13.0) - parallel - rack (>= 1.4.5, < 3) - sass (>= 3.4) - servolux - tilt (~> 2.0) - uglifier (~> 3.0) - middleman-sprockets (4.1.0) - middleman-core (~> 4.0) - sprockets (>= 3.0) - middleman-syntax (3.0.0) - middleman-core (>= 3.2) - rouge (~> 2.0) - mini_portile2 (2.3.0) - minitest (5.10.1) - nokogiri (1.8.2) - mini_portile2 (~> 2.3.0) - padrino-helpers (0.13.3.3) - i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.13.3.3) - tilt (>= 1.4.1, < 3) - padrino-support (0.13.3.3) - activesupport (>= 3.1) - parallel (1.10.0) - public_suffix (2.0.5) - rack (2.0.5) - rb-fsevent (0.9.8) - rb-inotify (0.9.8) - ffi (>= 0.5.0) - redcarpet (3.4.0) - rouge (2.0.7) - sass (3.4.23) - servolux (0.12.0) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - thor (0.19.4) - thread_safe (0.3.5) - tilt (2.0.6) - tzinfo (1.2.2) - thread_safe (~> 0.1) - uglifier (3.0.4) - execjs (>= 0.3.0, < 3) - -PLATFORMS - ruby - -DEPENDENCIES - middleman (~> 4.2.1) - middleman-autoprefixer (~> 2.7.0) - middleman-sprockets (~> 4.1.0) - middleman-syntax (~> 3.0.0) - nokogiri (~> 1.8.2) - redcarpet (~> 3.4.0) - rouge (~> 2.0.5) - -RUBY VERSION - ruby 2.3.3p222 - -BUNDLED WITH - 1.15.4 diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 6f2444e2133..00000000000 --- a/Vagrantfile +++ /dev/null @@ -1,44 +0,0 @@ -Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/trusty64" - config.vm.network :forwarded_port, guest: 4567, host: 4567 - config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" - end - - config.vm.provision "bootstrap", - type: "shell", - inline: <<-SHELL - sudo apt-add-repository ppa:brightbox/ruby-ng - sudo apt-get update - sudo apt-get install -yq ruby2.4 ruby2.4-dev - sudo apt-get install -yq pkg-config build-essential nodejs git libxml2-dev libxslt-dev - sudo apt-get autoremove -yq - gem2.4 install --no-ri --no-rdoc bundler - SHELL - - # add the local user git config to the vm - config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" - - config.vm.provision "install", - type: "shell", - privileged: false, - inline: <<-SHELL - echo "==============================================" - echo "Installing app dependencies" - cd /vagrant - bundle config build.nokogiri --use-system-libraries - bundle install - SHELL - - config.vm.provision "run", - type: "shell", - privileged: false, - run: "always", - inline: <<-SHELL - echo "==============================================" - echo "Starting up middleman at http://localhost:4567" - echo "If it does not come up, check the ~/middleman.log file for any error messages" - cd /vagrant - bundle exec middleman server --watcher-force-polling --watcher-latency=1 &> ~/middleman.log & - SHELL -end diff --git a/assets/scss/slate/docuapi_overrides.scss b/assets/scss/slate/docuapi_overrides.scss new file mode 100644 index 00000000000..b43e254cdff --- /dev/null +++ b/assets/scss/slate/docuapi_overrides.scss @@ -0,0 +1,129 @@ +// Overrides + +// BACKGROUND COLORS +//////////////////// +// $nav-bg:#393939 !default; +// $examples-bg: #393939 !default; +$nav-bg: #393939 !default; +$examples-bg: #393939 !default; +$code-bg: #292929 !default; +$code-annotation-bg: #1c1c1c !default; +$nav-subitem-bg: #262626 !default; +$nav-active-bg: #b00 !default; +$lang-select-border: #000 !default; +$lang-select-bg: #b00 !default; +$lang-select-active-bg: #292929 !default; // feel free to change this to blue or something +$lang-select-pressed-bg: #292929 !default; // color of language tab bg when mouse is pressed +// $main-bg: #fff !default; +$aside-notice-bg: #8fbcd4 !default; +$aside-warning-bg: #c97a7e !default; +$aside-success-bg: #6ac174 !default; +$search-notice-bg: #c97a7e !default; + + +// TEXT COLORS +//////////////////// +$main-text: #333 !default; // main content text color +$nav-text: #fff !default; +$nav-active-text: #fff !default; +$lang-select-text: #fff !default; // color of unselected language tab text +$lang-select-active-text: #fff !default; // color of selected language tab text +$lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed +$code-link-color: #6d6d6d; +$link-color: #347bb7; + +// SIZES +//////////////////// +$nav-width: 230px !default; // width of the navbar +$examples-width: 40% !default; // portion of the screen taken up by code examples +$logo-margin: 20px !default; // margin between nav items and logo, ignored if search is active +$main-padding: 28px !default; // padding to left and right of content & examples +$nav-padding: 15px !default; // padding to left and right of navbar +$nav-v-padding: 10px !default; // padding used vertically around search boxes and results +$nav-indent: 10px !default; // extra padding for ToC subitems +$code-annotation-padding: 13px !default; // padding inside code annotations +$h1-margin-bottom: 21px !default; // padding under the largest header tags +$tablet-width: 930px !default; // min width before reverting to tablet size +$phone-width: $tablet-width - $nav-width !default; // min width before reverting to mobile size + +// FONTS +//////////////////// +// @import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700&display=swap"); + +// $font-default-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + +%default-font { + font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei", "微软雅黑", STXihei, "华文细黑", sans-serif; + font-size: 13px; +} + +%header-font { + @extend %default-font; + font-weight: bold; +} + +%code-font { + font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif; + font-size: 12px; + line-height: 1.5; +} + +// OTHER +//////////////////// +$nav-active-shadow: #000 !default; +$nav-footer-border-color: #666 !default; +$nav-embossed-border-top: #000 !default; +$nav-embossed-border-bottom: #939393 !default; +$main-embossed-text-shadow: 0px 1px 0px #fff !default; +$search-box-border-color: #666 !default; + + +//////////////////////////////////////////////////////////////////////////////// +// INTERNAL +//////////////////////////////////////////////////////////////////////////////// +// These settings are probably best left alone. +%break-words { + word-break: break-all; + hyphens: auto; +} + + +.toc-h3 { + padding-left: $nav-padding + 2*$nav-indent !important; + font-size: 12px; +} + +.toc-list-h3 { + display: none; + background-color: $nav-subitem-bg; +} + +.toc-h4 { + padding-left: $nav-padding + 3*$nav-indent !important; + font-size: 12px; +} + +.toc-list-h4 { + display: none; + background-color: $nav-subitem-bg; +} + +.method { + display: inline-block; + // padding: .25em .4em; + padding: .5em; + font-size: 75%; + font-weight: 700; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25rem; + transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + color: #fff; + background-color: #6c757d; +} + +.content code { + padding: 5px !important; +} diff --git a/config.rb b/config.rb deleted file mode 100644 index 24887979fea..00000000000 --- a/config.rb +++ /dev/null @@ -1,58 +0,0 @@ -# Unique header generation -require './lib/unique_head.rb' - -# Markdown -set :markdown_engine, :redcarpet -set :markdown, - fenced_code_blocks: true, - smartypants: true, - disable_indented_code_blocks: true, - prettify: true, - strikethrough: true, - tables: true, - with_toc_data: true, - no_intra_emphasis: true, - renderer: UniqueHeadCounter - -# Assets -set :css_dir, 'stylesheets' -set :js_dir, 'javascripts' -set :images_dir, 'images' -set :fonts_dir, 'fonts' - -# Activate the syntax highlighter -activate :syntax -ready do - require './lib/multilang.rb' -end - -activate :sprockets - -activate :autoprefixer do |config| - config.browsers = ['last 2 version', 'Firefox ESR'] - config.cascade = false - config.inline = true -end - -# Github pages require relative links -activate :relative_assets -set :relative_links, true - -# Build Configuration -configure :build do - # If you're having trouble with Middleman hanging, commenting - # out the following two lines has been known to help - activate :minify_css - activate :minify_javascript - # activate :relative_assets - # activate :asset_hash - # activate :gzip -end - -# Deploy Configuration -# If you want Middleman to listen on a different port, you can set that below -set :port, 4567 - -helpers do - require './lib/toc_data.rb' -end diff --git a/config.toml b/config.toml new file mode 100644 index 00000000000..4d5eb38f4ae --- /dev/null +++ b/config.toml @@ -0,0 +1,56 @@ +theme = "docuapi" +languageCode = "en-us" +baseurl = "https://developers.cloud.ca/" +title = "cloud.ca API Documentation" + +disableKinds = ["taxonomyTerm"] + +# Code higlighting settings +pygmentsCodefences = true +pygmentsCodeFencesGuesSsyntax = false +pygmentsOptions = "" +pygmentsStyle = "monokai" +pygmentsUseClasses = false + +defaultContentLanguage = "en" + +[module] + [module.hugoVersion] + [[module.imports]] + path = "github.com/bep/empty-hugo-module" + +[params] + search = true + + # Configure the language example tabs. + [[params.language_tabs]] + key = "go" + name = "Go" + [[params.language_tabs]] + key = "terraform" + name = "Terraform" + [[params.language_tabs]] + key = "cli" + name = "CLI" + [[params.language_tabs]] + key = "shell" + name = "curl" + [[params.language_tabs]] + key = "output" + name = "Output" + +# Languages +[languages] + [languages.en] + languageName = "English" + weight = 2 + title = "cloud.ca API Documentation" + + # Left sidebar footer items. Use HTMl or Markdown. + toc_footers = [ + "Documentation Powered by [DocuAPI](https://github.com/bep/docuapi)" + ] + + [languages.en.blackfriday] + angledQuotes = false + hrefTargetBlank = true diff --git a/content/100-getstarted.md b/content/100-getstarted.md new file mode 100644 index 00000000000..3ed297acb17 --- /dev/null +++ b/content/100-getstarted.md @@ -0,0 +1,14 @@ +--- +weight: 100 +title: Getting started +--- + +# Getting started edited + +The cloud.ca API allows you to manage your environments and provision resources in a simple programmatic way using standard HTTP requests. + +The API is [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer). Responses, successful or not, are returned in [JSON](http://www.json.org/). Request bodies must be [JSON](http://www.json.org/), and should be made over SSL. + +API endpoint: `https://api.cloud.ca/v1` + +We have also developed tools to help consume our APIs. If you use `go`, check out our [library](https://github.com/cloud-ca/go-cloudca). If you use Terraform, check out our [provider](https://github.com/cloud-ca/terraform-cloudca). NB: both are being actively developed, so there is still some functionality missing. diff --git a/content/101-authentication.md b/content/101-authentication.md new file mode 100644 index 00000000000..ca6d0b76156 --- /dev/null +++ b/content/101-authentication.md @@ -0,0 +1,34 @@ +--- +weight: 101 +title: Authentication +--- + +## Authentication + +```go +import "github.com/cloud-ca/go-cloudca" +ccaClient := cca.NewCcaClient("your_api_key") +``` + +```terraform +provider "cloudca" { + api_key = "${var.my_api_key}" +} +``` + +```shell +## To authenticate, add a header +## Make sure to replace `your_api_key` with your API key. +curl "https://api.cloud.ca/v1/organizations" \ + -H "MC-Api-Key: your_api_key" +``` + +API endpoints are secured by the same role-based access control (RBAC) as the cloud.ca portal. To identify who is making the requests, it is required to add a header to your HTTP requests: + +`MC-Api-Key: your_api_key` + + + +The API key is found from the API keys section under the user profile menu. If you don't see cloud.ca API keys section, contact your system administrator as you may not have the permission to see that section. **Your API key carries the same privileges as your cloud.ca account, so be sure to keep it secret**. If you think your API has been compromised, regenerate your API key from the API keys section. diff --git a/content/102-verbs.md b/content/102-verbs.md new file mode 100644 index 00000000000..bd19906748a --- /dev/null +++ b/content/102-verbs.md @@ -0,0 +1,15 @@ +--- +weight: 102 +title: HTTP verbs +--- + +## HTTP verbs + +The cloud.ca API can be used by any tool that is fluent in HTTP. The appropriate HTTP method should be used depending on the desired action. + +Verbs | Purpose +----- | ------- +`GET` | Used to retrieve information about a resource. +`POST` | Used to create (or provision) a new resource or perform an operation on it. +`PUT` | Used to update a resource. +`DELETE` | Used to delete a resource. diff --git a/source/includes/_getting_started.md b/content/103-responses.md similarity index 55% rename from source/includes/_getting_started.md rename to content/103-responses.md index b34db98194e..3e75e9af54b 100644 --- a/source/includes/_getting_started.md +++ b/content/103-responses.md @@ -1,54 +1,12 @@ -# Getting started - -The cloud.ca API allows you to manage your environments and provision resources in a simple programmatic way using standard HTTP requests. - -The API is [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer). Responses, successful or not, are returned in [JSON](http://www.json.org/). Request bodies must be [JSON](http://www.json.org/), and should be made over SSL. - -API endpoint : `https://api.cloud.ca/v1` - -We have also developed tools to help consume our APIs. If you use `go`, check out our [library](https://github.com/cloud-ca/go-cloudca). If you use Terraform, check out our [provider](https://github.com/cloud-ca/terraform-cloudca). NB: both are being actively developed, so there is still some functionality missing. - -## Authentication -```go -import "github.com/cloud-ca/go-cloudca" -ccaClient := cca.NewCcaClient("your_api_key") -``` - -```shell -## To authenticate, add a header -## Make sure to replace `your_api_key` with your API key. -curl "https://api.cloud.ca/v1/organizations" \ - -H "MC-Api-Key: your_api_key" -``` - -```dart -provider "cloudca" { - api_key = "${var.my_api_key}" -} -``` - -API endpoints are secured by the same role-based access control (RBAC) as the cloud.ca portal. To identify who is making the requests, it is required to add a header to your HTTP requests: - -`MC-Api-Key: your_api_key` - - - -The API key is found from the API keys section under the user profile menu. If you don't see cloud.ca API keys section, contact your system administrator as you may not have the permission to see that section. **Your API key carries the same privileges as your cloud.ca account, so be sure to keep it secret**. If you think your API has been compromised, regenerate your API key from the API keys section. - -## HTTP verbs -The cloud.ca API can be used by any tool that is fluent in HTTP. The appropriate HTTP method should be used depending on the desired action. - -Verbs | Purpose ------- | ------- -`GET` | Used to retrieve information about a resource. -`POST` | Used to create (or provision) a new resource or perform an operation on it. -`PUT` | Used to update a resource. -`DELETE` | Used to delete a resource. +--- +weight: 103 +title: Responses +--- ## Responses + ### Success response + + ```shell # Example without tasks ``` -```json + +```output { "data": [ { "_comment" : "JSON representation of first object goes here" }, @@ -77,22 +37,25 @@ Verbs | Purpose ] } ``` + ```shell # Example of compute API call with task ``` -```json + +```output { "taskId": "c2c13744-8610-4012-800a-0907bea110a5", "taskStatus": "PENDING" } ``` + When an API request is successful, the response body will contain the `data` field with the result of the API call. If you're using the [compute API](#compute-api), the `data` field might be empty since most of the operations are asynchronous. The response will contain the `taskId` and `taskStatus` fields so that you can retrieve the result of the operation you executed through the [task API](#tasks) -Attributes |   ---- | --- -`data` | The data field contains the object requested by the API caller -`taskId` | The [task id](#tasks) of an operation executed through the [compute API](#compute-api) -`taskStatus` | The status of a [task](#tasks) of an operation executed through the [compute API](#compute-api) +Attributes | Type | Description +---------- | ---- | ----------- +`data` | Array[string] | The data field contains the object requested by the API caller +`taskId` | string | The [task id](#tasks) of an operation executed through the [compute API](#compute-api) +`taskStatus` | string | The status of a [task](#tasks) of an operation executed through the [compute API](#compute-api) @@ -121,6 +84,7 @@ If the response contains the "errors" field, the request was not If you are not familiar with the cloud.ca API response structures, it would be valuable to read [this](#responses) first. diff --git a/content/201-service-connections.md b/content/201-service-connections.md new file mode 100644 index 00000000000..a4ed79469a6 --- /dev/null +++ b/content/201-service-connections.md @@ -0,0 +1,72 @@ +--- +weight: 201 +title: Service connections +--- + +## Service connections + +Service connections are the services that you can create resources for (e.g. compute, object storage). [Environments](#environments) are created for a specific service which allows you to create and manage resources within that service. + +### List service connections + +GET `/services/connections` + +```json +{ + "data":[{ + "id": "adfbdb51-493b-45b1-8802-3f6327afb9e6", + "serviceCode": "compute-qc", + "name": "Compute - Québec", + "type": "CloudCA", + "status": { + "lastUpdated": "2017-08-15T12:00:00.000Z", + "reachable": true + } + }] +} +``` + +```go +ccaClient := cca.NewCcaClient("your_api_key") +serviceConnection, err := ccaClient.ServiceConnections.List() +``` + +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | The id of the service connection +`serviceCode` | *string* | The service code of the service connection. It is used in the endpoint of the services API. +`name` | *string* | The name of the service connection +`type` | *string* | The type of the service connection. +`status` | *Object* | Status of the service connection. Tells you if the service is up.
*includes*: `lastUpdated`, `reachable` + +### Retrieve a service connection + +GET `/services/connections/:id` + +```json +{ + "data":[{ + "id": "adfbdb51-493b-45b1-8802-3f6327afb9e6", + "serviceCode": "compute-qc", + "name": "Compute - Québec", + "type": "CloudCA", + "status": { + "lastUpdated": "2017-08-15T12:00:00.000Z", + "reachable": true + } + }] +} +``` + +```go +ccaClient := cca.NewCcaClient("your_api_key") +serviceConnections, err := ccaClient.ServiceConnections.Get("[service-connection-id]") +``` + +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | The id of the service connection +`serviceCode` | *string* | The service code of the service connection. It is used in the endpoint of the services API. +`name` | *string* | The name of the service connection +`type` | *string* | The type of the service connection. +`status` | *Object* | Status of the service connection. Tells you if the service is up.
*includes*: `lastUpdated`, `reachable` diff --git a/source/includes/administration/_organizations.md b/content/202-organizations.md similarity index 61% rename from source/includes/administration/_organizations.md rename to content/202-organizations.md index 46e0ebcbe29..fe5b6f3c949 100644 --- a/source/includes/administration/_organizations.md +++ b/content/202-organizations.md @@ -1,11 +1,15 @@ +--- +weight: 202 +title: Organizations +--- + ## Organizations -Organizations are the largest logical grouping of users, environments and resources available in cloud.ca. Each organization is isolated from other organizations. It has its own subdomain (`[entryPoint].cloud.ca`) and is protected by its own customizable system [roles](#roles). An administrator that must manage it's sub-organizations environments or provisioned resources can do so by having the `Access other levels` permission. Additionally, provisioned resource usage is metered at the organization level facilitating cost tracking. +Organizations are the largest logical grouping of users, environments and resources available in cloud.ca. Each organization is isolated from other organizations. It has its own subdomain (`[entryPoint].cloud.ca`) and is protected by its own customizable system [roles](#roles). An administrator that must manage it's sub-organizations environments or provisioned resources can do so by having the `Access other levels` permission. Additionally, provisioned resource usage is metered at the organization level facilitating cost tracking. - ### List organizations -`GET /organizations` +GET `/organizations` Retrieves a list of organizations visible to the caller. In most cases, only the caller's organization will be returned. However if the caller's organization has sub-organizations, and the caller has the `Access other levels` permission, the sub-organizations will be returned as well. @@ -22,6 +26,7 @@ curl "https://api.cloud.ca/v1/organizations" \ # Response body example ``` + ```json { "data": [ @@ -63,24 +68,23 @@ curl "https://api.cloud.ca/v1/organizations" \ } ``` -Attributes |   ----- | ----------- -`id`
*UUID* | --- -`name`
*string* | --- -`entryPoint`
*string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL : `[entryPoint].cloud.ca` -`billableStartDate`
*string* | The billable start date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) of the organization -`isBillable`
*boolean* | If the organization is billable this values is true, false otherwise -`tags`
*Array[string]* | Tags associated to the organization -`parent`
*[Organization](#organizations)* | If the organization is a sub-organization, it will have it's `parent` organization. *includes*:`id`,`name` -`environments`
*Array[[Environment](#environments)]* | The environments belonging to the organization
*includes*: `id` -`roles`
*Array[[Role](#roles)]* | The system and environments roles belonging to the organization
*includes*: `id` -`serviceConnections`
*Array[[ServiceConnection](#service-connections)]* | The services for which the organization is allowed to provision resources
*includes*: `id`,`serviceCode` -`users`
*Array[[User](#users)]* | The users of the organization
*includes*: `id` - - +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | --- +`name` | *string* | --- +`entryPoint` | *string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL : `[entryPoint].cloud.ca` +`billableStartDate` | *string* | The billable start date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) of the organization +`isBillable` | *boolean* | If the organization is billable this values is true, false otherwise +`tags` | *Array[string]* | Tags associated to the organization +`parent` | *[Organization](#organizations)* | If the organization is a sub-organization, it will have it's `parent` organization. *includes*:`id`,`name` +`environments` | *Array[[Environment](#environments)]* | The environments belonging to the organization
*includes*: `id` +`roles` | *Array[[Role](#roles)]* | The system and environments roles belonging to the organization
*includes*: `id` +`serviceConnections` | *Array[[ServiceConnection](#service-connections)]* | The services for which the organization is allowed to provision resources
*includes*: `id`,`serviceCode` +`users` | *Array[[User](#users)]* | The users of the organization
*includes*: `id` + ### Retrieve an organization -`GET /organizations/:id` +GET `/organizations/:id` Retrieve an organization's details @@ -91,6 +95,7 @@ curl "https://api.cloud.ca/v1/organizations/[id]" \ # Response body example ``` + ```json { "data": { @@ -130,24 +135,23 @@ curl "https://api.cloud.ca/v1/organizations/[id]" \ } ``` -Attributes |   ----- | ----------- -`id`
*UUID* | --- -`name`
*string* | --- -`entryPoint`
*string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL :
`[entryPoint].cloud.ca` -`billableStartDate`
*string* | The billable start date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) of the organization -`isBillable`
*boolean* | If the organization is billable this values is true, false otherwise -`tags`
*Array[string]* | Tags associated to the organization -`parent`
*[Organization](#organizations)* | If the organization is a sub-organization, it will have it's `parent` organization. *includes*:`id`,`name` -`environments`
*Array[[Environment](#environments)]* | The environments belonging to the organization
*includes*: `id` -`roles`
*Array[[Role](#roles)]* | The system and environments roles belonging to the organization
*includes*: `id` -`serviceConnections`
*Array[[ServiceConnection](#service-connections)]* | The services for which the organization is allowed to provision resources
*includes*: `id`,`serviceCode` -`users`
*Array[[User](#users)]* | The users of the organization
*includes*: `id` - - +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | --- +`name` | *string* | --- +`entryPoint` | *string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL :
`[entryPoint].cloud.ca` +`billableStartDate` | *string* | The billable start date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) of the organization +`isBillable` | *boolean* | If the organization is billable this values is true, false otherwise +`tags` | *Array[string]* | Tags associated to the organization +`parent` | *[Organization](#organizations)* | If the organization is a sub-organization, it will have it's `parent` organization. *includes*:`id`,`name` +`environments` | *Array[[Environment](#environments)]* | The environments belonging to the organization
*includes*: `id` +`roles` | *Array[[Role](#roles)]* | The system and environments roles belonging to the organization
*includes*: `id` +`serviceConnections` | *Array[[ServiceConnection](#service-connections)]* | The services for which the organization is allowed to provision resources
*includes*: `id`,`serviceCode` +`users` | *Array[[User](#users)]* | The users of the organization
*includes*: `id` + ### Create organization -`POST /organizations` +POST `/organizations` Creates a new organization as a sub-organization of the caller's organization, or a sub-organization of the specified `parent`. The caller requires the `Organizations create` permission. @@ -160,6 +164,7 @@ curl -X POST "https://api.cloud.ca/v1/organizations" \ # Request body example ``` + ```json { "entryPoint":"umbrella", @@ -175,24 +180,23 @@ curl -X POST "https://api.cloud.ca/v1/organizations" \ } ``` -Required |   ----- | ---- -`name`
*string* | The name of the organization. (Add info about restrictions) -`entryPoint`
*string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL : `[entryPoint].cloud.ca` - +Required | Type | Description +-------- | ---- | ----------- +`name` | *string* | The name of the organization. (Add info about restrictions) +`entryPoint` | *string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL : `[entryPoint].cloud.ca` -Optional |   ----- | ---- +Optional | Type | Description +-------- | ---- | ----------- `serviceConnections`
Array[[ServiceConnection](#service-connections)] | A list of service connections for which the organization may provision resources.
*required :*`id` `parent`
[Organization](#organization) | The organization that will be the parent of the new organization. By default, it will default to the caller's organization.
*required :*`id` -##### Returns +**Returns** The responses' `data` field contains the created [organization](#organizations) with it's `id`. - ### Update organization -`PUT /organizations/:id` + +PUT `/organizations/:id` Update an organization. It's parent organization cannot be changed. It can be assigned service connections @@ -205,6 +209,7 @@ curl -X PUT "https://api.cloud.ca/v1/organizations/[id]" \ # Request body example ``` + ```json { "entryPoint":"umbrella", @@ -217,22 +222,22 @@ curl -X PUT "https://api.cloud.ca/v1/organizations/[id]" \ } ``` -Required |   ----- | ---- -`name`
*string* | The name of the organization. (Add info about restrictions) -`entryPoint`
*string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL : `[entryPoint].cloud.ca` +Required | Type | Description +-------- | ---- | ----------- +`name` | *string* | The name of the organization. (Add info about restrictions) +`entryPoint` | *string* | The entry point of the organization is the subdomain of the organization in the cloud.ca URL : `[entryPoint].cloud.ca` -Optional |   ----- | ---- +Optional | Type | Description +-------- | ---- | ----------- `serviceConnections`
Array[[ServiceConnection](#service-connections)] | A list of service connections for which the organization may provision resources. The caller must have access to all connections that are provided. **NB :** Service connection access may be added but not revoked at this time.
*required :* `id` -##### Returns +**Returns** The responses' `data` field contains the updated [organization](#organizations). - ### Delete organization -`DELETE /organizations/:id` + +DELETE `/organizations/:id` Delete an organization. The caller may not delete his own organization. Also, an organization may not be deleted if it has sub-organizations. @@ -242,6 +247,6 @@ curl -X DELETE "https://api.cloud.ca/v1/organizations/[id]" \ -H "MC-Api-Key: your_api_key" ``` -##### Returns +**Returns** Returns an HTTP status code 204, with an empty response body. diff --git a/source/includes/administration/_users.md b/content/203-users.md similarity index 64% rename from source/includes/administration/_users.md rename to content/203-users.md index ddf42aed360..3cad676edfc 100644 --- a/source/includes/administration/_users.md +++ b/content/203-users.md @@ -1,12 +1,15 @@ +--- +weight: 203 +title: Users +--- + ## Users A user account allows users to authenticate to an [organization](#organizations) and to have access to the resources in it. You can restrict user access to the system and environments by assigning them specific [roles](#roles). Additionally, every user is given an API key which is needed to use our APIs. All operations done by users are persisted and can be accessed through the activity log. - - ### List users -`GET /users` +GET `/users` ```shell # Retrieve visible users @@ -16,6 +19,7 @@ curl "https://api.cloud.ca/v1/users" \ # Response body example ``` + ```json { "data":[{ @@ -46,6 +50,7 @@ curl "https://api.cloud.ca/v1/users" \ }] } ``` + ```go ccaClient := cca.NewCcaClient("your_api_key") users, err := ccaClient.Users.List() @@ -53,24 +58,21 @@ users, err := ccaClient.Users.List() Retrieve information about users you have access to. If you want access to other users in your [organization or sub-organizations](#organizations), you will need to be assigned the `Users read` permission. Without this permission, you will only see your own user in the list. -Attributes |   ----------- | ----------- -`id`
*UUID* | The id of the user -`userName`
*string* | The username of the user -`firstName`
*string* | The first name of the user -`lastName`
*string* | The last name of the user -`email`
*string* | The email of the user -`creationDate`
*string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the user was created -`status`
*string* | The current status of the user. -`organization`
*[Organization](#organization)* | The organization to which the user belongs -`roles`
*Array[[Role](#roles)]* | The system and environments roles that are assigned to the user
*includes*: `id`, `name` and `environment.id` - - - +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | The id of the user +`userName` | *string* | The username of the user +`firstName` | *string* | The first name of the user +`lastName` | *string* | The last name of the user +`email` | *string* | The email of the user +`creationDate` | *string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the user was created +`status` | *string* | The current status of the user. +`organization` | *[Organization](#organization)* | The organization to which the user belongs +`roles` | *Array[[Role](#roles)]* | The system and environments roles that are assigned to the user
*includes*: `id`, `name` and `environment.id` ### Retrieve a user -`GET /users/:id` +GET `/users/:id` ```shell # Retrieve visible user @@ -80,6 +82,7 @@ curl "https://api.cloud.ca/v1/users/[user-id]" \ # Response body example ``` + ```json { "data":{ @@ -114,6 +117,7 @@ curl "https://api.cloud.ca/v1/users/[user-id]" \ } } ``` + ```go ccaClient := cca.NewCcaClient("your_api_key") user, err := ccaClient.Users.Get("[user-id]") @@ -121,26 +125,22 @@ user, err := ccaClient.Users.Get("[user-id]") Retrieve information about a specific user. If you want access to other users in your [organization or sub-organizations](#organizations), you will need to be assigned the `Users Read` permission. -Attributes |   ----------- | ----------- -`id`
*UUID* | The id of the user -`userName`
*string* | The username of the user -`firstName`
*string* | The first name of the user -`lastName`
*string* | The last name of the user -`email`
*string* | The email of the user -`creationDate`
*string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the user was created -`status`
*string* | The current status of the user. -`organization`
*[Organization](#organization)* | The organization to which the user belongs -`environments`
*Array[[Environment](#environments)]* | The environments the user is member of
*includes*: `id`, `name` -`roles`
*Array[[Role](#roles)]* | The system and environments roles that are assigned to the user
*includes*: `id`, `name` and `environment.id` - - - - +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | The id of the user +`userName` | *string* | The username of the user +`firstName` | *string* | The first name of the user +`lastName` | *string* | The last name of the user +`email` | *string* | The email of the user +`creationDate` | *string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the user was created +`status` | *string* | The current status of the user. +`organization` | *[Organization](#organization)* | The organization to which the user belongs +`environments` | *Array[[Environment](#environments)]* | The environments the user is member of
*includes*: `id`, `name` +`roles` | *Array[[Role](#roles)]* | The system and environments roles that are assigned to the user
*includes*: `id`, `name` and `environment.id` ### Create user -`POST /users` +POST `/users` ```shell # Create a user @@ -152,6 +152,7 @@ curl -X POST "https://api.cloud.ca/v1/users" \ # Request body example ``` + ```json { "userName": "vader42", @@ -171,29 +172,25 @@ curl -X POST "https://api.cloud.ca/v1/users" \ Create a user in a specific organization. There's two different types of [role](#roles) you can assign to the user. A system role will determine the set of system permissions the user will have. An environment role will give the user access to an environment and will determine what he can see and do in that environment. You will need the `Create a new user` permission to execute this operation. -Required |   --------- | ----------- -`userName`
*string* | Username of the new user. Should be unique across the organization. -`firstName`
*string* | First name of the user -`lastName`
*string* | Last name of the user -`email`
*string* | Email of the user. Should be unique across the organization. +Required | Type | Description +-------- | ---- | ----------- +`userName` | *string* | Username of the new user. Should be unique across the organization. +`firstName` | *string* | First name of the user +`lastName` | *string* | Last name of the user +`email` | *string* | Email of the user. Should be unique across the organization. -Optional |   --------- | ----------- +Optional | Type | Description +-------- | ---- | ----------- `organization`
*[Organization](#organization)* | Organization in which the user will be created. *Defaults to your organization*
*required:* `id` -`roles`
*Array[[Role](#roles)]* | The system and environment roles to give to the user
*required*: `id` +`roles` | *Array[[Role](#roles)]* | The system and environment roles to give to the user
*required*: `id` ##### Returns The responses' `data` field contains the created [user](#users) with it's `id`. - - - - ### Update user -`PUT /users/:id` +PUT `/users/:id` ```shell # Create a user @@ -205,6 +202,7 @@ curl -X PUT "https://api.cloud.ca/v1/users/[user-id]" \ # Request body example ``` + ```json { "userName": "spidey1", @@ -221,25 +219,21 @@ curl -X PUT "https://api.cloud.ca/v1/users/[user-id]" \ Update a specific user. It is important to note that updating the list of roles will override the previous one. You will the `Users update` permission to execute this operation. -Optional |   --------- | ----------- -`userName`
*string* | The new username of the user. Should be unique across the organization. -`firstName`
*string* | The new first name of the user -`lastName`
*string* | The new last name of the user -`email`
*string* | The new email of the user. Should be unique across the organization. -`roles`
*Array[[Role](#roles)]* | The new list of system or environment roles to give to the user. This will override the previous list of roles.
*required*: `id` +Optional | Type | Description +-------- | ---- | ----------- +`userName` | *string* | The new username of the user. Should be unique across the organization. +`firstName` | *string* | The new first name of the user +`lastName` | *string* | The new last name of the user +`email` | *string* | The new email of the user. Should be unique across the organization. +`roles` | *Array[[Role](#roles)]* | The new list of system or environment roles to give to the user. This will override the previous list of roles.
*required*: `id` ##### Returns The responses' `data` field contains the updated [user](#users). - - - - ### Delete user -`DELETE /users/:id` +DELETE `/users/:id` ```shell # Delete a user @@ -251,14 +245,9 @@ curl "https://api.cloud.ca/v1/users/[user-id]" \ Delete a specific user. You will need the `Delete an existing user` permission to execute this operation. - - - - ### Unlock user -`POST /users/:id/unlock` - +POST `/users/:id/unlock` ```shell # Unlock a user that was locked from the system diff --git a/source/includes/administration/_environments.md b/content/204-environments.md similarity index 59% rename from source/includes/administration/_environments.md rename to content/204-environments.md index 09b1433a77b..96bc756a38d 100644 --- a/source/includes/administration/_environments.md +++ b/content/204-environments.md @@ -1,13 +1,15 @@ +--- +weight: 204 +title: Environments +--- + ## Environments Environments allow you to manage resources of a specific service and to manage your [users'](#users) access to them. With [environment roles](#roles), you have tight control of what a user is allowed to do in your environment. A general use case of environments is to split your resources into different [deployment environments](https://en.wikipedia.org/wiki/Deployment_environment) (e.g. dev, staging and production). The advantage is that resources of different deployments are isolated from each other and you can restrict user access to your most critical resources. - - - ### List environments -`GET /environments` +GET `/environments` ```shell # Retrieve visible environments @@ -16,6 +18,7 @@ curl "https://api.cloud.ca/v1/environments" \ # Response body example ``` + ```json { "data": [{ @@ -45,6 +48,7 @@ curl "https://api.cloud.ca/v1/environments" \ }] } ``` + ```go ccaClient := cca.NewCcaClient("your_api_key") environments, err := ccaClient.Environments.List() @@ -52,25 +56,20 @@ environments, err := ccaClient.Environments.List() List environments that you have access to. It will only return environments that you're member of if you're not assigned the `Environments read` permission. - -Attributes |   ----------- | ----------- -`id`
*UUID* | The id of the environment -`name`
*string* | The name of the environment -`description`
*string* | The description of the environment -`membership`
*string* | Type of membership of the environment. (e.g. ALL_ORG_USERS, MANY_USERS) -`creationDate`
*string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the environment was created -`organization`
*[Organization](#organizations)* | The organization of the environment
*includes*: `id`, `name`, `entryPoint` -`serviceConnection`
*[ServiceConnection](#service-connections)* | The service connection of the environment
*includes*: `id`, `name` -`roles`
*Array[[Role](#roles)]* | The roles of the environment with all the users assigned to them.
*includes*: `id`, `name`, `isDefault`, `users.id`, `users.name` - - - - +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | The id of the environment +`name` | *string* | The name of the environment +`description` | *string* | The description of the environment +`membership` | *string* | Type of membership of the environment. (e.g. ALL_ORG_USERS, MANY_USERS) +`creationDate` | *string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the environment was created +`organization` | *[Organization](#organizations)* | The organization of the environment
*includes*: `id`, `name`, `entryPoint` +`serviceConnection` | *[ServiceConnection](#service-connections)* | The service connection of the environment
*includes*: `id`, `name` +`roles` | *Array[[Role](#roles)]* | The roles of the environment with all the users assigned to them.
*includes*: `id`, `name`, `isDefault`, `users.id`, `users.name` ### Retrieve an environment -`GET /environments/:id` +GET `/environments/:id` ```shell # Retrieve visible environment @@ -80,6 +79,7 @@ curl "https://api.cloud.ca/v1/environment/[environment-id]" \ # Response body example ``` + ```json { "data": { @@ -113,6 +113,7 @@ curl "https://api.cloud.ca/v1/environment/[environment-id]" \ } } ``` + ```go ccaClient := cca.NewCcaClient("your_api_key") environment, err := ccaClient.Environments.Get("[environment-id]") @@ -120,24 +121,21 @@ environment, err := ccaClient.Environments.Get("[environment-id]") Retrieve an environment you have access to. You can always retrieve environments that you're member of but to access other environments you will need the `Environments read` permission. -Attributes |   ----------- | ----------- -`id`
*UUID* | The id of the environment -`name`
*string* | The name of the environment -`description`
*string* | The description of the environment -`membership`
*string* | Type of membership of the environment. (e.g. ALL_ORG_USERS, MANY_USERS) -`creationDate`
*string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the environment was created -`organization`
*[Organization](#organizations)* | The organization of the environment
*includes*: `id`, `name`, `entryPoint` -`serviceConnection`
*[ServiceConnection](#service-connections)* | The service connection of the environment
*includes*: `id`, `name` -`users`
*Array[[User](#users)]* | The users that are members of the environment
*includes*: `id`, `username` -`roles`
*Array[[Role](#roles)]* | The roles of the environment with all the users assigned to them.
*includes*: `id`, `name`, `isDefault`, `users.id`, `users.name` - - - +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | The id of the environment +`name` | *string* | The name of the environment +`description` | *string* | The description of the environment +`membership` | *string* | Type of membership of the environment. (e.g. ALL_ORG_USERS, MANY_USERS) +`creationDate` | *string* | The date in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) that the environment was created +`organization` | *[Organization](#organizations)* | The organization of the environment
*includes*: `id`, `name`, `entryPoint` +`serviceConnection` | *[ServiceConnection](#service-connections)* | The service connection of the environment
*includes*: `id`, `name` +`users` | *Array[[User](#users)]* | The users that are members of the environment
*includes*: `id`, `username` +`roles` | *Array[[Role](#roles)]* | The roles of the environment with all the users assigned to them.
*includes*: `id`, `name`, `isDefault`, `users.id`, `users.name` ### Create environment -`POST /environments` +POST `/environments` ```shell # Create an environment @@ -149,6 +147,7 @@ curl -X POST "https://api.cloud.ca/v1/environments" \ # Request body example ``` + ```json { "name": "glados", @@ -169,6 +168,7 @@ curl -X POST "https://api.cloud.ca/v1/environments" \ }] } ``` + ```go ccaClient := cca.NewCcaClient("your_api_key") environment, err := ccaClient.Environments.Create(configuration.Environment{ @@ -188,6 +188,7 @@ environment, err := ccaClient.Environments.Create(configuration.Environment{ }], }) ``` + ```dart resource "cloudca_environment" "my_environment" { service_code = "compute-qc" @@ -198,32 +199,28 @@ resource "cloudca_environment" "my_environment" { read_only_role = ["dr_strange","ancient_one"] } ``` -Create a new environment in a specific service and organization. You will need the `Environments create` permission to execute this operation. -Required |   --------- | ----------- -`name`
*string* | The name of the new environment. Should be unique in the environment and only contain lower case characters, numbers, dashes and underscores. -`description`
*string* | The description of the new environment. -`serviceConnection`
*[ServiceConnection](#service-connections)* | The service connection that the environment should be created in
*required*: `id` +Create a new environment in a specific service and organization. You will need the `Environments create` permission to execute this operation. -Optional |   --------- | ----------- -`organization`
*[Organization](#organizations)* | The organization that the environment should be created in. *Defaults to your organization*
*required*: `id` -`membership`
*string* | Type of membership of the environment. ALL_ORG_USERS will add every user in the organization to this environment with the default role. MANY_USERS will allow you to choose the users you want in the environment and assigned them specific roles. *Defaults to MANY_USERS* -`roles`
*Array[[Role](#roles)]* | The roles of the environment and the users assigned to them. Also, defines the default role of the environment.
*required*: `name`, `users.id`
*optional*: `isDefault` +Required | Type | Description +-------- | ---- | ----------- +`name` | *string* | The name of the new environment. Should be unique in the environment and only contain lower case characters, numbers, dashes and underscores. +`description` | *string* | The description of the new environment. +`serviceConnection` | *[ServiceConnection](#service-connections)* | The service connection that the environment should be created in
*required*: `id` +Optional | Type | Description +-------- | ---- | ----------- +`organization` | *[Organization](#organizations)* | The organization that the environment should be created in. *Defaults to your organization*
*required*: `id` +`membership` | *string* | Type of membership of the environment. ALL_ORG_USERS will add every user in the organization to this environment with the default role. MANY_USERS will allow you to choose the users you want in the environment and assigned them specific roles. *Defaults to MANY_USERS* +`roles` | *Array[[Role](#roles)]* | The roles of the environment and the users assigned to them. Also, defines the default role of the environment.
*required*: `name`, `users.id` | *optional*: `isDefault` -##### Returns +**Returns** The responses' `data` field contains the updated [environment](#environments). - - - - ### Update environment -`PUT /environments/:id` +PUT `/environments/:id` ```shell # Update an environment @@ -234,6 +231,7 @@ curl -X POST "https://api.cloud.ca/v1/environments/[environment-id]" \ # Request body example ``` + ```json { "name": "skynet-beta", @@ -246,6 +244,7 @@ curl -X POST "https://api.cloud.ca/v1/environments/[environment-id]" \ }] } ``` + ```go ccaClient := cca.NewCcaClient("your_api_key") environment, err := ccaClient.Environments.Update(configuration.Environment{ @@ -260,38 +259,32 @@ environment, err := ccaClient.Environments.Update(configuration.Environment{ }) ``` - -Optional |   --------- | ----------- -`name`
*string* | The updated name of the environment. Should be unique in the environment and only contain lower case characters, numbers, dashes and underscores. -`description`
*string* | The updated description of the environment -`membership`
*string* | Type of membership of the environment. ALL_ORG_USERS will add every user in the organization to this environment with the default role. MANY_USERS will allow you to choose the users you want in the environment and assigned them specific roles. *Defaults to MANY_USERS* -`roles`
*Array[[Role](#roles)]* | Update the users roles in the environment. Also, can also update the default role.
*required*: `name`, `users.id`
*optional*: `isDefault` - +Optional | Type | Description +-------- | ---- | ----------- +`name` | *string* | The updated name of the environment. Should be unique in the environment and only contain lower case characters, numbers, dashes and underscores. +`description` | *string* | The updated description of the environment +`membership` | *string* | Type of membership of the environment. ALL_ORG_USERS will add every user in the organization to this environment with the default role. MANY_USERS will allow you to choose the users you want in the environment and assigned them specific roles. *Defaults to MANY_USERS* +`roles` | *Array[[Role](#roles)]* | Update the users roles in the environment. Also, can also update the default role.
*required*: `name`, `users.id` | *optional*: `isDefault` You will need the `Environments update` permission to execute this operation. - - - ### Delete environment -`DELETE /environments/:id` - ```shell # Delete an environment curl "https://api.cloud.ca/v1/environments/[environment-id]" \ -X DELETE -H "MC-Api-Key: your_api_key" - ``` + ```go ccaClient := cca.NewCcaClient("your_api_key") deleted, err := ccaClient.Environments.Delete("[environment-id]") ``` +DELETE `/environments/:id` -Delete a specific environment. You will need a [role](#roles) with the `Delete an existing environment ` permission to execute this operation. +Delete a specific environment. You will need a [role](#roles) with the `Delete an existing environment` permission to execute this operation. -Optional |   ----------------------------|------- -`ruleNumber`
*int* | The relative position of this rule in its ACL -`cidr`
*CIDR* | The network addresses targeted by this rule -`action`
*string* | What to do with traffic matched by this rule. Either Allow or Deny -`protocol`
*string* | The protocols targeted by this rule. TCP, UDP, ICMP, or ALL -`trafficType`
*string* | The direction of traffic targeted by this rule. Either Ingress or Egress -`startPort`
*int* | The start of the port range targeted by this rule -`endPort`
*int* | The end of the port range targeted by this rule -`icmpType`
*int* | ICMP message type -`icmpCode`
*int* | ICMP message error code +Optional | Type | Description +-------- | ---- | ----------- +`ruleNumber` | *int* | The relative position of this rule in its ACL +`cidr` | *CIDR* | The network addresses targeted by this rule +`action` | *string* | What to do with traffic matched by this rule. Either Allow or Deny +`protocol` | *string* | The protocols targeted by this rule. TCP, UDP, ICMP, or ALL +`trafficType` | *string* | The direction of traffic targeted by this rule. Either Ingress or Egress +`startPort` | *int* | The start of the port range targeted by this rule +`endPort` | *int* | The end of the port range targeted by this rule +`icmpType` | *int* | ICMP message type +`icmpCode` | *int* | ICMP message error code -#### Delete a network ACL rule +### Delete a network ACL rule ```shell curl -X DELETE \ @@ -347,6 +350,6 @@ resources, _ := ccaClient.GetResources("compute-on", "test_area") ccaResources := resources.(cloudca.Resources) success, err := ccaResources.NetworkAclRules.Delete("3247167a-e7e7-11e3-9187-06669c0000ad") ``` -DELETE /services/:service_code/:environment_name/networkaclrules/:id +DELETE /services/:service_code/:environment_name/networkaclrules/:id Delete a specific rule of a network ACL. diff --git a/source/includes/compute/_public_ips.md b/content/504-public-ips.md similarity index 50% rename from source/includes/compute/_public_ips.md rename to content/504-public-ips.md index ad0a5ba45ea..1f554227f7c 100644 --- a/source/includes/compute/_public_ips.md +++ b/content/504-public-ips.md @@ -1,6 +1,11 @@ -### Public IPs +--- +weight: 504 +title: Public IPs +--- -#### List public IPs +## Public IPs + +### List public IPs ```shell curl -X GET \ @@ -56,30 +61,30 @@ ccaResources := resources.(cloudca.Resources) publicIps, _ := ccaResources.PublicIps.List() ``` -GET /services/:service_code/:environment_name/publicipaddresses +GET /services/:service_code/:environment_name/publicipaddresses List allocated public IP addresses. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the public IP -`instances`
*Array[[Instance](#instances)]* | The associated [instances](#instances)
*includes*: `id`,`name` -`ipAddress`
*string* | The IP address (e.g. 208.80.154.224) -`networkId`
*UUID* | The associated [network](#networks) id -`networkName`
*string* | The associated [network](#networks) name -`purposes`
*Array[string]* | The list of purposes of the IP address.
*Possible values:* `STATIC_NAT`, `PORT_FORWARDING`, `LOAD_BALANCING`, `SOURCE_NAT` or `SOURCE_NAT` and `VPN` -`state`
*string* | The state of the public IP -`vpcId`
*UUID* | The id of the [VPC](#vpcs) -`vpcName`
*string* | The name of the [VPC](#vpcs) -`zoneId`
*UUID* | The id of the [zone](#zones) -`zoneName`
*string* | The name of the [zone](#zones) +Attributes | Type | Description +---------- | ---- | ----------- +`id` | *UUID* | The id of the public IP +`instances` | *Array[[Instance](#instances)]* | The associated [instances](#instances)
*includes*: `id`,`name` +`ipAddress` | *string* | The IP address (e.g. 208.80.154.224) +`networkId` | *UUID* | The associated [network](#networks) id +`networkName` | *string* | The associated [network](#networks) name +`purposes` | *Array[string]* | The list of purposes of the IP address.
*Possible values:* `STATIC_NAT`, `PORT_FORWARDING`, `LOAD_BALANCING`, `SOURCE_NAT` or `SOURCE_NAT` and `VPN` +`state` | *string* | The state of the public IP +`vpcId` | *UUID* | The id of the [VPC](#vpcs) +`vpcName` | *string* | The name of the [VPC](#vpcs) +`zoneId` | *UUID* | The id of the [zone](#zones) +`zoneName` | *string* | The name of the [zone](#zones) Query Parameters |   ----------- | ----- -`vpc_id`
*UUID* | Filter the list to only retrieve the public IPs in a specific [VPC](#vpcs) -`instance_id`
*UUID* | Filter the list to only retrieve the public IPs associated to a specific [instance](#instances) +--------------- | ---- | ------------ +`vpc_id` | *UUID* | Filter the list to only retrieve the public IPs in a specific [VPC](#vpcs) +`instance_id` | *UUID* | Filter the list to only retrieve the public IPs associated to a specific [instance](#instances) -#### Retrieve a public IP +### Retrieve a public IP ```shell curl -X GET -H "MC-Api-Key: your_api_key" @@ -109,25 +114,25 @@ ccaResources := resources.(cloudca.Resources) publicIp, _ := ccaResources.PublicIps.Get("10001e7d-b4ef-489b-836e-0619a383bc8d") ``` -GET /services/:service_code/:environment_name/publicipaddresses/:id +GET /services/:service_code/:environment_name/publicipaddresses/:id Retrieve a public IP address. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the public IP -`instances`
*Array[[Instance](#instances)]* | The associated [instances](#instances)
*includes*: `id`,`name` -`ipAddress`
*string* | The IP address (e.g. 208.80.154.224) -`networkId`
*UUID* | The associated [network](#networks) id -`networkName`
*string* | The associated [network](#networks) name -`purposes`
*Array[string]* | The list of purposes of the IP address.
*Possible values:* `STATIC_NAT`, `PORT_FORWARDING`, `LOAD_BALANCING`, `SOURCE_NAT` or `SOURCE_NAT` and `VPN` -`state`
*string* | The state of the public IP -`vpcId`
*UUID* | The id of the [VPC](#vpcs) -`vpcName`
*string* | The name of the [VPC](#vpcs) -`zoneId`
*UUID* | The id of the [zone](#zones) -`zoneName`
*string* | The name of the [zone](#zones) - -#### Acquire a public IP +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the public IP +`instances` | *Array[[Instance](#instances)]* | The associated [instances](#instances)
*includes*: `id`,`name` +`ipAddress` | *string* | The IP address (e.g. 208.80.154.224) +`networkId` | *UUID* | The associated [network](#networks) id +`networkName` | *string* | The associated [network](#networks) name +`purposes` | *Array[string]* | The list of purposes of the IP address.
*Possible values:* `STATIC_NAT`, `PORT_FORWARDING`, `LOAD_BALANCING`, `SOURCE_NAT` or `SOURCE_NAT` and `VPN` +`state` | *string* | The state of the public IP +`vpcId` | *UUID* | The id of the [VPC](#vpcs) +`vpcName` | *string* | The name of the [VPC](#vpcs) +`zoneId` | *UUID* | The id of the [zone](#zones) +`zoneName` | *string* | The name of the [zone](#zones) + +### Acquire a public IP ```shell curl -X POST \ @@ -144,16 +149,16 @@ curl -X POST \ } ``` -POST /services/:service_code/:environment_name/publicipaddresses +POST /services/:service_code/:environment_name/publicipaddresses Acquire a public IP address for a [VPC](#vpcs). -Required |   ----------- | ----- -`vpcId`
*UUID* | The id of the [VPC](#vpcs) where to acquire the public IP +Required | Type | Description +-------------- | ---- | ------------ +`vpcId` | *UUID* | The id of the [VPC](#vpcs) where to acquire the public IP -#### Release a public IP +### Release a public IP ```shell curl -X DELETE \ @@ -161,11 +166,11 @@ curl -X DELETE \ "https://api.cloud.ca/v1/services/compute-on/test_area/publicipaddresses/a723b2b1-e343-4ea1-afe0-bf345a99a92b" ``` -DELETE /services/:service_code/:environment_name/publicipaddresses/:id +DELETE /services/:service_code/:environment_name/publicipaddresses/:id Release a public IP. When acquiring a public IP, you are not guaranteed to receive a previously owned public IP, so be careful when releasing public IPs. -#### Enable static NAT +### Enable static NAT ```shell curl -X POST \ @@ -182,15 +187,15 @@ curl -X POST \ } ``` -POST /services/:service_code/:environment_name/publicipaddresses/:id?operation=enableStaticNat +POST /services/:service_code/:environment_name/publicipaddresses/:id?operation=enableStaticNat Enable static NAT on a public IP address. -Required |   ----------- | ----- -`privateIpId`
*string* | The private IP id of the [instance](#instances) which is to be available on that IP. It can also be done on a secondary IP id. +Required | Type | Description +-------------- | ---- | ------------ +`privateIpId` | *string* | The private IP id of the [instance](#instances) which is to be available on that IP. It can also be done on a secondary IP id. -#### Disable static NAT +### Disable static NAT ```shell curl -X POST \ @@ -199,6 +204,6 @@ curl -X POST \ ``` -POST /services/:service_code/:environment_name/publicipaddresses/:id?operation=disableStaticNat +POST /services/:service_code/:environment_name/publicipaddresses/:id?operation=disableStaticNat Disable static NAT on that public IP. diff --git a/source/includes/compute/_port_forwarding_rules.md b/content/505-port-forwarding-rules.md similarity index 51% rename from source/includes/compute/_port_forwarding_rules.md rename to content/505-port-forwarding-rules.md index cb8219dbfc3..48cee22c6f7 100644 --- a/source/includes/compute/_port_forwarding_rules.md +++ b/content/505-port-forwarding-rules.md @@ -1,10 +1,15 @@ -### Port forwarding rules +--- +weight: 505 +title: Port forwarding rules +--- + +## Port forwarding rules Port forwarding allows traffic from external hosts to services offered by applications in your [VPCs](#vpcs). A port forwarding rule is a mapping of public IP ports to [private IP](#nics) ports (i.e. forwards traffic from a public IP to an instance). -#### List port forwarding rules +### List port forwarding rules ```shell curl -X GET \ @@ -42,35 +47,35 @@ ccaResources := resources.(cloudca.Resources) portForwardingRules, err := ccaResources.PortForwardingRules.List() ``` -GET /services/:service_code/:environment_name/portforwardingrules +GET /services/:service_code/:environment_name/portforwardingrules Retrieve a list of all port forwarding rules of an environment. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the port forwarding rule -`ipAddress`
*string* | The ip address of the [public IP](#public-ips) associated to this port forwarding rule -`ipAddressId`
*UUID* | The id of the [public IP](#public-ips) associated to this port forwarding rule -`privatePortStart`
*string* | The start of the private port range -`privatePortEnd`
*string* | The end of the private port range -`publicPortStart`
*string* | The start of the public port range -`publicPortEnd`
*string* | The end of the public port range -`protocol`
*string* | The protocol of the port forwarding rule (e.g. TCP, UDP) -`instanceId`
*UUID* | The id of the [instance](#instances) of the port forwarding rule -`instanceName`
*string* | The name of the [instance](#instances) of the port forwarding rule -`networkId`
*UUID* | The id of the [network](#networks) of the port forwarding rule -`vpcId`
*UUID* | The id of the [VPC](#vpcs) of the port forwarding rule -`privateIp`
*string* | The private IP address of the [instance](#instances) where the traffic will be forwarded -`privateIpId`
*UUID* | The id of private IP address of the [instance](#instances) where traffic will be forwarded - -Query Parameters |   ----------- | ----- -`instance_id`
*UUID* | Filter the list to only retrieve the port forwarding rules of an [instance](#instances) +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the port forwarding rule +`ipAddress` | *string* | The ip address of the [public IP](#public-ips) associated to this port forwarding rule +`ipAddressId` | *UUID* | The id of the [public IP](#public-ips) associated to this port forwarding rule +`privatePortStart` | *string* | The start of the private port range +`privatePortEnd` | *string* | The end of the private port range +`publicPortStart` | *string* | The start of the public port range +`publicPortEnd` | *string* | The end of the public port range +`protocol` | *string* | The protocol of the port forwarding rule (e.g. TCP, UDP) +`instanceId` | *UUID* | The id of the [instance](#instances) of the port forwarding rule +`instanceName` | *string* | The name of the [instance](#instances) of the port forwarding rule +`networkId` | *UUID* | The id of the [network](#networks) of the port forwarding rule +`vpcId` | *UUID* | The id of the [VPC](#vpcs) of the port forwarding rule +`privateIp` | *string* | The private IP address of the [instance](#instances) where the traffic will be forwarded +`privateIpId` | *UUID* | The id of private IP address of the [instance](#instances) where traffic will be forwarded + +Query Parameters | Type | Description +---------------- | ---- | ----------- +`instance_id` | *UUID* | Filter the list to only retrieve the port forwarding rules of an [instance](#instances) -#### Retrieve a port forwarding rule +### Retrieve a port forwarding rule ```shell curl -X GET \ @@ -105,32 +110,32 @@ ccaResources := resources.(cloudca.Resources) portForwardingRule, err := ccaResources.PortForwardingRule.Get("bf145d1e-7beb-42b8-bd2c-1a316aeb9aef") ``` -GET /services/:service_code/:environment_name/portforwardingrules/:id +GET /services/:service_code/:environment_name/portforwardingrules/:id Retrieve information about a port forwarding rule. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the port forwarding rule -`ipAddress`
*string* | The ip address of the [public IP](#public-ips) associated to this port forwarding rule -`ipAddressId`
*UUID* | The id of the [public IP](#public-ips) associated to this port forwarding rule -`privatePortStart`
*string* | The start of the private port range -`privatePortEnd`
*string* | The end of the private port range -`publicPortStart`
*string* | The start of the public port range -`publicPortEnd`
*string* | The end of the public port range -`protocol`
*string* | The protocol of the port forwarding rule (e.g. TCP, UDP) -`instanceId`
*UUID* | The id of the [instance](#instances) of the port forwarding rule -`instanceName`
*string* | The name of the [instance](#instances) of the port forwarding rule -`networkId`
*UUID* | The id of the [network](#networks) of the port forwarding rule -`vpcId`
*UUID* | The id of the [VPC](#vpcs) of the port forwarding rule -`privateIp`
*string* | The private IP address of the [instance](#instances) where requests will be forwarded -`privateIpId`
*UUID* | The id of private IP address of the [instance](#instances) where requests will be forwarded +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the port forwarding rule +`ipAddress` | *string* | The ip address of the [public IP](#public-ips) associated to this port forwarding rule +`ipAddressId` | *UUID* | The id of the [public IP](#public-ips) associated to this port forwarding rule +`privatePortStart` | *string* | The start of the private port range +`privatePortEnd` | *string* | The end of the private port range +`publicPortStart` | *string* | The start of the public port range +`publicPortEnd` | *string* | The end of the public port range +`protocol` | *string* | The protocol of the port forwarding rule (e.g. TCP, UDP) +`instanceId` | *UUID* | The id of the [instance](#instances) of the port forwarding rule +`instanceName` | *string* | The name of the [instance](#instances) of the port forwarding rule +`networkId` | *UUID* | The id of the [network](#networks) of the port forwarding rule +`vpcId` | *UUID* | The id of the [VPC](#vpcs) of the port forwarding rule +`privateIp` | *string* | The private IP address of the [instance](#instances) where requests will be forwarded +`privateIpId` | *UUID* | The id of private IP address of the [instance](#instances) where requests will be forwarded -#### Create a port forwarding rule +### Create a port forwarding rule ```shell @@ -182,29 +187,29 @@ resource "cloudca_port_forwarding_rule" "web_pfr" { } ``` -POST /services/:service_code/:environment_name/portforwardingrules +POST /services/:service_code/:environment_name/portforwardingrules Create a port forwarding rule for a [public IP](#public-ips). -Required |   ------- | ----------- -`ipAddressId`
*UUID* | The id of the [public IP](#public-ips) where the port forwarding should be created -`protocol`
*string* | The protocol (e.g. TCP, UDP) to forward -`privatePortStart`
*string* | The start of the private port range -`privatePortEnd`
*string* | The end of the private port range -`publicPortStart`
*string* | The start of the public port range -`publicPortEnd`
*string* | The end of the public port range +Required | Type | Description +------------ | ---- | ----------- +`ipAddressId` | *UUID* | The id of the [public IP](#public-ips) where the port forwarding should be created +`protocol` | *string* | The protocol (e.g. TCP, UDP) to forward +`privatePortStart` | *string* | The start of the private port range +`privatePortEnd` | *string* | The end of the private port range +`publicPortStart` | *string* | The start of the public port range +`publicPortEnd` | *string* | The end of the public port range -Optional |   ------- | ----------- -`instanceId`
*UUID* | The id of the [instance](#instances) that will have a port forwarded (it will use the default private port) -`privateIpId`
*UUID* | The id of the private IP to forward +Optional | Type | Description +------------ | ---- | ----------- +`instanceId` | *UUID* | The id of the [instance](#instances) that will have a port forwarded (it will use the default private port) +`privateIpId` | *UUID* | The id of the private IP to forward -#### Delete a port forwarding rule +### Delete a port forwarding rule ```shell @@ -221,6 +226,6 @@ ccaResources := resources.(cloudca.Resources) success, err := ccaResources.PortForwardingRules.Delete("7d22b390-cbb3-4df6-96c6-52901ccb63c0") ``` -DELETE /services/:service_code/:environment_name/portforwardingrules/:id +DELETE /services/:service_code/:environment_name/portforwardingrules/:id Delete an existing port forwarding rule. diff --git a/source/includes/compute/_load_balancer_rules.md b/content/506-load-balancer-rules.md similarity index 51% rename from source/includes/compute/_load_balancer_rules.md rename to content/506-load-balancer-rules.md index 6cc0ec805a8..fa82c7ebb4c 100644 --- a/source/includes/compute/_load_balancer_rules.md +++ b/content/506-load-balancer-rules.md @@ -1,8 +1,11 @@ - +--- +weight: 506 +title: Load balancer rules +--- -### Load balancer rules +## Load balancer rules -#### List load balancer rules +### List load balancer rules ```shell curl -X GET \ @@ -48,31 +51,30 @@ resources, _ := ccaClient.GetResources("compute-on", "test_area") ccaResources := resources.(cloudca.Resources) lbrs, err := ccaResources.LoadBalancerRules.List() ``` -GET /services/:service_code/:environment_name/loadbalancerrules?public_ip_id=:public_ip_id +GET /services/:service_code/:environment_name/loadbalancerrules?public_ip_id=:public_ip_id Retrieve a list of load balancer rules. Attributes |   ---------------------------|------- -`id`
*UUID* | The id of the load balancer rule -`name`
*string* | The name of the load balancer rule -`networkId`
*string* | The [network](#networks) id of the load balancer rule -`publicIp`
*UUID* | The [public IP](#public-ips) of this load balancer rule -`publicIpId`
*string* | The id of the [public IP](#public-ips) of this load balancer rule -`publicPort`
*int* | The public port of this load balancer rule -`privatePort`
*int* | The private port of this load balancer rule -`algorithm`
*string* | The algorithm to use for this load balancer rule -`protocol`
*string* | The protocol to load balance -`stickinessMethod`
*string* | The stickiness policy of the load balancer rule -`stickinessPolicyParameters`
*Map[string,string]* | The stickiness policy parameters of the load balancer rule -`instanceIds`
*Array[string]* | The ids of the instances being load balanced - - -Query Parameters |   ----------- | ----- -`public_ip_id`
*UUID* | Filter the list to only retrieve the load balancer rules of a [public IP](#public-ips) - -#### Retrieve a load balancer rule +`id` | *UUID* | The id of the load balancer rule +`name` | *string* | The name of the load balancer rule +`networkId` | *string* | The [network](#networks) id of the load balancer rule +`publicIp` | *UUID* | The [public IP](#public-ips) of this load balancer rule +`publicIpId` | *string* | The id of the [public IP](#public-ips) of this load balancer rule +`publicPort` | *int* | The public port of this load balancer rule +`privatePort` | *int* | The private port of this load balancer rule +`algorithm` | *string* | The algorithm to use for this load balancer rule +`protocol` | *string* | The protocol to load balance +`stickinessMethod` | *string* | The stickiness policy of the load balancer rule +`stickinessPolicyParameters` | *Map[string,string]* | The stickiness policy parameters of the load balancer rule +`instanceIds` | *Array[string]* | The ids of the instances being load balanced + +Query Parameters | Type | Description +---------------- | ---- | ----------- +`public_ip_id` | *UUID* | Filter the list to only retrieve the load balancer rules of a [public IP](#public-ips) + +### Retrieve a load balancer rule ```shell curl -X GET \ @@ -112,26 +114,26 @@ resources, _ := ccaClient.GetResources("compute-on", "test_area") ccaResources := resources.(cloudca.Resources) lbr, err := ccaResources.LoadBalancerRules.Get("736d0c2e-d6b5-43fc-bcf0-732fce9a509e") ``` -GET /services/:service_code/:environment_name/loadbalancerrules/:id +GET /services/:service_code/:environment_name/loadbalancerrules/:id Retrieve a specific load balancer rule by its id. -Attributes |   ----------------------------|------- -`id`
*UUID* | The id of the load balancer rule -`name`
*string* | The name of the load balancer rule -`networkId`
*string* | The [network](#networks) id of the load balancer rule -`publicIp`
*UUID* | The [public IP](#public-ips) of this load balancer rule -`publicIpId`
*string* | The id of the [public IP](#public-ips) of this load balancer rule -`publicPort`
*int* | The public port of this load balancer rule -`privatePort`
*int* | The private port of this load balancer rule -`algorithm`
*string* | The algorithm to use for this load balancer rule -`protocol`
*string* | The protocol to load balance -`stickinessMethod`
*string* | The stickiness policy of the load balancer rule -`stickinessPolicyParameters`
*Map[string,string]* | The stickiness policy parameters of the load balancer rule -`instanceIds`
*Array[string]* | The ids of the instances being load balanced - -#### Create a load balancer rule +Attributes | |   +-------------|--------------|------- +`id` | *UUID* | The id of the load balancer rule +`name` | *string* | The name of the load balancer rule +`networkId` | *string* | The [network](#networks) id of the load balancer rule +`publicIp` | *UUID* | The [public IP](#public-ips) of this load balancer rule +`publicIpId` | *string* | The id of the [public IP](#public-ips) of this load balancer rule +`publicPort` | *int* | The public port of this load balancer rule +`privatePort` | *int* | The private port of this load balancer rule +`algorithm` | *string* | The algorithm to use for this load balancer rule +`protocol` | *string* | The protocol to load balance +`stickinessMethod` | *string* | The stickiness policy of the load balancer rule +`stickinessPolicyParameters` | *Map[string,string]* | The stickiness policy parameters of the load balancer rule +`instanceIds` | *Array[string]* | The ids of the instances being load balanced + +### Create a load balancer rule ```shell curl -X POST \ @@ -195,56 +197,56 @@ resource "cloudca_load_balancer_rule" "lbr" { } } ``` -POST /services/:service_code/:environment_name/loadbalancerrules +POST /services/:service_code/:environment_name/loadbalancerrules Create a new load balancer rule associated to a public IP. -Required |   ----------------------------|------- -`name`
*string* | The name of the load balancer rule -`publicIpId`
*string* | The id of the [public IP](#public-ips) of this load balancer rule -`publicPort`
*int* | The public port of this load balancer rule -`privatePort`
*int* | The private port of this load balancer rule -`algorithm`
*string* | The algorithm to use for this load balancer rule (roundrobin, leastconn or source) -`protocol`
*string* | The protocol to load balance (TCP, UDP or TCP-PROXY) +Required | |   +----------|-----------------|------- +`name` | *string* | The name of the load balancer rule +`publicIpId` | *string* | The id of the [public IP](#public-ips) of this load balancer rule +`publicPort` | *int* | The public port of this load balancer rule +`privatePort` | *int* | The private port of this load balancer rule +`algorithm` | *string* | The algorithm to use for this load balancer rule (roundrobin, leastconn or source) +`protocol` | *string* | The protocol to load balance (TCP, UDP or TCP-PROXY) Optional (required if [public IP](#public-ips) already assigned a [network](#networks)) |   ---------------------------|------- -`networkId`
*string* | The [network](#networks) id of the load balancer rule +`networkId` | *string* | The [network](#networks) id of the load balancer rule Optional |   ---------------------------|------- -`stickinessMethod`
*string* | The stickiness policy of the load balancer rule -`stickinessPolicyParameters`
*Map[string, object]* | The stickiness policy parameters of the load balancer rule -`instanceIds`
*Array[string]* | The ids of the instances being load balanced -`sslCertificateId`
*UUID* | The id of the SSL certificate for the load balancer rule. Can only be used with SSL protocol. +`stickinessMethod` | *string* | The stickiness policy of the load balancer rule +`stickinessPolicyParameters` | *Map[string, object]* | The stickiness policy parameters of the load balancer rule +`instanceIds` | *Array[string]* | The ids of the instances being load balanced +`sslCertificateId` | *UUID* | The id of the SSL certificate for the load balancer rule. Can only be used with SSL protocol. LbCookie parameters |   ---------------------------|------- -`cookieName`
*string* | Name of the cookie to be inserted by the load balancer for load balancing -`mode`
*string* | rewrite, insert or prefix. rewrite: This keyword indicates that the cookie will be provided by the server and that the load balancer will have to modify its value to set the server's identifier in it. insert: This keyword indicates that the persistence cookie will have to be inserted by the load balancer in server responses if the client did not already have a cookie that would have permitted it to access this server. prefix: This keyword indicates that instead of relying on a dedicated cookie for the persistence, an existing one will be completed. -`nocache`
*boolean* | This option is recommended in conjunction with the insert mode when there is a cache between the client and the load balancer, as it ensures that a cacheable response will be tagged non-cacheable if a cookie needs to be inserted. -`indirect`
*boolean* | When this option is specified, no cookie will be emitted to a client which already has a valid one for the server which has processed the request. -`postonly`
*boolean* | This option ensures that cookie insertion will only be performed on responses to POST requests. -`domain`
*string* | This option allows to specify the domain at which a cookie is inserted. +`cookieName` | *string* | Name of the cookie to be inserted by the load balancer for load balancing +`mode` | *string* | rewrite, insert or prefix. rewrite: This keyword indicates that the cookie will be provided by the server and that the load balancer will have to modify its value to set the server's identifier in it. insert: This keyword indicates that the persistence cookie will have to be inserted by the load balancer in server responses if the client did not already have a cookie that would have permitted it to access this server. prefix: This keyword indicates that instead of relying on a dedicated cookie for the persistence, an existing one will be completed. +`nocache` | *boolean* | This option is recommended in conjunction with the insert mode when there is a cache between the client and the load balancer, as it ensures that a cacheable response will be tagged non-cacheable if a cookie needs to be inserted. +`indirect` | *boolean* | When this option is specified, no cookie will be emitted to a client which already has a valid one for the server which has processed the request. +`postonly` | *boolean* | This option ensures that cookie insertion will only be performed on responses to POST requests. +`domain` | *string* | This option allows to specify the domain at which a cookie is inserted. AppCookie parameters |   ---------------------------|------- -`cookieName`
*string* | Name of the cookie to be inserted by the application for load balancing. -`mode`
*string* | This option allows to change the URL parser mode. `path-parameters`(default) will look for the appsession cookie in the path parameters. `query-parameters` will look for the appsession cookie in the query parameters. -`length`
*string* | The maximum number of characters to check in the cookie value. -`holdtime`
*boolean* | Time in milliseconds that the cookie should be saved. -`requestLearn`
*boolean* | If true, then it will be able to learn the cookie found in the request in case the server does not specify any in response. -`prefix`
*string* | If true, then it will match on the cookie prefix (or URL parameter prefix). The appsession value is the data following this prefix. +`cookieName` | *string* | Name of the cookie to be inserted by the application for load balancing. +`mode` | *string* | This option allows to change the URL parser mode. `path-parameters`(default) will look for the appsession cookie in the path parameters. `query-parameters` will look for the appsession cookie in the query parameters. +`length` | *string* | The maximum number of characters to check in the cookie value. +`holdtime` | *boolean* | Time in milliseconds that the cookie should be saved. +`requestLearn` | *boolean* | If true, then it will be able to learn the cookie found in the request in case the server does not specify any in response. +`prefix` | *string* | If true, then it will match on the cookie prefix (or URL parameter prefix). The appsession value is the data following this prefix. SourceBased parameters |   ---------------------------|------- -`tableSize`
*string* | The maximum number of entries that can be stored in the table. -`expires`
*string* | Defines the maximum duration of an entry in the table since it was last created, refreshed or matched. The expiration delay is defined using the standard time format, similarly as the various timeouts. +`tableSize` | *string* | The maximum number of entries that can be stored in the table. +`expires` | *string* | Defines the maximum duration of an entry in the table since it was last created, refreshed or matched. The expiration delay is defined using the standard time format, similarly as the various timeouts. For more information, please consult section 4.2 of the HAProxy [configuration manual](https://cbonte.github.io/haproxy-dconv/1.5/configuration.html). ([AppCookie](https://cbonte.github.io/haproxy-dconv/1.5/configuration.html#4.2-appsession), [LbCookie](https://cbonte.github.io/haproxy-dconv/1.5/configuration.html#4.2-cookie), [SourceBased](https://cbonte.github.io/haproxy-dconv/1.5/configuration.html#4.2-stick-table)) -#### Update a load balancer rule +### Update a load balancer rule ```shell curl -X PUT \ @@ -268,16 +270,16 @@ lbr, err := ccaResources.LoadBalancerRules.Update("3247167a-e7e7-11e3-9187-06669 Algorithm: "leastconn", }) ``` -PUT /services/:service_code/:environment_name/loadbalancerrules/:id +PUT /services/:service_code/:environment_name/loadbalancerrules/:id Update a load balancer rule. Optional |   ---------------------------|------- -`name`
*string* | The name of the load balancer rule -`algorithm`
*string* | The algorithm of the load balancer rule (roundrobin, leastconn or source) +`name` | *string* | The name of the load balancer rule +`algorithm` | *string* | The algorithm of the load balancer rule (roundrobin, leastconn or source) -#### Update instances of a load balancer rule +### Update instances of a load balancer rule ```shell curl -X PUT \ @@ -299,15 +301,15 @@ resources, _ := ccaClient.GetResources("compute-on", "test_area") ccaResources := resources.(cloudca.Resources) err := ccaResources.LoadBalancerRules.SetLoadBalancerRuleInstances("3247167a-e7e7-11e3-9187-06669c0000ad", []string {"95d034b5-b902-440c-b430-120efaed9caf"}) ``` -PUT /services/:service_code/:environment_name/loadbalancerrules/:id?operation=updateInstances +PUT /services/:service_code/:environment_name/loadbalancerrules/:id?operation=updateInstances Update instances of a load balancer rule. Required |   ---------------------------|------- -`instanceIds`
*Array[String]* | The instances of the load balancer rule +`instanceIds` | *Array[String]* | The instances of the load balancer rule -#### Update stickiness policy of a load balancer rule +### Update stickiness policy of a load balancer rule ```shell curl -X PUT \ @@ -337,18 +339,18 @@ lbr, err := ccaResources.LoadBalancerRules.SetLoadBalancerRuleStickinessPolicy(" "holdtime": "3600000", }) ``` -PUT /services/:service_code/:environment_name/loadbalancerrules/:id?operation=updateStickiness +PUT /services/:service_code/:environment_name/loadbalancerrules/:id?operation=updateStickiness Update instances of a load balancer rule. Required |   ---------------------------|------- -`stickinessMethod`
*string* | The stickiness policy for the load balancer rule -`stickinessPolicyParameters`
*Map[String, String]* | The parameters for the stickiness policy of the load balancer rule +`stickinessMethod` | *string* | The stickiness policy for the load balancer rule +`stickinessPolicyParameters` | *Map[String, String]* | The parameters for the stickiness policy of the load balancer rule See [Create a load balance rule](#create-a-load-balancer-rule) for stickiness policy parameters documentation. -#### Delete a load balancer rule +### Delete a load balancer rule ```shell curl -X DELETE \ @@ -360,6 +362,6 @@ resources, _ := ccaClient.GetResources("compute-on", "test_area") ccaResources := resources.(cloudca.Resources) success, err := ccaResources.LoadBalancerRules.Delete("736d0c2e-d6b5-43fc-bcf0-732fce9a509e") ``` -DELETE /services/:service_code/:environment_name/loadbalancerrules/:id +DELETE /services/:service_code/:environment_name/loadbalancerrules/:id Delete a load balancer rule. diff --git a/content/507-nics.md b/content/507-nics.md new file mode 100644 index 00000000000..ed91ed937b7 --- /dev/null +++ b/content/507-nics.md @@ -0,0 +1,200 @@ +--- +weight: 507 +title: NICs +--- + +## NICs + +### List NICs + + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/nics" + +# Example response: +``` +```json +{ + "data": [{ + "id": "fff1f45a-8350-4c87-be43-947b96d01ebd", + "name": "NIC-0", + "ipAddress": "10.169.253.165", + "isDefault": true, + "networkId": "d2243d4c-0dd8-4f8c-9ab4-4b1d285d5642", + "networkName": "Backend", + "gateway": "10.169.253.1", + "netmask": "255.255.255.0", + "instanceId": "b6145e8b-abd3ta-456c-832c-f3db86a6acfe", + "vpcId": "5aa9f5d7-55a9-43bf-bd2c-78a6bae1b267", + "vpcName": "default-vpc", + "secondaryIps": [ + { + "id": "9c28e297-5d23-41a3-a167-34dc24f1df19", + "ipAddress": "10.169.253.124" + } + ] + }], + "metadata": { + "recordCount": 1 + } +} +``` + +GET /services/:service_code/:environment_name/nics + +Retrieve a list of all NICs. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the NIC +`name` | *string* | The name of the NIC +`ipAddress` | *string* | The IP address of the NIC +`isDefault` | *string* | true if it's the default NIC of the [instance](#instances) (i.e. it will be the private IP on the instance) +`networkId` | *UUID* | The id of the [network](#networks) of the NIC +`networkName` | *string* | The name of the [network](#networks) of the NIC +`gateway` | *string* | The gateway of the [network](#networks) associated with the NIC +`netmask` | *string* | The netmask of the [network](#networks) associated with the NIC +`instanceId` | *string* | The id of the instance associated with the NIC +`vpcId` | *string* | The id of the [VPC](#vpcs) associated with the NIC +`vpcName` | *string* | The name of the [VPC](#vpcs) associated with the NIC +`secondaryIps` | *SecondaryIP* | The list of secondary IPs of the NIC
*includes:* `id`, `ipAddress` + +Query Parameters |   +-------------- | ---- | ------------ +`instance_id` | *UUID* | Filter the list to only retrieve the NICs of a specific [instance](#instances) +`network_id` | *UUID* | Filter the list to only retrieve the NICs of a specific [network](#networks) + + + + + +### Retrieve a NIC + + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/nics/fff1f45a-8350-4c87-be43-947b96d01ebd" + +# Example response: +``` +```json +{ + "data": { + "id": "fff1f45a-8350-4c87-be43-947b96d01ebd", + "name": "NIC-0", + "ipAddress": "10.169.253.165", + "isDefault": true, + "networkId": "d2243d4c-0dd8-4f8c-9ab4-4b1d285d5642", + "networkName": "Backend", + "gateway": "10.169.253.1", + "netmask": "255.255.255.0", + "instanceId": "b6145e8b-abd3ta-456c-832c-f3db86a6acfe", + "vpcId": "5aa9f5d7-55a9-43bf-bd2c-78a6bae1b267", + "vpcName": "default-vpc", + "secondaryIps": [ + { + "id": "9c28e297-5d23-41a3-a167-34dc24f1df19", + "ipAddress": "10.169.253.124" + } + ] + } +} +``` + +GET /services/:service_code/:environment_name/nics/:id + +Retrieve an existing NIC. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the NIC +`name` | *string* | The name of the NIC +`ipAddress` | *string* | The IP address of the NIC +`isDefault` | *string* | true if it's the default NIC of the [instance](#instances) (i.e. it will be the private IP on the instance) +`networkId` | *UUID* | The id of the [network](#networks) of the NIC +`networkName` | *string* | The name of the [network](#networks) of the NIC +`gateway` | *string* | The gateway of the [network](#networks) associated with the NIC +`netmask` | *string* | The netmask of the [network](#networks) associated with the NIC +`instanceId` | *string* | The id of the [instance](#instances) associated with the NIC +`vpcId` | *string* | The id of the [VPC](#vpcs) associated with the NIC +`vpcName` | *string* | The name of the [VPC](#vpcs) associated with the NIC +`secondaryIps` | *SecondaryIP* | The list of secondary IPs of the NIC
*includes:* `id`, `ipAddress` + + + + + +### Create a NIC + + +```shell + +# Example: + +curl -X POST \ + -H "Content-Type: application/json" \ + -H "MC-Api-Key: your_api_key" \ + -d "request_body" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/nics" + +# Request example: +``` +```json +{ + "networkId": "d67e986d-fe04-4827-836e-1697ede8ed30", + "instanceId": "96330eea-4424-46ca-825c-82fdd051d8c3" +} +``` + + +POST /services/:service_code/:environment_name/nics + +Create a NIC for an [instance](#instances) in a specific network. You can only have one NIC per [network](#networks). + +Required | Type | Description +------------ | ---- | ----------- +`networkId` | *string* | The id of the [network](#networks) where to create the NIC +`instanceId` | *string* | The id of the [instance](#instances) where to attach the NIC + + + + + +### Delete a NIC + + +```shell + +# Example: + +curl -X DELETE \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/nics" +``` + +DELETE /services/:service_code/:environment_name/nics/:id + +Delete an existing NIC. The NIC you're trying to delete must not be the default one. + + + + + +### Set a NIC as default + + +```shell + +# Example: + +curl -X POST \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/nics/63ef1efe-225f-4e05-bc79-b3e457a041e2?operation=setDefault" +``` + +POST /services/:service_code/:environment_name/nics/:id?operation=setDefault + +Set an existing NIC as the default NIC of an [instance](#instances). diff --git a/content/508-remote-access-vpns.md b/content/508-remote-access-vpns.md new file mode 100644 index 00000000000..2581aecc251 --- /dev/null +++ b/content/508-remote-access-vpns.md @@ -0,0 +1,85 @@ +--- +weight: 508 +title: Remote access VPNs +--- + +## Remote access VPNs + +Remote access VPNs allow users to connect to [VPCs](#vpcs) through secure connections. + +### List remote access VPNs + +```shell +curl -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/remoteaccessvpns" + +# Response example: +``` +```json +{ + "data": [ + { + "id": "10001e7d-b4ef-489b-836e-0619a383bc8d", + "publicIpAddress": "69.196.164.31", + "publicIpAddressId": "10001e7d-b4ef-489b-836e-0619a383bc8d", + "state": "Disabled" + }, + { + "id": "8925406c-8051-467e-a0ca-c48caa5bf670", + "presharedKey": "Kwth4JYUfXXmtMG4X7vAwRPH", + "publicIpAddress": "69.196.164.223", + "publicIpAddressId": "8925406c-8051-467e-a0ca-c48caa5bf670", + "state": "Enabled" + } + ], + "metadata": { + "recordCount": 2 + } +} +``` + +GET /services/:service_code/:environment_name/remoteaccessvpns + +List remote access VPNs. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the remote access VPN +`presharedKey` | *string* | The VPN's preshared key +`publicIpAddress` | *string* | The [public IP](#public-ips) (e.g. 208.80.154.224) +`publicIpAddressId` | *string* | The id of the [public IP](#public-ips) +`state` | *string* | The state.
*Possible values:* `Enabled`, `Disabled.` + +Query Parameters |   +-------------- | ---- | ------------ +`vpc_id` | *UUID* | Filter the list to only retrieve the VPN information of a specific [VPC](#vpcs) + +### Retrieve a remote access VPN +```shell +curl -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/remoteaccessvpns/10001e7d-b4ef-489b-836e-0619a383bc8d" + +# Response example: +``` +```json +{ + "data": { + "id": "10001e7d-b4ef-489b-836e-0619a383bc8d", + "publicIpAddress": "69.196.164.31", + "publicIpAddressId": "10001e7d-b4ef-489b-836e-0619a383bc8d", + "state": "Disabled" + } +} +``` + +GET /services/:service_code/:environment_name/remoteaccessvpns/:id + +Retrieve a remote access VPN. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the remote access VPN +`presharedKey` | *string* | The VPN's preshared key +`publicIpAddress` | *string* | The [public IP](#public-ips) (e.g. 208.80.154.224) +`publicIpAddressId` | *string* | The id of the [public IP](#public-ips) +`state` | *string* | The state.
*Possible values:* `Enabled`, `Disabled.` diff --git a/source/includes/compute/_vpn_users.md b/content/509-vpn-users.md similarity index 51% rename from source/includes/compute/_vpn_users.md rename to content/509-vpn-users.md index 4932eb1e31b..8e473fd66bd 100644 --- a/source/includes/compute/_vpn_users.md +++ b/content/509-vpn-users.md @@ -1,8 +1,14 @@ -### VPN users +--- +weight: 509 +title: VPN users +--- + +## VPN users VPN users are the accounts that are allowed to connect to [remote access VPNs](#remote-access-vpns). -#### List VPN users +### List VPN users + ```shell curl -X GET \ -H "MC-Api-Key: your_api_key" \ @@ -24,16 +30,16 @@ curl -X GET \ } ``` -GET /services/:service_code/:environment_name/vpnusers +GET /services/:service_code/:environment_name/vpnusers List VPN users. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the remote access VPN user -`username`
*string* | The VPN user's username +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the remote access VPN user +`username` | *string* | The VPN user's username -#### Retrieve a VPN user +### Retrieve a VPN user ```shell curl -X GET \ -H "MC-Api-Key: your_api_key" \ @@ -50,11 +56,11 @@ curl -X GET \ } ``` -GET /services/:service_code/:environment_name/vpnusers/:id +GET /services/:service_code/:environment_name/vpnusers/:id Retrieve a VPN user -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the remote access VPN user -`username`
*string* | The VPN user's username +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the remote access VPN user +`username` | *string* | The VPN user's username diff --git a/content/510-s2s-vpns.md b/content/510-s2s-vpns.md new file mode 100644 index 00000000000..a8bca0db9a9 --- /dev/null +++ b/content/510-s2s-vpns.md @@ -0,0 +1,231 @@ +--- +weight: 510 +title: Site-to-site VPN +--- + +## Site-to-site VPN + +A site-to-site VPN allows multiple sites to establish a secure connection over the public network. In our case, we are talking about a secure connection between your VPC and another network (e.g. VPC, offices). + + + +### List site-to-site VPNs + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns" + +# Example: +``` +```json +{ + "data": [ + { + "id": "d49b2922-0581-4587-94df-6fe719327d0f", + "name": "stargate", + "state": "Connected", + "vpcId": "3fe7d82a-f4c4-4552-ac3b-787fdafed4e7", + "gateway":"19.19.19.19", + "cidr":"10.12.0.2/22", + "ipSecPsk": "WtOBS9GRux2XtJPtHY2TUvrv", + "ikeEncryptionAlgorithm": "3des", + "ikeHashAlgorithm": "sha1", + "ikeDhGroup":"modp1536", + "ikeLifetime":86400, + "espEncryptionAlgorithm":"3des", + "espHashAlgorithm":"sha1", + "espPerfectForwardSecrecy":"modp1536", + "espLifetime":3600, + "dpd": false, + "forceEncap": false + } + ], + "metadata": { + "recordCount": 1 + } +} +``` + +GET /services/:service_code/:environment_name/sitetositevpns + +Retrieve a list of all site-to-site VPNs in an [environment](#environments) + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the site-to-site VPN +`name` | *string* | The name of the site-to-site VPN +`state` | *string* | The state of the site-to-site VPN. Can be Connected, Pending, Disconnected or Error. If disconnected, you can try to use the [reset](#reset-the-connection-of-a-site-to-site-vpn) operation +`vpcId` | *UUID* | The VPC for which the site-to-site VPN was created. +`gateway` | *string* | The gateway of the network you want to connect to. NOTE: you cannot use a gateway that has already been used by a site-to-site VPN in your environment +`cidr` | *string* | CIDR of the network you want to connect to. +`ipSecPsk` | *string* | IPSec pre-shared key. Must contain at least 10 alphanumeric characters. +`ikeEncryptionAlgorithm` | *string* | The Internet Key Exchange (IKE) policy for phase-1. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. +`ikeHashAlgorithm` | *string* | The IKE hash for phase-1. The supported hash algorithms are SHA1 and MD5. +`ikeDhGroup` | *string* | A public-key cryptography protocol which allows two parties to establish a shared secret over an insecure communications channel. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). +`ikeLifetime` | *integer* | The phase-1 lifetime of the security association in seconds. +`espEncryptionAlgorithm` | *string* | Encapsulating Security Payload (ESP) algorithm within phase-2. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. +`espHashAlgorithm` | *string* | Encapsulating Security Payload (ESP) hash for phase-2. Supported hash algorithms are SHA1 and MD5. +`espPerfectForwardSecrecy` | *string* | Perfect Forward Secrecy (or PFS) is the property that ensures that a session key derived from a set of long-term public and private keys will not be compromised. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). +`espLifetime` | *integer* | The phase-2 lifetime of the security association in seconds +`dpd` | *boolean* | A method to detect an unavailable Internet Key Exchange (IKE) peer. +`forceEncap` | *boolean* | Force encapsulation for NAT Traversal + +Query Parameters |   +-------------- | ---- | ------------ +`vpc_id` | *UUID* | Filter the list to only retrieve the site-to-site VPNs of a [VPC](#vpcs) + + + +### Retrieve a site-to-site VPN + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns/d49b2922-0581-4587-94df-6fe719327d0f" + +# Example: +``` +```json +{ + "data": { + "id": "d49b2922-0581-4587-94df-6fe719327d0f", + "name": "stargate", + "state": "Connected", + "vpcId": "3fe7d82a-f4c4-4552-ac3b-787fdafed4e7", + "gateway":"19.19.19.19", + "cidr":"10.12.0.2/22", + "ipSecPsk": "WtOBS9GRux2XtJPtHY2TUvrv", + "ikeEncryptionAlgorithm": "3des", + "ikeHashAlgorithm": "sha1", + "ikeDhGroup":"modp1536", + "ikeLifetime":86400, + "espEncryptionAlgorithm":"3des", + "espHashAlgorithm":"sha1", + "espPerfectForwardSecrecy":"modp1536", + "espLifetime":3600, + "dpd": false, + "forceEncap": false + } +} +``` + +GET /services/:service_code/:environment_name/sitetositevpns/:id + +Retrieve information about a site-to-site VPN. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the site-to-site VPN +`name` | *string* | The name of the site-to-site VPN +`state` | *string* | The state of the site-to-site VPN. Can be Connected, Pending, Disconnected or Error. If disconnected, you can try to use the [reset](#reset-the-connection-of-a-site-to-site-vpn) operation +`vpcId` | *UUID* | The VPC for which the site-to-site VPN was created. +`gateway` | *string* | The gateway of the network you want to connect to. NOTE: you cannot use a gateway that has already been used by a site-to-site VPN in your environment +`cidr` | *string* | CIDR of the network you want to connect to. +`ipSecPsk` | *string* | IPSec pre-shared key. Must contain at least 10 alphanumeric characters. +`ikeEncryptionAlgorithm` | *string* | The Internet Key Exchange (IKE) policy for phase-1. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. +`ikeHashAlgorithm` | *string* | The IKE hash for phase-1. The supported hash algorithms are SHA1 and MD5. +`ikeDhGroup` | *string* | A public-key cryptography protocol which allows two parties to establish a shared secret over an insecure communications channel. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). +`ikeLifetime` | *integer* | The phase-1 lifetime of the security association in seconds. +`espEncryptionAlgorithm` | *string* | Encapsulating Security Payload (ESP) algorithm within phase-2. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. +`espHashAlgorithm` | *string* | Encapsulating Security Payload (ESP) hash for phase-2. Supported hash algorithms are SHA1 and MD5. +`espPerfectForwardSecrecy` | *string* | Perfect Forward Secrecy (or PFS) is the property that ensures that a session key derived from a set of long-term public and private keys will not be compromised. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). +`espLifetime` | *integer* | The phase-2 lifetime of the security association in seconds +`dpd` | *boolean* | A method to detect an unavailable Internet Key Exchange (IKE) peer. +`forceEncap` | *boolean* | Force encapsulation for NAT Traversal + + + +### Create a site-to-site VPN + +```shell + +# Here is the absolute minimum information required to create a new site-to-site VPN: + +curl -X POST \ + -H "Content-Type: application/json" \ + -H "MC-Api-Key: your_api_key" \ + -d "request_body" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns" + +# Request should look like this +``` +```json +{ + "name": "stargate", + "vpcId": "3fe7d82a-f4c4-4552-ac3b-787fdafed4e7", + "gateway":"19.19.19.19", + "cidr":"10.12.0.2/22", + "ipSecPsk": "WtOBS9GRux2XtJPtHY2TUvrv", + "ikeEncryptionAlgorithm": "3des", + "ikeHashAlgorithm": "sha1", + "ikeDhGroup":"modp1536", + "ikeLifetime":86400, + "espEncryptionAlgorithm":"3des", + "espHashAlgorithm":"sha1", + "espPerfectForwardSecrecy":"modp1536", + "espLifetime":3600, + "dpd": false, + "forceEncap": false + } +``` + POST /services/:service_code/:environment_name/sitetositevpns + +Create a site-to-site VPN + +Required | Type | Description +------------ | ---- | ----------- +`name` | *string* | The name of the site-to-site VPN. Must be unique in the environment. +`vpcId` | *UUID* | The VPC for which the site-to-site VPN was created. +`gateway` | *string* | The gateway of the network you want to connect to. NOTE: you cannot use a gateway that has already been used by a site-to-site VPN in your environment +`cidr` | *string* | CIDR of the network you want to connect to. +`ipSecPsk` | *string* | IPSec pre-shared key. Must contain at least 10 alphanumeric characters. +`ikeEncryptionAlgorithm` | *string* | The Internet Key Exchange (IKE) policy for phase-1. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. +`ikeHashAlgorithm` | *string* | The IKE hash for phase-1. The supported hash algorithms are SHA1 and MD5. +`ikeLifetime` | *integer* | The phase-1 lifetime of the security association in seconds. +`espEncryptionAlgorithm` | *string* | Encapsulating Security Payload (ESP) algorithm within phase-2. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. +`espHashAlgorithm` | *string* | Encapsulating Security Payload (ESP) hash for phase-2. Supported hash algorithms are SHA1 and MD5. +`espLifetime` | *integer* | The phase-2 lifetime of the security association in seconds + +Optional | Type | Description +------------ | ---- | ----------- +`ikeDhGroup` | *string* | A public-key cryptography protocol which allows two parties to establish a shared secret over an insecure communications channel. The supported options are Group-5 (1536-bit) and Group-2 (1024-bit). +`espPerfectForwardSecrecy` | *string* | Perfect Forward Secrecy (or PFS) is the property that ensures that a session key derived from a set of long-term public and private keys will not be compromised. The supported options are Group-5 (1536-bit) and Group-2 (1024-bit). +`dpd` | *boolean* | A method to detect an unavailable Internet Key Exchange (IKE) peer. Defaults to false +`forceEncap` | *boolean* | Force encapsulation for NAT Traversal. Defaults to false + + + + +### Delete a site-to-site VPN + + +```shell + +# Example: + +curl -X DELETE \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns/d49b2922-0581-4587-94df-6fe719327d0f" +``` + +DELETE /services/:service_code/:environment_name/sitetositevpns/:id + +Delete an existing site-to-site VPN. + + + + +### Reset the connection of a site-to-site VPN + +```shell + +curl -X POST \ + -H "Content-Type: application/json" \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns/ca86b14f-20db-463d-b58a-9d3fa5959af2?operation=reset" + +``` + POST /services/:service_code/:environment_name/sitetositevpns/:id?operation=reset + +Reset a site-to-site VPN. diff --git a/content/600-storage.md b/content/600-storage.md new file mode 100644 index 00000000000..26adc411ece --- /dev/null +++ b/content/600-storage.md @@ -0,0 +1,6 @@ +--- +weight: 600 +title: Storage +--- + +# Storage diff --git a/source/includes/compute/_volumes.md b/content/601-volumes.md similarity index 64% rename from source/includes/compute/_volumes.md rename to content/601-volumes.md index 768c40912d0..78e46d36802 100644 --- a/source/includes/compute/_volumes.md +++ b/content/601-volumes.md @@ -1,10 +1,16 @@ -### Volumes +--- +weight: 601 +title: Volumes +--- + +## Volumes + A volume is a virtual disk that provide storage for your instances. An OS volumes is created for every instance and it holds the OS of the instance. The size of this volume is usually pretty. A data volume is a volume that can be created and attached to an instance. It can also be detached and reattached to another instance. -#### List volumes +### List volumes ```shell curl -X GET \ @@ -40,33 +46,33 @@ ccaResources := resources.(cloudca.Resources) volumes, err := ccaResources.Volumes.List() ``` -GET /services/:service_code/:environment_name/volumes +GET /services/:service_code/:environment_name/volumes Retrieve a list of all volumes in an environment. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the volume -`name`
*string* | The name of the volume -`type`
*string* | The type of the volume. `os` if it is a root volume of an [instance](#instances), `data` otherwise -`creationDate`
*string* | The creation date of the volume -`instanceId`
*UUID* | The id of the [instance](#instances) to which the volume is attached -`instanceName`
*string* | The name of the [instance](#instances) to which the volume is attached -`zoneId`
*UUID* | The id of the [zone](#zones) where the volume was created -`zoneName`
*string* | The name of the [zone](#zones) where the volume was created -`state`
*string* | The state of the volume -`sizeInGb`
*int* | The size in gigabytes of the volume +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the volume +`name` | *string* | The name of the volume +`type` | *string* | The type of the volume. `os` if it is a root volume of an [instance](#instances), `data` otherwise +`creationDate` | *string* | The creation date of the volume +`instanceId` | *UUID* | The id of the [instance](#instances) to which the volume is attached +`instanceName` | *string* | The name of the [instance](#instances) to which the volume is attached +`zoneId` | *UUID* | The id of the [zone](#zones) where the volume was created +`zoneName` | *string* | The name of the [zone](#zones) where the volume was created +`state` | *string* | The state of the volume +`sizeInGb` | *int* | The size in gigabytes of the volume Query Parameters |   ----------- | ----- -`type`
*string* | Filter the list to only retrieve the volumes of a specific type (`os` or `data`) -`instance_id`
*UUID* | Filter the list to only retrieve the volumes of a specific [instance](#instances) +-------------- | ---- | ------------ +`type` | *string* | Filter the list to only retrieve the volumes of a specific type (`os` or `data`) +`instance_id` | *UUID* | Filter the list to only retrieve the volumes of a specific [instance](#instances) -#### Retrieve a volume +### Retrieve a volume ```shell curl -X GET \ @@ -99,29 +105,29 @@ ccaResources := resources.(cloudca.Resources) volumes, err := ccaResources.Volumes.Get("1bd672f4-b274-4371-a792-b0a6c6778cc7") ``` -GET /services/:service_code/:environment_name/volumes/:id +GET /services/:service_code/:environment_name/volumes/:id Retrieve information about an volume. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the volume -`name`
*string* | The name of the volume -`type`
*string* | The type of the volume. `os` if it is a root volume of an [instance](#instances), `data` otherwise -`creationDate`
*string* | The creation date of the volume -`instanceId`
*UUID* | The id of the [instance](#instances) to which the volume is attached -`instanceName`
*string* | The name of the [instance](#instances) to which the volume is attached -`zoneId`
*UUID* | The id of the [zone](#zones) where the volume was created -`zoneName`
*string* | The name of the [zone](#zones) where the volume was created -`state`
*string* | The state of the volume -`sizeInGb`
*int* | The size in gigabytes of the volume +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the volume +`name` | *string* | The name of the volume +`type` | *string* | The type of the volume. `os` if it is a root volume of an [instance](#instances), `data` otherwise +`creationDate` | *string* | The creation date of the volume +`instanceId` | *UUID* | The id of the [instance](#instances) to which the volume is attached +`instanceName` | *string* | The name of the [instance](#instances) to which the volume is attached +`zoneId` | *UUID* | The id of the [zone](#zones) where the volume was created +`zoneName` | *string* | The name of the [zone](#zones) where the volume was created +`state` | *string* | The state of the volume +`sizeInGb` | *int* | The size in gigabytes of the volume -#### Create a volume +### Create a volume ```shell curl -X POST \ @@ -159,12 +165,12 @@ resource "cloudca_volume" "data_volume" { } ``` -POST /services/:service_code/:environment_name/volumes +POST /services/:service_code/:environment_name/volumes Create a volume in an environment. It will attached to the specified [instance](#instances). -Required |   ----------- | ----- +Required | Type | Description +-------------- | ---- | ------------ name
*string* | The name of the new volume diskOfferingId
*UUID* | The [disk offering](#disk-offerings) to use for the volume instanceId
*UUID* | The id of the [instance](#instances) to which the created volume will be attached @@ -173,7 +179,7 @@ instanceId
*UUID* | The id of the [instance](#instances) to which the create -#### Delete a volume +### Delete a volume ```shell @@ -189,7 +195,7 @@ ccaResources := resources.(cloudca.Resources) err := ccaResources.Volumes.Delete("e922e5fc-8fee-4688-ad93-c9ef5d7eb685") ``` -DELETE /services/:service_code/:environment_name/vpcs/:id +DELETE /services/:service_code/:environment_name/vpcs/:id Destroy an existing data volume. A volume can only be deleted if it's not attached to an [instance](#instances). @@ -197,7 +203,7 @@ Destroy an existing data volume. A volume can only be deleted if it's not attach -#### Attach a volume to an instance +### Attach a volume to an instance ```shell curl -X POST \ @@ -222,19 +228,19 @@ err := ccaResources.Volumes.AttachToInstance(cloudca.Volume{ }) ``` -POST /services/:service_code/:environment_name/volumes/:id?operation=attachToInstance +POST /services/:service_code/:environment_name/volumes/:id?operation=attachToInstance Attach an existing data volume to an [instance](#instances). -Required |   ----------- | ----- +Required | Type | Description +-------------- | ---- | ------------ instanceId
*UUID* | The id of the [instance](#instances) to which the created volume should be attached -#### Detach a volume from an instance +### Detach a volume from an instance ```shell curl -X POST \ @@ -251,6 +257,6 @@ err := ccaResources.Volumes.DetachFromInstance(cloudca.Volume{ }) ``` -POST /services/:service_code/:environment_name/volumes/:id?operation=detachFromInstance +POST /services/:service_code/:environment_name/volumes/:id?operation=detachFromInstance Detach a data volume from an [instance](#instances). diff --git a/content/602-snapshots.md b/content/602-snapshots.md new file mode 100644 index 00000000000..7c9dfffe24f --- /dev/null +++ b/content/602-snapshots.md @@ -0,0 +1,95 @@ +--- +weight: 602 +title: Snapshots +--- + +## Snapshots + + A volume snapshot is a full image of a volume. They are often considered as backups, but in reality this is not 100% true since you have only the data written on disk. Volume Snapshots are typically used to derive new templates out of a running instance. + + + +### List snapshots + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/snapshots" + +# Example: +``` +```json +{ + "data": [ + { + "id": "33a27b8d-5a27-42a5-aec4-37606e372bda", + "name": "i-douglas-ADM_foo_20161116211009", + "state": "BackedUp", + "intervalType": "MANUAL", + "volumeId": "c779ca42-6966-41af-a7dc-23db4e41d4ee", + "volume": "ROOT-35545", + "volumeType": "ROOT-35545" + } + ], + "metadata": { + "recordCount": 1 + } +} +``` + +GET /services/:service_code/:environment_name/snapshots + +Retrieve a list of all snapshots in an [environment](#environments) + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the snapshot +`name` | *string* | The name of the snapshot +`state` | *string* | The state of the snapshot +`intervalType` | *string* | The interval type. `MANUAL` means that you created the snapshot manually (i.e. it's not a recurring snapshot) +`volumeId` | *UUID* | The id of the [volume](#volumes) that was snapshotted +`volume` | *string* | The name of the [volume](#volumes) that was snapshotted +`volumeType` | *string* | The type of the [volume](#volumes) that was snapshotted + +Query Parameters |   +-------------- | ---- | ------------ +`volume_id` | *UUID* | Filter the list to only retrieve the snapshots of a specific [volume](#volumes) + + + +### Retrieve a snapshot + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/snapshots/1bd672f4-b274-4371-a792-b0a6c6778cc7" + +# Example: +``` +```json +{ + "data": { + "id": "33a27b8d-5a27-42a5-aec4-37606e372bda", + "name": "i-douglas-ADM_foo_20161116211009", + "state": "BackedUp", + "intervalType": "MANUAL", + "volumeId": "c779ca42-6966-41af-a7dc-23db4e41d4ee", + "volume": "ROOT-35545", + "volumeType": "ROOT-35545" + } +} +``` + +GET /services/:service_code/:environment_name/snapshots/:id + +Retrieve information about a snapshot. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the snapshot +`name` | *string* | The name of the snapshot +`state` | *string* | The state of the snapshot +`intervalType` | *string* | The interval type. `MANUAL` means that you created the snapshot manually (i.e. it's not a recurring snapshot) +`volumeId` | *UUID* | The id of the [volume](#volumes) that was snapshotted +`volume` | *string* | The name of the [volume](#volumes) that was snapshotted +`volumeType` | *string* | The type of the [volume](#volumes) that was snapshotted diff --git a/source/includes/compute/_offerings.md b/content/700-offerings.md similarity index 82% rename from source/includes/compute/_offerings.md rename to content/700-offerings.md index 15b60100099..81127c59327 100644 --- a/source/includes/compute/_offerings.md +++ b/content/700-offerings.md @@ -1,3 +1,8 @@ -## Offerings +--- +weight: 700 +title: Offerings +--- + +# Offerings Offerings are what determine the characteristics of provisioned resources. There are 4 types of offerings : [compute](#compute-offerings), [disk](#disk-offerings), [VPC](#vpc-offerings) and [network](#network-offerings) offerings. diff --git a/source/includes/compute/_vpc_offerings.md b/content/701-vpc-offerings.md similarity index 65% rename from source/includes/compute/_vpc_offerings.md rename to content/701-vpc-offerings.md index 14c09913fc4..d9ba00038f9 100644 --- a/source/includes/compute/_vpc_offerings.md +++ b/content/701-vpc-offerings.md @@ -1,8 +1,13 @@ -### VPC offerings +--- +weight: 701 +title: VPC offerings +--- + +## VPC offerings VPC offerings determine which services are available to provisioned [VPCs](#vpcs). -#### List VPC offerings +### List VPC offerings ```shell curl -X GET \ @@ -42,18 +47,18 @@ ccaResources := resources.(cloudca.Resources) vpcOfferings, _ := ccaResources.VpcOfferings.List() ``` -GET /services/:service_code/:environment_name/vpcofferings +GET /services/:service_code/:environment_name/vpcofferings Retrieve a list of available VPC offerings. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the VPC offering -`name`
*string* | The name of the VPC offering -`services`
*Array[string]* | The services provided by the offering -`state`
*string* | The state of the offering +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the VPC offering +`name` | *string* | The name of the VPC offering +`services` | *Array[string]* | The services provided by the offering +`state` | *string* | The state of the offering -#### Retrieve a VPC offering +### Retrieve a VPC offering ```shell curl -X GET \ @@ -88,13 +93,13 @@ ccaResources := resources.(cloudca.Resources) vpcOfferings, _ := ccaResources.VpcOfferings.Get("41ac6ba0-6172-4bc4-bff6-b0831b91677c") ``` -GET /services/:service_code/:environment_name/vpcofferings/:id +GET /services/:service_code/:environment_name/vpcofferings/:id Retrieve a VPC offering. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the VPC offering -`name`
*string* | The name of the VPC offering -`services`
*Array[string]* | The services provided by the offering -`state`
*string* | The state of the offering +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the VPC offering +`name` | *string* | The name of the VPC offering +`services` | *Array[string]* | The services provided by the offering +`state` | *string* | The state of the offering diff --git a/source/includes/compute/_network_offerings.md b/content/702-network-offerings.md similarity index 69% rename from source/includes/compute/_network_offerings.md rename to content/702-network-offerings.md index a667bf5c948..f61f942e8b0 100644 --- a/source/includes/compute/_network_offerings.md +++ b/content/702-network-offerings.md @@ -1,8 +1,13 @@ -### Network offerings +--- +weight: 702 +title: Network offerings +--- + +## Network offerings Network offerings determine which services are available to each provisioned [network](#networks). -#### List network offerings +### List network offerings ```shell curl -X GET \ @@ -57,18 +62,18 @@ ccaResources := resources.(cloudca.Resources) networkOfferings, _ := ccaResources.NetworkOfferings.List() ``` -GET /services/:service_code/:environment_name/networkofferings +GET /services/:service_code/:environment_name/networkofferings Retrieve a list of available network offerings. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the network offering -`name`
*string* | The name of the network offering -`services`
*Array[string]* | The services provided by the offering -`state`
*string* | The state of the offering +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the network offering +`name` | *string* | The name of the network offering +`services` | *Array[string]* | The services provided by the offering +`state` | *string* | The state of the offering -#### Retrieve a network offering +### Retrieve a network offering ```shell curl -X GET \ @@ -103,13 +108,13 @@ ccaResources := resources.(cloudca.Resources) networkOfferings, _ := ccaResources.NetworkOfferings.Get("89724d35-b69c-418c-be81-7d83fcfc9da9") ``` -GET /services/:service_code/:environment_name/networkofferings/:id +GET /services/:service_code/:environment_name/networkofferings/:id Retrieve a network offering. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the network offering -`name`
*string* | The name of the network offering -`services`
*Array[string]* | The services provided by the offering -`state`
*string* | The state of the offering +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the network offering +`name` | *string* | The name of the network offering +`services` | *Array[string]* | The services provided by the offering +`state` | *string* | The state of the offering diff --git a/content/703-compute-offerings.md b/content/703-compute-offerings.md new file mode 100644 index 00000000000..e420ba84646 --- /dev/null +++ b/content/703-compute-offerings.md @@ -0,0 +1,103 @@ +--- +weight: 703 +title: Compute offerings +--- + +## Compute offerings + +Compute offerings determine the number of vCPUs and the size of the memory allocated to new [instances](#instances). + +### List compute offerings + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/computeofferings" + +# The above command returns JSON structured like this: +``` +```json +{ + "data": [ + { + "id": "40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f", + "name": "Custom CPU and memory", + "custom" : true, + "availableCpuCountValues": [1, 2, 4, 8], + "availableMemoryInMBValues": [1024, 2048, 4096, 8192], + "maxMemoryInMBToCpuRatio": 2048 + }, + { + "id": "1fb0caba-8ffb-4e77-8dcb-401170e15e0a", + "name": "1vCPU.1GB", + "cpuCount": 1, + "memoryInMB": 1024, + "custom" : false + } + ], + "metadata": { + "recordCount": 2 + } +} +``` +```go +resources, _ := ccaClient.GetResources("compute-on", "test_area") +ccaResources := resources.(cloudca.Resources) +computeOfferings, _ := ccaResources.ComputeOfferings.List() +``` + +GET /services/:service_code/:environment_name/computeofferings + +Retrieve a list of available compute offerings. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the compute offering +`name` | *string* | The name of the compute offering +`memoryInMB` | *int* | The amount of provisioned memory in MB +`cpuCount` | *int* | The number of vCPUs available to the created [instance](#instances) +`custom` | *boolean* | If true, the `cpuCount` and `memoryInMB` fields will be missing from the response and will be required on [instance create](#create-an-instance) +`availableCpuCountValues` | *Array[integer]* | The list of valid cpu counts when used in the [create instance operation](#create-an-instance). Only present for custom offerings +`availableMemoryInMBValues` | *Array[integer]* | The list of valid amounts of memory (in MB) that can be used in the [create instance operation](#create-an-instance). Only present for custom offerings +`maxMemoryInMBToCpuRatio` | *integer* | The maximum ratio of memory (in MB) to number of CPU of an [instance](#instance) created with this offering. Only present for custom offerings. + +### Retrieve a compute offering + +```shell +curl -X GET \ + -H "MC-Api-Key: your_api_key" \ + "https://api.cloud.ca/v1/services/compute-on/test_area/computeofferings/40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f" + +# The above command returns JSON structured like this: +``` +```json +{ + "data": { + "id": "40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f", + "name": "1vCPU.512MB", + "cpuCount": 1, + "memoryInMB": 512, + "custom": false + } +} +``` +```go +resources, _ := ccaClient.GetResources("compute-on", "test_area") +ccaResources := resources.(cloudca.Resources) +computeOfferings, _ := ccaResources.ComputeOfferings.Get("40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f") +``` + +GET /services/:service_code/:environment_name/computeofferings/:id + +Retrieve a compute offering. + +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the compute offering +`name` | *string* | The name of the compute offering +`memoryInMB` | *int* | The amount of provisioned memory in MB +`cpuCount` | *int* | The number of vCPUs available to the created [instance](#instances) +`custom` | *boolean* | If true, the `cpuCount` and `memoryInMB` fields will be missing from the response and will be required on [instance create](#create-an-instance) +`availableCpuCountValues` | *Array[integer]* | The list of valid cpu counts when used in the [create instance operation](#create-an-instance). Only present for custom offerings +`availableMemoryInMBValues` | *Array[integer]* | The list of valid amounts of memory (in MB) that can be used in the [create instance operation](#create-an-instance). Only present for custom offerings +`maxMemoryInMBToCpuRatio` | *integer* | The maximum ratio of memory (in MB) to number of CPU of an [instance](#instance) created with this offering. Only present for custom offerings. diff --git a/source/includes/compute/_disk_offerings.md b/content/704-disk-offerings.md similarity index 59% rename from source/includes/compute/_disk_offerings.md rename to content/704-disk-offerings.md index 6f50a158f43..15a68817e2c 100644 --- a/source/includes/compute/_disk_offerings.md +++ b/content/704-disk-offerings.md @@ -1,8 +1,13 @@ -### Disk offerings +--- +weight: 704 +title: Disk offerings +--- + +## Disk offerings Disk offerings determine the size and the performance (IOPS) of [data volumes](#volumes). -#### List disk offerings +### List disk offerings ```shell curl -X GET \ @@ -40,19 +45,19 @@ ccaResources := resources.(cloudca.Resources) diskOfferings, _ := ccaResources.DiskOfferings.List() ``` -GET /services/:service_code/:environment_name/diskofferings +GET /services/:service_code/:environment_name/diskofferings Retrieve a list of available disk offerings. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the disk offering -`name`
*string* | The name of the disk offering -`gbSize`
*int* | The size of the [data volume](#volumes) in GB -`customSize`
*boolean* | If the offering supports custom size -`customIops`
*boolean* | If the offering supports custom IOPS +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the disk offering +`name` | *string* | The name of the disk offering +`gbSize` | *int* | The size of the [data volume](#volumes) in GB +`customSize` | *boolean* | If the offering supports custom size +`customIops` | *boolean* | If the offering supports custom IOPS -#### Retrieve a disk offering +### Retrieve a disk offering ```shell curl -X GET \ @@ -78,14 +83,14 @@ ccaResources := resources.(cloudca.Resources) diskOfferings, _ := ccaResources.DiskOfferings.Get("18bbab50-8d85-4b34-8361-0dc223ffd7e5") ``` -GET /services/:service_code/:environment_name/diskofferings/:id +GET /services/:service_code/:environment_name/diskofferings/:id Retrieve a disk offering. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the disk offering -`name`
*string* | The name of the disk offering -`gbSize`
*int* | The size of the [data volume](#volumes) in GB -`customSize`
*boolean* | If the offering supports custom size -`customIops`
*boolean* | If the offering supports custom IOPS +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the disk offering +`name` | *string* | The name of the disk offering +`gbSize` | *int* | The size of the [data volume](#volumes) in GB +`customSize` | *boolean* | If the offering supports custom size +`customIops` | *boolean* | If the offering supports custom IOPS diff --git a/source/includes/compute/_zones.md b/content/800-zones.md similarity index 66% rename from source/includes/compute/_zones.md rename to content/800-zones.md index 2b390b75a71..2dc9f8c8cfd 100644 --- a/source/includes/compute/_zones.md +++ b/content/800-zones.md @@ -1,8 +1,13 @@ -## Zones +--- +weight: 800 +title: Zones +--- + +# Zones Each zone consists of physically isolated hosts, storage, and networking infrastructure. Like deploying workloads across regions, deploying workloads over multiple zones can help ensure high availability of applications. -#### List zones +### List zones ```shell curl -X GET \ @@ -30,16 +35,16 @@ ccaResources := resources.(cloudca.Resources) zones, _ := ccaResources.Zones.List() ``` -GET /services/:service_code/:environment_name/zones +GET /services/:service_code/:environment_name/zones Retrieve a list of available zones. -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the zone -`name`
*string* | The name of the zone +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the zone +`name` | *string* | The name of the zone -#### Retrieve a zone +### Retrieve a zone ```shell curl -X GET \ @@ -63,11 +68,11 @@ ccaResources := resources.(cloudca.Resources) zones, _ := ccaResources.Zones.Get("ea901007-056b-4c50-bb3a-2dd635fce2ab") ``` -GET /services/:service_code/:environment_name/zones/:id +GET /services/:service_code/:environment_name/zones/:id Retrieve a zone -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the zone -`name`
*string* | The name of the zone +Attributes | Type | Description +-------------- | ---- | ------------ +`id` | *UUID* | The id of the zone +`name` | *string* | The name of the zone diff --git a/font-selection.json b/font-selection.json deleted file mode 100755 index 5e78f5d8621..00000000000 --- a/font-selection.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "IcoMoonType": "selection", - "icons": [ - { - "icon": { - "paths": [ - "M438.857 73.143q119.429 0 220.286 58.857t159.714 159.714 58.857 220.286-58.857 220.286-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857zM512 785.714v-108.571q0-8-5.143-13.429t-12.571-5.429h-109.714q-7.429 0-13.143 5.714t-5.714 13.143v108.571q0 7.429 5.714 13.143t13.143 5.714h109.714q7.429 0 12.571-5.429t5.143-13.429zM510.857 589.143l10.286-354.857q0-6.857-5.714-10.286-5.714-4.571-13.714-4.571h-125.714q-8 0-13.714 4.571-5.714 3.429-5.714 10.286l9.714 354.857q0 5.714 5.714 10t13.714 4.286h105.714q8 0 13.429-4.286t6-10z" - ], - "attrs": [], - "isMulticolor": false, - "tags": [ - "exclamation-circle" - ], - "defaultCode": 61546, - "grid": 14 - }, - "attrs": [], - "properties": { - "id": 100, - "order": 4, - "prevSize": 28, - "code": 58880, - "name": "exclamation-sign", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 0 - }, - { - "icon": { - "paths": [ - "M585.143 786.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-54.857v-292.571q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h54.857v182.857h-54.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h256q8 0 13.143-5.143t5.143-13.143zM512 274.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-109.714q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h109.714q8 0 13.143-5.143t5.143-13.143zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z" - ], - "attrs": [], - "isMulticolor": false, - "tags": [ - "info-circle" - ], - "defaultCode": 61530, - "grid": 14 - }, - "attrs": [], - "properties": { - "id": 85, - "order": 3, - "name": "info-sign", - "prevSize": 28, - "code": 58882 - }, - "setIdx": 0, - "iconIdx": 2 - }, - { - "icon": { - "paths": [ - "M733.714 419.429q0-16-10.286-26.286l-52-51.429q-10.857-10.857-25.714-10.857t-25.714 10.857l-233.143 232.571-129.143-129.143q-10.857-10.857-25.714-10.857t-25.714 10.857l-52 51.429q-10.286 10.286-10.286 26.286 0 15.429 10.286 25.714l206.857 206.857q10.857 10.857 25.714 10.857 15.429 0 26.286-10.857l310.286-310.286q10.286-10.286 10.286-25.714zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z" - ], - "attrs": [], - "isMulticolor": false, - "tags": [ - "check-circle" - ], - "defaultCode": 61528, - "grid": 14 - }, - "attrs": [], - "properties": { - "id": 83, - "order": 9, - "prevSize": 28, - "code": 58886, - "name": "ok-sign" - }, - "setIdx": 0, - "iconIdx": 6 - }, - { - "icon": { - "paths": [ - "M658.286 475.429q0-105.714-75.143-180.857t-180.857-75.143-180.857 75.143-75.143 180.857 75.143 180.857 180.857 75.143 180.857-75.143 75.143-180.857zM950.857 950.857q0 29.714-21.714 51.429t-51.429 21.714q-30.857 0-51.429-21.714l-196-195.429q-102.286 70.857-228 70.857-81.714 0-156.286-31.714t-128.571-85.714-85.714-128.571-31.714-156.286 31.714-156.286 85.714-128.571 128.571-85.714 156.286-31.714 156.286 31.714 128.571 85.714 85.714 128.571 31.714 156.286q0 125.714-70.857 228l196 196q21.143 21.143 21.143 51.429z" - ], - "width": 951, - "attrs": [], - "isMulticolor": false, - "tags": [ - "search" - ], - "defaultCode": 61442, - "grid": 14 - }, - "attrs": [], - "properties": { - "id": 2, - "order": 1, - "prevSize": 28, - "code": 58887, - "name": "icon-search" - }, - "setIdx": 0, - "iconIdx": 7 - } - ], - "height": 1024, - "metadata": { - "name": "slate", - "license": "SIL OFL 1.1" - }, - "preferences": { - "showGlyphs": true, - "showQuickUse": true, - "showQuickUse2": true, - "showSVGs": true, - "fontPref": { - "prefix": "icon-", - "metadata": { - "fontFamily": "slate", - "majorVersion": 1, - "minorVersion": 0, - "description": "Based on FontAwesome", - "license": "SIL OFL 1.1" - }, - "metrics": { - "emSize": 1024, - "baseline": 6.25, - "whitespace": 50 - }, - "resetPoint": 58880, - "showSelector": false, - "selector": "class", - "classSelector": ".icon", - "showMetrics": false, - "showMetadata": true, - "showVersion": true, - "ie7": false - }, - "imagePref": { - "prefix": "icon-", - "png": true, - "useClassSelector": true, - "color": 4473924, - "bgColor": 16777215 - }, - "historySize": 100, - "showCodes": true, - "gridSize": 16, - "showLiga": false - } -} diff --git a/go.mod b/go.mod new file mode 100644 index 00000000000..32c34515c99 --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module github.com/bep/docuapi + +go 1.12 + +require ( + github.com/bep/empty-hugo-module v1.0.0 // indirect + github.com/jquery/jquery-dist v0.0.0-20191202185020-55b7d19f7bf1 // indirect + github.com/lord/slate v2.3.1+incompatible // indirect + github.com/olivernn/lunr.js v2.3.8+incompatible // indirect + github.com/slatedocs/slate v2.4.0+incompatible // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000000..ccd00ebea7b --- /dev/null +++ b/go.sum @@ -0,0 +1,10 @@ +github.com/bep/empty-hugo-module v1.0.0 h1:aYc9RWea644CdYjg9zCy8nkVF4KjC3fwhUTvvcXXg8s= +github.com/bep/empty-hugo-module v1.0.0/go.mod h1:whohinbSjMoFi/Skivj9kvdPs1tEgzYpZ4rXoQk/0/I= +github.com/jquery/jquery-dist v0.0.0-20191202185020-55b7d19f7bf1 h1:5J/Uu1ow4Ldq50ZaN8fq9qkqDq6UJdjSoHy6oVBBSR4= +github.com/jquery/jquery-dist v0.0.0-20191202185020-55b7d19f7bf1/go.mod h1:/lTfttEqFU0GWTaOOMIeNTzLGQ7yTIgyzjtkS/pYIoc= +github.com/lord/slate v2.3.1+incompatible h1:uRy5iSKUWJdeozlS9RVWbeC1ZRyySLOCn20ve6iYw6A= +github.com/lord/slate v2.3.1+incompatible/go.mod h1:ujwDH+XJN1hPpN4JfN8Cp65e5jk3DGf+Jz0/nbJxoUM= +github.com/olivernn/lunr.js v2.3.8+incompatible h1:t9qfO9qpBCSEhjnvTHQtfOA8Ggwnvn5Y1JWFalyoPl0= +github.com/olivernn/lunr.js v2.3.8+incompatible/go.mod h1:yEkQ1DUSMtNsn8n2CqvQXZd0ErWPEG8g9QRmblR+KS8= +github.com/slatedocs/slate v2.4.0+incompatible h1:E8sca4Vmkm907VmW80ruTl18pkP/jPwVXB1WpF9C0AI= +github.com/slatedocs/slate v2.4.0+incompatible/go.mod h1:n698aXLkExWIlF7prJey0Kq6wlKIKvj/stVb5oouZDM= diff --git a/hugow b/hugow new file mode 100755 index 00000000000..9d3e3ac94f7 --- /dev/null +++ b/hugow @@ -0,0 +1,437 @@ +#!/usr/bin/env sh +# ------------------------------------------------------------------------------ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ +# Hugo Wrapper (v1.3.0) +# +# Hugo Wrapper is a POSIX-style shell script which acts as a wrapper to download +# and execute Hugo binary for your platform. It can be executed in variety of +# Operating Systems and Command Shells. As a result, hugow has very minimal +# number of dependencies: +# +# downloader: wget or curl +# checksum : sha256sum or shasum or cksum +# tarball : tar +# +# https://github.com/khos2ow/hugo-wrapper +# ------------------------------------------------------------------------------ + +set -e + +VERSION_NUMBER="v1.3.0" + +# hugo-wrapper command available flags +get_version="" +get_latest=false +get_extended=false +upgrade=false +version=false +show_help=false + +# hugo related commands to pass through the actual binary +HUGO_ARGS="" + +while [ -n "$1" ]; do + case "$1" in + --get-version) get_version=$2; shift 2 ;; + --get-latest) get_latest=true; shift 1 ;; + --get-extended) get_extended=true; shift 1 ;; + --upgrade) upgrade=true; shift 1 ;; + --version) version=true; shift 1 ;; + -h | --help) show_help=true; shift 1 ;; + + *) HUGO_ARGS="$HUGO_ARGS $1"; shift 1 ;; + esac +done + +set -- $HUGO_ARGS + +if [ "$upgrade" = true ]; then + if [ "$get_extended" = true -o "$get_latest" = true -o -n "$get_version" ]; then + echo "Error: Flag --upgrade cannot be used together with --get-extended, --get-version or --get-latest" + exit 1 + fi +else + if [ "$get_latest" = true -a -n "$get_version" ]; then + echo "Error: Flags --get-version and --get-latest cannot be used together" + exit 1 + fi +fi + +# normalizing get_version +get_version_base="$(echo "$get_version" | cut -d "/" -f1)" +get_version_extended="$(echo "$get_version" | cut -d "/" -f2)" + +get_version="$get_version_base" + +if [ "$get_version_extended" = "extended" ]; then + get_extended=true +fi + +# check which download command (wget or curl) is available. +DOWNLOAD_COMMAND="" +DOWNLOAD_OUTPUT="" +DOWNLOAD_SILENT="" +DOWNLOAD_REDIRECT="" + +if command -v wget > /dev/null; then + DOWNLOAD_COMMAND="wget" + DOWNLOAD_OUTPUT="-O" + DOWNLOAD_SILENT="-q" + DOWNLOAD_REDIRECT="" +elif command -v curl > /dev/null; then + DOWNLOAD_COMMAND="curl" + DOWNLOAD_OUTPUT="-o" + DOWNLOAD_SILENT="-s" + DOWNLOAD_REDIRECT="-L" +else + echo "Error: Unable to find 'wget' or 'curl' command." + exit 1 +fi + +# OS type +os_type="" + +case "`uname -s`" in + Darwin) os_type="macOS" ;; + Linux) os_type="Linux" ;; + DragonFly) os_type="DragonFlyBSD" ;; + FreeBSD) os_type="FreeBSD" ;; + NetBSD) os_type="NetBSD" ;; + OpenBSD) os_type="OpenBSD" ;; + # CYGWIN* os_type="Windows" ;; + # MINGW*) os_type="Windows" ;; + # Windows_NT) os_type="Windows" ;; +esac + +# OS architecture +os_arch="" + +case "`uname -m`" in + x86) os_arch="32bit" ;; + x86_64) os_arch="64bit" ;; + amd64) os_arch="64bit" ;; + armv7l) os_arch="ARM" ;; + armv8) os_arch="ARM64" ;; +esac + +if [ -z "$os_type" -o -z "$os_arch" ]; then + echo "Error: Unknown OS type or architecture" + exit 1 +fi + +# ------------------------------------------------------------------------------ +# traverses directory structure from process work directory to filesystem root +# first directory with .hugo subdirectory is considered project base directory +# ------------------------------------------------------------------------------ +find_basedir() { + if [ -z "$1" ]; then + echo "Error: Path not specified to find_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ]; do + if [ -d "$wdir"/.hugo ]; then + basedir=$wdir + break + fi + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + done + echo "${basedir}" +} + +BASE_DIR=`find_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + echo "Error: Unable to find base directory." + exit 1 +fi + +if [ ! -d "$BASE_DIR/.hugo" ]; then + mkdir -p "$BASE_DIR/.hugo" +else + if [ -r "$BASE_DIR/.hugo/hugo" -a ! -s "$BASE_DIR/.hugo/hugo" ]; then + rm "$BASE_DIR/.hugo/hugo" + fi + if [ -r "$BASE_DIR/.hugo/version" -a ! -s "$BASE_DIR/.hugo/version" ]; then + rm "$BASE_DIR/.hugo/version" + fi +fi + +parse_json() { + local json="$1" + local field="$2" + + if [ -z "$json" ]; then + echo "" + elif [ -z "$field" ]; then + echo "" + fi + + temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $field` + + echo ${temp##*|} | sed "s/${field}: //g" +} + +perform_checksum() { + if [ -n "$1" ]; then + if command -v sha256sum > /dev/null; then + echo "$1" | sha256sum --check > /dev/null + elif command -v shasum > /dev/null; then + echo "$1" | shasum --algorithm 256 --check > /dev/null + elif command -v cksum > /dev/null; then + echo "$1" | cksum -a SHA256 -c > /dev/null + else + echo "Error: cannot find any checksum command" + exit 1 + fi + fi +} + +remove_file() { + if [ -n "$1" -a "$1" != "/" -a -f "$1" -a -r "$1" ] ; then + rm "$1" + fi +} + +download_version() { + local versionToDownload="$1" + local isExtended="$2" + + if [ -n "$versionToDownload" ]; then + local majorVersion=`echo ${versionToDownload} | cut -d. -f1` + local minorVersion=`echo ${versionToDownload} | cut -d. -f2` + local filenamePrefix="hugo" + local checksumFilenamePrefix="${filenamePrefix}" + local versionDownloadSuffix="" + + if [ "$isExtended" = true ]; then + if [ "$majorVersion" -eq 0 -a "$minorVersion" -lt 56 ] ; then + checksumFilenamePrefix="hugo_extended" + fi + + filenamePrefix="hugo_extended" + versionDownloadSuffix="/extended" + fi + + if [ "$versionToDownload" = "LATEST" ]; then + latest_release=`$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT ${DOWNLOAD_OUTPUT}- https://api.github.com/repos/gohugoio/hugo/releases/latest` + versionToDownload=`parse_json "$latest_release" "tag_name"` + fi + + # strip down 'v' from begining of the string if exists + versionToDownload=`echo $versionToDownload | sed -ne 's/[^0-9]*\(\([0-9]*\.\)\{0,4\}[0-9]*\(\/extended\)*\).*/\1/p'` + + printf "downloading hugo binary version v${versionToDownload}${versionDownloadSuffix} ... " + + # download for specific OS and architecture + local binaryUrl="https://github.com/gohugoio/hugo/releases/download/v${versionToDownload}/${filenamePrefix}_${versionToDownload}_${os_type}-${os_arch}.tar.gz" + local checksumUrl="https://github.com/gohugoio/hugo/releases/download/v${versionToDownload}/${checksumFilenamePrefix}_${versionToDownload}_checksums.txt" + + local tarballName="${filenamePrefix}_${versionToDownload}_${os_type}-${os_arch}.tar.gz" + local tarballPath="$BASE_DIR/.hugo/${tarballName}" + local checksumName="checksum.txt" + local checksumPath="$BASE_DIR/.hugo/${checksumName}" + + $DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT $DOWNLOAD_OUTPUT "$tarballPath" "$binaryUrl" & + $DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT $DOWNLOAD_OUTPUT "$checksumPath" "$checksumUrl" & + wait + + if [ -s "$tarballPath" -a -s "$checksumPath" ]; then + printf "[done]\n" + else + printf "[failed]\n" + remove_file "$checksumPath" + remove_file "$tarballPath" + exit 1 + fi + + printf "verifying hugo binary version v${versionToDownload}${versionDownloadSuffix} ..... " + cd $BASE_DIR/.hugo/ + grep "${tarballName}" "$BASE_DIR/.hugo/$checksumName" | perform_checksum + cd - > /dev/null 2>&1 + wait + printf "[done]\n" + + printf "unzipping hugo binary version v${versionToDownload}${versionDownloadSuffix} ..... " + if [ -f "${tarballPath}" -a -r "${tarballPath}" ]; then + tar --directory="$BASE_DIR/.hugo/" -xzf "${tarballPath}" 2>&1 + wait + printf "[done]\n" + else + printf "[failed]\n" + remove_file "$checksumPath" + remove_file "$tarballPath" + exit 1 + fi + + # save the downloaded binary version into $BASE_DIR/.hugo/version + echo "${versionToDownload}${versionDownloadSuffix}" > $BASE_DIR/.hugo/version + + # cleanup after extraction + remove_file "$checksumPath" + remove_file "$tarballPath" + remove_file "$BASE_DIR/.hugo/LICENSE" + remove_file "$BASE_DIR/.hugo/README.md" + fi +} + +# ------------------------------------------------------------------------------ +# upgrade hugo wrapper binary and save it as ${BASE_DIR}/hugow +# ------------------------------------------------------------------------------ +if [ "$version" = true ]; then + echo "Hugo Wrapper $VERSION_NUMBER" + exit +fi + +# ------------------------------------------------------------------------------ +# upgrade hugo wrapper binary and save it as ${BASE_DIR}/hugow +# ------------------------------------------------------------------------------ +if [ "$upgrade" = true ]; then + printf "downloading hugow binary ... " + + latest_release=`$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT ${DOWNLOAD_OUTPUT}- https://api.github.com/repos/khos2ow/hugo-wrapper/releases/latest` + versionToDownload=`parse_json "$latest_release" "tag_name"` + + $DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT $DOWNLOAD_OUTPUT "hugow" "https://github.com/khos2ow/hugo-wrapper/releases/download/${versionToDownload}/hugow" & + wait + printf "[done]\n" + chmod +x hugow + exit +fi + +# ------------------------------------------------------------------------------ +# download hugo binary and save it as ${BASE_DIR}/.hugo/hugo +# ------------------------------------------------------------------------------ +if [ -r "$BASE_DIR/.hugo/hugo" ]; then + current_binary_version="$($BASE_DIR/.hugo/hugo version | sed -ne 's/[^0-9]*\(\([0-9]*\.\)\{0,4\}[0-9]*\(-[0-9a-fA-F]*\)*\(\/extended\)*\).*/\1/p' | sed 's/-[0-9A-Fa-f]*//p' | sed 's/^ *//;s/ *$//' | uniq)" + + if [ "$get_extended" = true ]; then + suffix_extended_version="/extended" + fi + + # download hugo binary and save it as ${BASE_DIR}/.hugo/hugo + if [ -n "$get_version" ]; then + if [ "${get_version}${suffix_extended_version}" != "$current_binary_version" ]; then + # specified hugo version + download_version "$get_version" $get_extended + else + echo "hugo binary version ${get_version}${suffix_extended_version} already exists" + echo "${get_version}${suffix_extended_version}" > $BASE_DIR/.hugo/version + fi + elif [ $get_latest = true ]; then + latest_release=`$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT ${DOWNLOAD_OUTPUT}- https://api.github.com/repos/gohugoio/hugo/releases/latest` + latest_version=`parse_json "$latest_release" "tag_name" | sed -ne 's/[^0-9]*\(\([0-9]*\.\)\{0,4\}[0-9]*\(\/extended\)*\).*/\1/p'` + + if [ "${latest_version}${suffix_extended_version}" != "$current_binary_version" ]; then + # latest hugo version + download_version "$latest_version" $get_extended + else + echo "latest hugo binary version ${latest_version}${suffix_extended_version} already exists" + echo "${latest_version}${suffix_extended_version}" > $BASE_DIR/.hugo/version + fi + elif [ -r "$BASE_DIR/.hugo/version" ]; then + current_file_version="$(cat "$BASE_DIR/.hugo/version")" + + if [ "$current_file_version" != "$current_binary_version" ]; then + version_from_file="$(echo "$current_file_version" | cut -d "/" -f1)" + extended_from_file="$(echo "$current_file_version" | cut -d "/" -f2)" + + if [ "${extended_from_file}" = "extended" ]; then + isExtended=true + else + isExtended=false + fi + + # specified hugo version + download_version "$version_from_file" $isExtended + fi + else + # save the current binary version into $BASE_DIR/.hugo/version + echo "$current_binary_version" > $BASE_DIR/.hugo/version + fi +else + if [ -n "$get_version" ]; then + # specified hugo version + download_version "$get_version" $get_extended + elif [ $get_latest = true ]; then + # latest hugo version + download_version "LATEST" $get_extended + elif [ -r "$BASE_DIR/.hugo/version" ]; then + # specified hugo version + version_from_file="$(cat "$BASE_DIR/.hugo/version" | cut -d "/" -f1)" + extended_from_file="$(cat "$BASE_DIR/.hugo/version" | cut -d "/" -f2)" + + if [ "${extended_from_file}" = "extended" ]; then + isExtended=true + else + isExtended=false + fi + + download_version "${version_from_file}" $isExtended + else + # latest hugo version + download_version "LATEST" $get_extended + fi +fi + +# ------------------------------------------------------------------------------ +# only download binary and not execute hugo related command +# ------------------------------------------------------------------------------ +if [ "$get_latest" = true -o -n "$get_version" ]; then + ${BASE_DIR}/.hugo/hugo version + exit +fi + +# ------------------------------------------------------------------------------ +# Show help, both from hugow and ${BASE_DIR}/.hugo/hugo +# ------------------------------------------------------------------------------ +if [ $show_help = true ]; then + help=$(${BASE_DIR}/.hugo/hugo --help) + cat << USAGE +hugow is the universal wrapper for hugo main command. + +Hugo is a Fast and Flexible Static Site Generator +built with love by spf13 and friends in Go. + +Complete documentation is available at http://gohugo.io/. + +Flags: + --get-extended get hugo extended binary + --get-latest get latest version of hugo binary + --get-version string get specified version of hugo binary + --upgrade upgrade hugo wrapper binary itself + --version show version of hugo wrapper binary itself + -h, --help help for hugo-wrapper + +-------- + +$help +USAGE + exit 0 +fi + +# ------------------------------------------------------------------------------ +# pass commands and flags to actual hugo binary +# ------------------------------------------------------------------------------ +${BASE_DIR}/.hugo/hugo "$@" diff --git a/layouts/partials/hook_head_end.html b/layouts/partials/hook_head_end.html new file mode 100644 index 00000000000..eb338e12c46 --- /dev/null +++ b/layouts/partials/hook_head_end.html @@ -0,0 +1,13 @@ + +{{ with getenv "ADD_GA" }} + +{{ end }} diff --git a/layouts/partials/hook_left_sidebar_end.html b/layouts/partials/hook_left_sidebar_end.html new file mode 100644 index 00000000000..3fa7a7bde6e --- /dev/null +++ b/layouts/partials/hook_left_sidebar_end.html @@ -0,0 +1,7 @@ +{{ if getenv "REPOSITORY_URL" -}} +
+ + + +
+{{ end }} diff --git a/lib/multilang.rb b/lib/multilang.rb deleted file mode 100644 index 36fbe5b1f07..00000000000 --- a/lib/multilang.rb +++ /dev/null @@ -1,16 +0,0 @@ -module Multilang - def block_code(code, full_lang_name) - if full_lang_name - parts = full_lang_name.split('--') - rouge_lang_name = (parts) ? parts[0] : "" # just parts[0] here causes null ref exception when no language specified - super(code, rouge_lang_name).sub("highlight #{rouge_lang_name}") do |match| - match + " tab-" + full_lang_name - end - else - super(code, full_lang_name) - end - end -end - -require 'middleman-core/renderers/redcarpet' -Middleman::Renderers::MiddlemanRedcarpetHTML.send :include, Multilang diff --git a/lib/nesting_unique_head.rb b/lib/nesting_unique_head.rb deleted file mode 100644 index 01278371c17..00000000000 --- a/lib/nesting_unique_head.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Nested unique header generation -require 'middleman-core/renderers/redcarpet' - -class NestingUniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML - def initialize - super - @@headers_history = {} if !defined?(@@headers_history) - end - - def header(text, header_level) - friendly_text = text.gsub(/<[^>]*>/,"").parameterize - @@headers_history[header_level] = text.parameterize - - if header_level > 1 - for i in (header_level - 1).downto(1) - friendly_text.prepend("#{@@headers_history[i]}-") if @@headers_history.key?(i) - end - end - - return "#{text}" - end -end diff --git a/lib/toc_data.rb b/lib/toc_data.rb deleted file mode 100644 index 4a04efee26f..00000000000 --- a/lib/toc_data.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'nokogiri' - -def toc_data(page_content) - html_doc = Nokogiri::HTML::DocumentFragment.parse(page_content) - - # get a flat list of headers - headers = [] - html_doc.css('h1, h2, h3').each do |header| - headers.push({ - id: header.attribute('id').to_s, - content: header.children, - title: header.children.to_s.gsub(/<[^>]*>/, ''), - level: header.name[1].to_i, - children: [] - }) - end - - [3,2].each do |header_level| - header_to_nest = nil - headers = headers.reject do |header| - if header[:level] == header_level - header_to_nest[:children].push header if header_to_nest - true - else - header_to_nest = header if header[:level] < header_level - false - end - end - end - headers -end diff --git a/lib/unique_head.rb b/lib/unique_head.rb deleted file mode 100644 index d42bab2aa9d..00000000000 --- a/lib/unique_head.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Unique header generation -require 'middleman-core/renderers/redcarpet' -require 'digest' -class UniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML - def initialize - super - @head_count = {} - end - def header(text, header_level) - friendly_text = text.gsub(/<[^>]*>/,"").parameterize - if friendly_text.strip.length == 0 - # Looks like parameterize removed the whole thing! It removes many unicode - # characters like Chinese and Russian. To get a unique URL, let's just - # URI escape the whole header - friendly_text = Digest::SHA1.hexdigest(text)[0,10] - end - @head_count[friendly_text] ||= 0 - @head_count[friendly_text] += 1 - if @head_count[friendly_text] > 1 - friendly_text += "-#{@head_count[friendly_text]}" - end - return "#{text}" - end -end diff --git a/source/fonts/slate.eot b/source/fonts/slate.eot deleted file mode 100644 index 13c4839a1975d4c92d66753d75553f922743c6ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1876 zcmaJ?&2Jl35TEDWeRg&sP8)xqh$Kr)Yzaiu#`dnNaHtS!Xx9i53LF}#nAmmP`Xfq= z;s{Zte*qCEK;i~h4hYFPaA-x4sD#vVrBXQ{MIaD@1Ke8kn|8tnQ^fdI9N^x@? zd<=RUJW{D`U;b-v<0kYSA}zO8E|&DaCqF0BzlPme0}$TUZbAP8`m<~GR{K~75*dg= zcCEQu4DE@ZpmS=+>&5muJwb0nf0^x#V!izR7X1vpggLV7&CM3_1j&!tPMS_)mkgrN zC!rsJe5kniow8zt{RT+zltXle=pd}!=-!|+8X9a|iyqm&z#GOh#?Z4hMmoI$K1va6 zrUYgm&_U=R+`ZrJ0!LQ9E`42ef0@uHvC8U zo}w4%B?O&MCX$JGEG)w^HIqqa()pb0xK4IFpUb457c*fwDPqaQf|z%md}h1{#>ac0 zD>_@{@&c$_-fEYWRBE3yj7U8q4MTz%hA^cOxdwei%19MlXpM(P_)+e=@Rm}B>tXap zwoqO*DogaoKF+^`!zvX>{f10 zq*F6dk@0&Ok4=k2cHR|EKKaOn+_Q3KG-~~J-9n!;&D+d{W9=SQ|IqlDm9?y2uUl{( zi(0o$Q@Cby<g+B7U zE7gMM6{=S}Ps}C~lhg72%h#4X&vB-0d)je4Z)w>(?>M%-xE~jH;l@L}Lcyy(n4O9z z65lS`w&R>XbW_^$2bKN!lz(S%N3N!tcP>R={D&-^3rjyfS-aWi!AkH>sk+00G5&qW zC1%n(1Gmpd;5$IPUF_Lw@K%&WbbxEX?LgKcF9x!K$J`8LiMQ^#KsG5yOZ=|rBS1K&l2uG4tC&hwF_o-hDp_Le zTrgI}?0+pse - - -Generated by IcoMoon - - - - - - - - - - diff --git a/source/fonts/slate.ttf b/source/fonts/slate.ttf deleted file mode 100644 index ace9a46a7e1ed6b6ab3de2f30ef3e27c572f88d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1720 zcmaJ>-D_KA7=PaL@t*V?ZMro%kz(6pV-rwZy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{VeQz zoHLn@cwG?Yo(X!F(Q8iBOqSNs${h}C*?qJYLuZAnVXqx{ww|}Ux0`ca^V#hz?c7{r z7ldYbmk!M1m3G+IYC6(!VcCzqp&pJkZ#1@kw2W<^EJMqOM;^&dq6ELC*|pK!(cC0< zbZtF%BzLsuTw5O*+eg;dX0a+hcfI=gj8a~qWYJoMamHAo)!Qq|6&~9S8`{d0T?L&% z@$R=P6H0rTp6V+-Dlb>EB67JEMQ>kk%`y}{hvBC(RNEw)*%|U|4>SL+B=3rE@y*rw zR_bLZr&~XN?C;+yx2IilcDnrb?M)}An;DsTe@^rq$9L-UWNqY_oTyWyYisN3CMIh; z*C)b12exYgK^2c4S}J#2YJ+00rUlj%+LqQ7E%lldEc`K|1Bky)iLkwF{Wltvj!{A+PBEzhE3BX) zFBgqmj@&z?N1*=OK?z54T7is8FiA(N66oe`X+cKl>`n&&000000HC;3 zk^ug-#56-JW5JAtMV6Rgj#+|9A(7;@^`+^dWy@Alt7D86w|;R>QMs>d+47HJVfKhH aD;vc&%m&dlj4($-ipx}q&#}A+00017%3vV? diff --git a/source/images/navbar.png b/source/images/navbar.png deleted file mode 100644 index df38e90d87e1a215371b4977e18cde90f8832537..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 zcmeAS@N?(olHy`uVBq!ia0vp^3Lwk@BpAX3RW*PVQ%R6tFatx`>Tx_>TJ>3=9lGQbI%t3=F&$bi4+D2K~C1EUJS}cv}h!D@Y0p6Dv5{ zn_1eJf`L&b7#kS;l%%B^H8eCZ7@eY_{_g0e6doR}WY9CvJJmZtJZLaPoSUwrvxAMi zGvJTr-8tL~C}cPfoRqo;dMuPSdw*iG*JU`Wk#n^@27tRsSvfF6LXyG6=VU8oXTzBs zgROCmeG?@Yc!DR^ZtW@t8{`8wi9!b_0GMop|5+fpKq7WUO`jTsP(wpKfH#o_TZ529 zZh;QZK{V9%Ume4VpcZI>8Kn=$>-Aq45bfLSRa!~#@05gY=PY657AP1>%EZEj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76MA}zK zP!D)Pe!w`;!xbr5qT{H(D(k0lpdTlFbDR}$#k1$wuOdx=PArhW^?s(8 zi$0h{r#ffg&Hm1p%m8~@NfQM;WumTKSJ@*!3#pc;4^sza^kQ&x ziWMI6xLm4u1g<{B?8wnZu2=J*_@FI$^2cp77vhJjJt@p!TM}u$2lje`rHJS0e747!AGccKx#Q4?EW4e)ejQ zmX+TOXA;96QheeVMdU-pWUwC`5l6C=AuEh}j;%k2=ORF^Kb@M8v-yg?(Aaz**~1yK z6V2VJ&W265pgp2>=u(!|lYf+2?+dD#L z5FX>746?rkv@Ip3jt&SxLeSr(C`tDW>fR*= zEGZf+=`VDD1Pw`&DY^eWD+ouX`(&@c1U-cYONbt3?*hj<_W#9=?_0peh#+A@lBoy@ z9Q5~T1ToV4c4!A-F4;%{9$~rTLg%9YPxKE2e>4Ptd332#d)3?j+bU~t&#&D*9AT)? TOfkVny#A3ER}iZd`4sR!6I$hs diff --git a/source/includes/_error_codes.md b/source/includes/_error_codes.md deleted file mode 100644 index 3eba076e586..00000000000 --- a/source/includes/_error_codes.md +++ /dev/null @@ -1 +0,0 @@ -# Error codes diff --git a/source/includes/_errors.md b/source/includes/_errors.md deleted file mode 100644 index 7b35e92b5f3..00000000000 --- a/source/includes/_errors.md +++ /dev/null @@ -1,22 +0,0 @@ -# Errors - -

- -The Kittn API uses the following error codes: - - -Error Code | Meaning ----------- | ------- -400 | Bad Request -- Your request is invalid. -401 | Unauthorized -- Your API key is wrong. -403 | Forbidden -- The kitten requested is hidden for administrators only. -404 | Not Found -- The specified kitten could not be found. -405 | Method Not Allowed -- You tried to access a kitten with an invalid method. -406 | Not Acceptable -- You requested a format that isn't json. -410 | Gone -- The kitten requested has been removed from our servers. -418 | I'm a teapot. -429 | Too Many Requests -- You're requesting too many kittens! Slow down! -500 | Internal Server Error -- We had a problem with our server. Try again later. -503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. diff --git a/source/includes/administration/_service_connections.md b/source/includes/administration/_service_connections.md deleted file mode 100644 index f7124830b1f..00000000000 --- a/source/includes/administration/_service_connections.md +++ /dev/null @@ -1,72 +0,0 @@ -## Service connections - -Service connections are the services that you can create resources for (e.g. compute, object storage). [Environments](#environments) are created for a specific service which allows you to create and manage resources within that service. - - - - - -### List service connections - -`GET /services/connections` - -```json -{ - "data":[{ - "id": "adfbdb51-493b-45b1-8802-3f6327afb9e6", - "serviceCode": "compute-qc", - "name": "Compute - Québec", - "type": "CloudCA", - "status": { - "lastUpdated": "2017-08-15T12:00:00.000Z", - "reachable": true - } - }] -} -``` -```go -ccaClient := cca.NewCcaClient("your_api_key") -serviceConnection, err := ccaClient.ServiceConnections.List() -``` - -Attributes |   ----- | ----------- -`id`
*UUID* | The id of the service connection -`serviceCode`
*string* | The service code of the service connection. It is used in the endpoint of the services API. -`name`
*string* | The name of the service connection -`type`
*string* | The type of the service connection. -`status`
*Object* | Status of the service connection. Tells you if the service is up.
*includes*: `lastUpdated`, `reachable` - - - - -### Retrieve a service connection - -`GET /services/connections/:id` - -```json -{ - "data":[{ - "id": "adfbdb51-493b-45b1-8802-3f6327afb9e6", - "serviceCode": "compute-qc", - "name": "Compute - Québec", - "type": "CloudCA", - "status": { - "lastUpdated": "2017-08-15T12:00:00.000Z", - "reachable": true - } - }] -} -``` -```go -ccaClient := cca.NewCcaClient("your_api_key") -serviceConnections, err := ccaClient.ServiceConnections.Get("[service-connection-id]") -``` - -Attributes |   ----- | ----------- -`id`
*UUID* | The id of the service connection -`serviceCode`
*string* | The service code of the service connection. It is used in the endpoint of the services API. -`name`
*string* | The name of the service connection -`type`
*string* | The type of the service connection. -`status`
*Object* | Status of the service connection. Tells you if the service is up.
*includes*: `lastUpdated`, `reachable` diff --git a/source/includes/administration/_usage.md b/source/includes/administration/_usage.md deleted file mode 100644 index 27a06a22733..00000000000 --- a/source/includes/administration/_usage.md +++ /dev/null @@ -1,70 +0,0 @@ -## Usage - - - -### List usage summary - -`GET /usage_summary/organizations/:id` - -```shell -# Retrieve usage summary in JSON -curl "https://api.cloud.ca/v1/usage_summary/organizations/03bc22bd-adc4-46b8-988d-afddc24c0cb5?start_date=2017-05-01&end_date=2017-05-15&format=json" \ - -H "MC-Api-Key: your_api_key" - -# Response body example -``` -```json -{ - "data": [{ - "organizationId": "52fd201e-aa82-4a27-86b3-ea9650a7fb1e", - "serviceConnectionId": "beeba736-0451-49b0-8020-8b93ed5abb35", - "serviceConnectionPricingId": "e37cc44a-47b6-4a26-81f5-1dbf85433e36", - "utilityCost": 0.66, - "utilityUsage": 5.49999878, - "startDate": "2017-05-01T00:00:00.000Z", - "endDate": "2017-05-01T01:00:00.000Z", - "usageType": "1", - "secondaryType": "RAM" - }] -} -``` -```shell -# Retrieve usage summary in CSV -curl "https://api.cloud.ca/v1/usage_summary/organizations/03bc22bd-adc4-46b8-988d-afddc24c0cb5?start_date=2017-05-01&end_date=2017-05-15&format=csv" \ - -H "MC-Api-Key: your_api_key" - -# Response body example -organizationId,serviceConnectionId,startDate,endDate,usageType,secondaryType,serviceConnectionPricingId,utilityCost,utilityUsage -52fd201e-aa82-4a27-86b3-ea9650a7fb1e,beeba736-0451-49b0-8020-8b93ed5abb35,2017-05-01T00:00:00.000Z,2017-05-01T01:00:00.000Z,1,RAM,e37cc44a-47b6-4a26-81f5-1dbf85433e36,0.660000,5.49999878 -``` - -Retrieve the usage summary records for an organization and all of its sub-organizations for a specific period. The response can be in JSON (default) or CSV format. Additionally, you can aggregate these records using the different query parameters available. - -*Note*: Old records are aggregated by day instead of hour. If you try to query those records per hour, then you will receive an empty list. - -Attributes |   ----- | ----------- -`organizationId`
*UUID* | Id of the [organization](#organizations) -`serviceConnectionId`
*UUID* | Id of the [service connection](#service-connections) -`serviceConnectionPricingId`
*UUID* | Id of the service connection pricing -`utilityCost`
*string* | Utility cost of the record (aggregated per the period) -`utilityUsage`
*string* | Utility usage of the record -`startDate`
*string* | Start date of the record in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) -`endDate`
*string* | End date of the record in [ISO 8601](#https://en.wikipedia.org/wiki/ISO_8601) -`usageType`
*string* | Usage type of the record. -`secondaryType`
*string* | Secondary type of the record. - -Query Parameters (*required*) |   ----------- | ----- -`start_date`
*String* | Start date (inclusive). Should have the following format YYYY-MM-DD. -`end_date`
*String* | End date (exclusive). Should have the following format YYYY-MM-DD. - -Query Parameters |   ----------- | ----- -`service_connection_id`
*UUID* | Show usage summary for this service connection -`include_sub_orgs`
*boolean* | Include usage summary of all its sub-organizations. Defaults to false. -`include_cost`
*boolean* | Include the utility cost and service connection pricing id fields. Defaults to true. -`include_free_usage`
*boolean* | Include all summary records that has no cost associated to it (i.e. utilityCost == 0). Defaults to true. -`combine_usage_types`
*boolean* | Sums up all the utility cost per organization and service connection. The following fields are removed from the output: `serviceConnectionPricingId`, `usageType`, `secondaryType`, `utilityUsage` -`period`
*String* | The period on which the aggregation is made. HOUR, DAY or PERIOD. The default is HOUR. -`format`
*String* | JSON or CSV. Defaults to JSON. \ No newline at end of file diff --git a/source/includes/compute/_affinity_groups.md b/source/includes/compute/_affinity_groups.md deleted file mode 100644 index 4ef226aebb2..00000000000 --- a/source/includes/compute/_affinity_groups.md +++ /dev/null @@ -1,164 +0,0 @@ -### Affinity groups - -Affinity groups are a way of influencing on which host an [instance](#instances) will be deployed. An anti-affinity group (the only type of affinity group we support) allows you to put [instances](#instances) on different hosts to increase fault-tolerance. In the unlikely event of a host failure, your services would still be up on another host (assuming you distribute your services on multiple instances). - - - -#### List affinity groups - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ -"https://api.cloud.ca/v1/services/compute-on/test_area/affinitygroups" - -# Example: -``` -```json -{ - "data": [{ - "id": "d4fd794f-66e1-4906-a720-d0afb04bd517", - "name": "gnr", - "type":"host anti-affinity", - "instanceIds": [ - "92b4df86-fee3-4610-8167-78332b86362f" - ] - }], - "metadata": { - "recordCount": 1 - } -} -``` - -GET /services/:service_code/:environment_name/affinitygroups - -Retrieve a list of all affinity groups in an [environment](#environments) - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the affinity group -`name`
*string* | The name of the affinity group -`type`
*string* | The type of affinity group. We only support anti-affinity -`instanceIds`
*Array[UUID]* | The ids of the [instances](#instances) in the affinity group - - - - -#### Retrieve an affinity group - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/affinitygroups/d4fd794f-66e1-4906-a720-d0afb04bd517" - -# Example: -``` -```json -{ - "data": { - "id": "d4fd794f-66e1-4906-a720-d0afb04bd517", - "name": "gnr", - "type": "host anti-affinity", - "instanceIds": [ - "92b4df86-fee3-4610-8167-78332b86362f" - ] - } -} -``` - -GET /services/:service_code/:environment_name/affinitygroups/:id - -Retrieve information about an affinity group. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the affinity group -`name`
*string* | The name of the affinity group -`type`
*string* | The type of affinity group. We only support anti-affinity -`instanceIds`
*Array[UUID]* | The ids of the [instances](#instances) in the affinity group - - - - - -#### Create an affinity group - -```shell -curl -X POST \ - -H "Content-Type: application/json" \ - -H "MC-Api-Key: your_api_key" \ - -d "request_body" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/affinitygroups" - -# Request should look like this -``` -```json -{ - "name": "gnr", - "description": "My affinity group", - "type": "host anti-affinity", - "instanceIds": [ - "92b4df86-fee3-4610-8167-78332b86362f" - ] -} -``` - -POST /services/:service_code/:environment_name/affinitygroups - -Create an affinity group and add [instances](#instances) to it. - -Required |   ----------- | ----- -`name`
*string* | The name of the new affinity group -`description`
*string* | A description of the affinity group -`type`
*string* | The type of new affinity group. We only support anti-affinity -`instanceIds`
*Array[UUID]* | The ids of the [instances](#instances) in the affinity group - - - - - -#### Update an affinity group - -```shell -curl -X PUT \ - -H "Content-Type: application/json" \ - -H "MC-Api-Key: your_api_key" \ - -d "request_body" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/affinitygroups/d4fd794f-66e1-4906-a720-d0afb04bd517" - -# Request should look like this -``` -```json -{ - "instanceIds": [ - "92b4df86-fee3-4610-8167-78332b86362f", - "105f8b5e-5482-4bf5-88ca-7d7b7f431e3e" - ] -} -``` - -PUT /services/:service_code/:environment_name/affinitygroups/:id - -Update the list of [instances](#instances) in the affinity group. - -Required |   ----------- | ----- -`name`
*string* | The name of the new affinity group -`description`
*string* | A description of the affinity group -`type`
*string* | The type of new affinity group. We only support anti-affinity -`instanceIds`
*Array[UUID]* | The ids of the [instances](#instances) in the affinity group - - - - -#### Delete an affinity group - -```shell -curl -X DELETE \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/affinitygroups/d4fd794f-66e1-4906-a720-d0afb04bd517" -``` - -DELETE /services/:service_code/:environment_name/affinitygroups/:id - -Delete an existing affinity group. diff --git a/source/includes/compute/_compute.md b/source/includes/compute/_compute.md deleted file mode 100644 index 126b803d722..00000000000 --- a/source/includes/compute/_compute.md +++ /dev/null @@ -1 +0,0 @@ -## Compute diff --git a/source/includes/compute/_compute_offerings.md b/source/includes/compute/_compute_offerings.md deleted file mode 100644 index 6baf4caa3e7..00000000000 --- a/source/includes/compute/_compute_offerings.md +++ /dev/null @@ -1,98 +0,0 @@ -### Compute offerings - -Compute offerings determine the number of vCPUs and the size of the memory allocated to new [instances](#instances). - -#### List compute offerings - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/computeofferings" - -# The above command returns JSON structured like this: -``` -```json -{ - "data": [ - { - "id": "40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f", - "name": "Custom CPU and memory", - "custom" : true, - "availableCpuCountValues": [1, 2, 4, 8], - "availableMemoryInMBValues": [1024, 2048, 4096, 8192], - "maxMemoryInMBToCpuRatio": 2048 - }, - { - "id": "1fb0caba-8ffb-4e77-8dcb-401170e15e0a", - "name": "1vCPU.1GB", - "cpuCount": 1, - "memoryInMB": 1024, - "custom" : false - } - ], - "metadata": { - "recordCount": 2 - } -} -``` -```go -resources, _ := ccaClient.GetResources("compute-on", "test_area") -ccaResources := resources.(cloudca.Resources) -computeOfferings, _ := ccaResources.ComputeOfferings.List() -``` - -GET /services/:service_code/:environment_name/computeofferings - -Retrieve a list of available compute offerings. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the compute offering -`name`
*string* | The name of the compute offering -`memoryInMB`
*int* | The amount of provisioned memory in MB -`cpuCount`
*int* | The number of vCPUs available to the created [instance](#instances) -`custom`
*boolean* | If true, the `cpuCount` and `memoryInMB` fields will be missing from the response and will be required on [instance create](#create-an-instance) -`availableCpuCountValues`
*Array[integer]* | The list of valid cpu counts when used in the [create instance operation](#create-an-instance). Only present for custom offerings -`availableMemoryInMBValues`
*Array[integer]* | The list of valid amounts of memory (in MB) that can be used in the [create instance operation](#create-an-instance). Only present for custom offerings -`maxMemoryInMBToCpuRatio`
*integer* | The maximum ratio of memory (in MB) to number of CPU of an [instance](#instance) created with this offering. Only present for custom offerings. - -#### Retrieve a compute offering - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/computeofferings/40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f" - -# The above command returns JSON structured like this: -``` -```json -{ - "data": { - "id": "40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f", - "name": "1vCPU.512MB", - "cpuCount": 1, - "memoryInMB": 512, - "custom": false - } -} -``` -```go -resources, _ := ccaClient.GetResources("compute-on", "test_area") -ccaResources := resources.(cloudca.Resources) -computeOfferings, _ := ccaResources.ComputeOfferings.Get("40a2e5f7-22e6-4d1e-b03b-4a4b7c9cbc6f") -``` - -GET /services/:service_code/:environment_name/computeofferings/:id - -Retrieve a compute offering. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the compute offering -`name`
*string* | The name of the compute offering -`memoryInMB`
*int* | The amount of provisioned memory in MB -`cpuCount`
*int* | The number of vCPUs available to the created [instance](#instances) -`custom`
*boolean* | If true, the `cpuCount` and `memoryInMB` fields will be missing from the response and will be required on [instance create](#create-an-instance) -`availableCpuCountValues`
*Array[integer]* | The list of valid cpu counts when used in the [create instance operation](#create-an-instance). Only present for custom offerings -`availableMemoryInMBValues`
*Array[integer]* | The list of valid amounts of memory (in MB) that can be used in the [create instance operation](#create-an-instance). Only present for custom offerings -`maxMemoryInMBToCpuRatio`
*integer* | The maximum ratio of memory (in MB) to number of CPU of an [instance](#instance) created with this offering. Only present for custom offerings. diff --git a/source/includes/compute/_networking.md b/source/includes/compute/_networking.md deleted file mode 100644 index d4bbebfbcd1..00000000000 --- a/source/includes/compute/_networking.md +++ /dev/null @@ -1 +0,0 @@ -## Networking diff --git a/source/includes/compute/_nics.md b/source/includes/compute/_nics.md deleted file mode 100644 index 27a26374e03..00000000000 --- a/source/includes/compute/_nics.md +++ /dev/null @@ -1,199 +0,0 @@ -### NICs - - - - - -#### List NICs - - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/nics" - -# Example response: -``` -```json -{ - "data": [{ - "id": "fff1f45a-8350-4c87-be43-947b96d01ebd", - "name": "NIC-0", - "ipAddress": "10.169.253.165", - "isDefault": true, - "networkId": "d2243d4c-0dd8-4f8c-9ab4-4b1d285d5642", - "networkName": "Backend", - "gateway": "10.169.253.1", - "netmask": "255.255.255.0", - "instanceId": "b6145e8b-abd3ta-456c-832c-f3db86a6acfe", - "vpcId": "5aa9f5d7-55a9-43bf-bd2c-78a6bae1b267", - "vpcName": "default-vpc", - "secondaryIps": [ - { - "id": "9c28e297-5d23-41a3-a167-34dc24f1df19", - "ipAddress": "10.169.253.124" - } - ] - }], - "metadata": { - "recordCount": 1 - } -} -``` - -GET :service_code/:environment_name/portforwardingrules - -Retrieve a list of all NICs. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the NIC -`name`
*string* | The name of the NIC -`ipAddress`
*string* | The IP address of the NIC -`isDefault`
*string* | true if it's the default NIC of the [instance](#instances) (i.e. it will be the private IP on the instance) -`networkId`
*UUID* | The id of the [network](#networks) of the NIC -`networkName`
*string* | The name of the [network](#networks) of the NIC -`gateway`
*string* | The gateway of the [network](#networks) associated with the NIC -`netmask`
*string* | The netmask of the [network](#networks) associated with the NIC -`instanceId`
*string* | The id of the instance associated with the NIC -`vpcId`
*string* | The id of the [VPC](#vpcs) associated with the NIC -`vpcName`
*string* | The name of the [VPC](#vpcs) associated with the NIC -`secondaryIps`
*SecondaryIP* | The list of secondary IPs of the NIC
*includes:* `id`, `ipAddress` - -Query Parameters |   ----------- | ----- -`instance_id`
*UUID* | Filter the list to only retrieve the NICs of a specific [instance](#instances) -`network_id`
*UUID* | Filter the list to only retrieve the NICs of a specific [network](#networks) - - - - - -#### Retrieve a NIC - - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/nics/fff1f45a-8350-4c87-be43-947b96d01ebd" - -# Example response: -``` -```json -{ - "data": { - "id": "fff1f45a-8350-4c87-be43-947b96d01ebd", - "name": "NIC-0", - "ipAddress": "10.169.253.165", - "isDefault": true, - "networkId": "d2243d4c-0dd8-4f8c-9ab4-4b1d285d5642", - "networkName": "Backend", - "gateway": "10.169.253.1", - "netmask": "255.255.255.0", - "instanceId": "b6145e8b-abd3ta-456c-832c-f3db86a6acfe", - "vpcId": "5aa9f5d7-55a9-43bf-bd2c-78a6bae1b267", - "vpcName": "default-vpc", - "secondaryIps": [ - { - "id": "9c28e297-5d23-41a3-a167-34dc24f1df19", - "ipAddress": "10.169.253.124" - } - ] - } -} -``` - -GET /services/:service_code/:environment_name/nics/:id - -Retrieve an existing NIC. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the NIC -`name`
*string* | The name of the NIC -`ipAddress`
*string* | The IP address of the NIC -`isDefault`
*string* | true if it's the default NIC of the [instance](#instances) (i.e. it will be the private IP on the instance) -`networkId`
*UUID* | The id of the [network](#networks) of the NIC -`networkName`
*string* | The name of the [network](#networks) of the NIC -`gateway`
*string* | The gateway of the [network](#networks) associated with the NIC -`netmask`
*string* | The netmask of the [network](#networks) associated with the NIC -`instanceId`
*string* | The id of the [instance](#instances) associated with the NIC -`vpcId`
*string* | The id of the [VPC](#vpcs) associated with the NIC -`vpcName`
*string* | The name of the [VPC](#vpcs) associated with the NIC -`secondaryIps`
*SecondaryIP* | The list of secondary IPs of the NIC
*includes:* `id`, `ipAddress` - - - - - -#### Create a NIC - - -```shell - -# Example: - -curl -X POST \ - -H "Content-Type: application/json" \ - -H "MC-Api-Key: your_api_key" \ - -d "request_body" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/nics" - -# Request example: -``` -```json -{ - "networkId": "d67e986d-fe04-4827-836e-1697ede8ed30", - "instanceId": "96330eea-4424-46ca-825c-82fdd051d8c3" -} -``` - - -POST /services/:service_code/:environment_name/nics - -Create a NIC for an [instance](#instances) in a specific network. You can only have one NIC per [network](#networks). - -Required |   ------- | ----------- -`networkId`
*string* | The id of the [network](#networks) where to create the NIC -`instanceId`
*string* | The id of the [instance](#instances) where to attach the NIC - - - - - -#### Delete a NIC - - -```shell - -# Example: - -curl -X DELETE \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/nics" -``` - -DELETE /services/:service_code/:environment_name/nics/:id - -Delete an existing NIC. The NIC you're trying to delete must not be the default one. - - - - - -#### Set a NIC as default - - -```shell - -# Example: - -curl -X POST \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/nics/63ef1efe-225f-4e05-bc79-b3e457a041e2?operation=setDefault" -``` - -POST /services/:service_code/:environment_name/nics/:id?operation=setDefault - -Set an existing NIC as the default NIC of an [instance](#instances). diff --git a/source/includes/compute/_remote_access_vpns.md b/source/includes/compute/_remote_access_vpns.md deleted file mode 100644 index 0577676f5a3..00000000000 --- a/source/includes/compute/_remote_access_vpns.md +++ /dev/null @@ -1,79 +0,0 @@ -### Remote access VPNs - -Remote access VPNs allow users to connect to [VPCs](#vpcs) through secure connections. - -#### List remote access VPNs -```shell -curl -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/remoteaccessvpns" - -# Response example: -``` -```json -{ - "data": [ - { - "id": "10001e7d-b4ef-489b-836e-0619a383bc8d", - "publicIpAddress": "69.196.164.31", - "publicIpAddressId": "10001e7d-b4ef-489b-836e-0619a383bc8d", - "state": "Disabled" - }, - { - "id": "8925406c-8051-467e-a0ca-c48caa5bf670", - "presharedKey": "Kwth4JYUfXXmtMG4X7vAwRPH", - "publicIpAddress": "69.196.164.223", - "publicIpAddressId": "8925406c-8051-467e-a0ca-c48caa5bf670", - "state": "Enabled" - } - ], - "metadata": { - "recordCount": 2 - } -} -``` - -GET /services/:service_code/:environment_name/remoteaccessvpns - -List remote access VPNs. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the remote access VPN -`presharedKey`
*string* | The VPN's preshared key -`publicIpAddress`
*string* | The [public IP](#public-ips) (e.g. 208.80.154.224) -`publicIpAddressId`
*string* | The id of the [public IP](#public-ips) -`state`
*string* | The state.
*Possible values:* `Enabled`, `Disabled.` - -Query Parameters |   ----------- | ----- -`vpc_id`
*UUID* | Filter the list to only retrieve the VPN information of a specific [VPC](#vpcs) - -#### Retrieve a remote access VPN -```shell -curl -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/remoteaccessvpns/10001e7d-b4ef-489b-836e-0619a383bc8d" - -# Response example: -``` -```json -{ - "data": { - "id": "10001e7d-b4ef-489b-836e-0619a383bc8d", - "publicIpAddress": "69.196.164.31", - "publicIpAddressId": "10001e7d-b4ef-489b-836e-0619a383bc8d", - "state": "Disabled" - } -} -``` - -GET /services/:service_code/:environment_name/remoteaccessvpns/:id - -Retrieve a remote access VPN. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the remote access VPN -`presharedKey`
*string* | The VPN's preshared key -`publicIpAddress`
*string* | The [public IP](#public-ips) (e.g. 208.80.154.224) -`publicIpAddressId`
*string* | The id of the [public IP](#public-ips) -`state`
*string* | The state.
*Possible values:* `Enabled`, `Disabled.` diff --git a/source/includes/compute/_s2s_vpns.md b/source/includes/compute/_s2s_vpns.md deleted file mode 100644 index 9d0252b5928..00000000000 --- a/source/includes/compute/_s2s_vpns.md +++ /dev/null @@ -1,226 +0,0 @@ -### Site-to-site VPN - -A site-to-site VPN allows multiple sites to establish a secure connection over the public network. In our case, we are talking about a secure connection between your VPC and another network (e.g. VPC, offices). - - - -#### List site-to-site VPNs - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns" - -# Example: -``` -```json -{ - "data": [ - { - "id": "d49b2922-0581-4587-94df-6fe719327d0f", - "name": "stargate", - "state": "Connected", - "vpcId": "3fe7d82a-f4c4-4552-ac3b-787fdafed4e7", - "gateway":"19.19.19.19", - "cidr":"10.12.0.2/22", - "ipSecPsk": "WtOBS9GRux2XtJPtHY2TUvrv", - "ikeEncryptionAlgorithm": "3des", - "ikeHashAlgorithm": "sha1", - "ikeDhGroup":"modp1536", - "ikeLifetime":86400, - "espEncryptionAlgorithm":"3des", - "espHashAlgorithm":"sha1", - "espPerfectForwardSecrecy":"modp1536", - "espLifetime":3600, - "dpd": false, - "forceEncap": false - } - ], - "metadata": { - "recordCount": 1 - } -} -``` - -GET /services/:service_code/:environment_name/sitetositevpns - -Retrieve a list of all site-to-site VPNs in an [environment](#environments) - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the site-to-site VPN -`name`
*string* | The name of the site-to-site VPN -`state`
*string* | The state of the site-to-site VPN. Can be Connected, Pending, Disconnected or Error. If disconnected, you can try to use the [reset](#reset-the-connection-of-a-site-to-site-vpn) operation -`vpcId`
*UUID* | The VPC for which the site-to-site VPN was created. -`gateway`
*string* | The gateway of the network you want to connect to. NOTE: you cannot use a gateway that has already been used by a site-to-site VPN in your environment -`cidr`
*string* | CIDR of the network you want to connect to. -`ipSecPsk`
*string* | IPSec pre-shared key. Must contain at least 10 alphanumeric characters. -`ikeEncryptionAlgorithm`
*string* | The Internet Key Exchange (IKE) policy for phase-1. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. -`ikeHashAlgorithm`
*string* | The IKE hash for phase-1. The supported hash algorithms are SHA1 and MD5. -`ikeDhGroup`
*string* | A public-key cryptography protocol which allows two parties to establish a shared secret over an insecure communications channel. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). -`ikeLifetime`
*integer* | The phase-1 lifetime of the security association in seconds. -`espEncryptionAlgorithm`
*string* | Encapsulating Security Payload (ESP) algorithm within phase-2. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. -`espHashAlgorithm`
*string* | Encapsulating Security Payload (ESP) hash for phase-2. Supported hash algorithms are SHA1 and MD5. -`espPerfectForwardSecrecy`
*string* | Perfect Forward Secrecy (or PFS) is the property that ensures that a session key derived from a set of long-term public and private keys will not be compromised. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). -`espLifetime`
*integer* | The phase-2 lifetime of the security association in seconds -`dpd`
*boolean* | A method to detect an unavailable Internet Key Exchange (IKE) peer. -`forceEncap`
*boolean* | Force encapsulation for NAT Traversal - -Query Parameters |   ----------- | ----- -`vpc_id`
*UUID* | Filter the list to only retrieve the site-to-site VPNs of a [VPC](#vpcs) - - - -#### Retrieve a site-to-site VPN - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns/d49b2922-0581-4587-94df-6fe719327d0f" - -# Example: -``` -```json -{ - "data": { - "id": "d49b2922-0581-4587-94df-6fe719327d0f", - "name": "stargate", - "state": "Connected", - "vpcId": "3fe7d82a-f4c4-4552-ac3b-787fdafed4e7", - "gateway":"19.19.19.19", - "cidr":"10.12.0.2/22", - "ipSecPsk": "WtOBS9GRux2XtJPtHY2TUvrv", - "ikeEncryptionAlgorithm": "3des", - "ikeHashAlgorithm": "sha1", - "ikeDhGroup":"modp1536", - "ikeLifetime":86400, - "espEncryptionAlgorithm":"3des", - "espHashAlgorithm":"sha1", - "espPerfectForwardSecrecy":"modp1536", - "espLifetime":3600, - "dpd": false, - "forceEncap": false - } -} -``` - -GET /services/:service_code/:environment_name/sitetositevpns/:id - -Retrieve information about a site-to-site VPN. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the site-to-site VPN -`name`
*string* | The name of the site-to-site VPN -`state`
*string* | The state of the site-to-site VPN. Can be Connected, Pending, Disconnected or Error. If disconnected, you can try to use the [reset](#reset-the-connection-of-a-site-to-site-vpn) operation -`vpcId`
*UUID* | The VPC for which the site-to-site VPN was created. -`gateway`
*string* | The gateway of the network you want to connect to. NOTE: you cannot use a gateway that has already been used by a site-to-site VPN in your environment -`cidr`
*string* | CIDR of the network you want to connect to. -`ipSecPsk`
*string* | IPSec pre-shared key. Must contain at least 10 alphanumeric characters. -`ikeEncryptionAlgorithm`
*string* | The Internet Key Exchange (IKE) policy for phase-1. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. -`ikeHashAlgorithm`
*string* | The IKE hash for phase-1. The supported hash algorithms are SHA1 and MD5. -`ikeDhGroup`
*string* | A public-key cryptography protocol which allows two parties to establish a shared secret over an insecure communications channel. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). -`ikeLifetime`
*integer* | The phase-1 lifetime of the security association in seconds. -`espEncryptionAlgorithm`
*string* | Encapsulating Security Payload (ESP) algorithm within phase-2. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. -`espHashAlgorithm`
*string* | Encapsulating Security Payload (ESP) hash for phase-2. Supported hash algorithms are SHA1 and MD5. -`espPerfectForwardSecrecy`
*string* | Perfect Forward Secrecy (or PFS) is the property that ensures that a session key derived from a set of long-term public and private keys will not be compromised. The supported options are None, Group-5 (1536-bit) and Group-2 (1024-bit). -`espLifetime`
*integer* | The phase-2 lifetime of the security association in seconds -`dpd`
*boolean* | A method to detect an unavailable Internet Key Exchange (IKE) peer. -`forceEncap`
*boolean* | Force encapsulation for NAT Traversal - - - -#### Create a site-to-site VPN - -```shell - -# Here is the absolute minimum information required to create a new site-to-site VPN: - -curl -X POST \ - -H "Content-Type: application/json" \ - -H "MC-Api-Key: your_api_key" \ - -d "request_body" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns" - -# Request should look like this -``` -```json -{ - "name": "stargate", - "vpcId": "3fe7d82a-f4c4-4552-ac3b-787fdafed4e7", - "gateway":"19.19.19.19", - "cidr":"10.12.0.2/22", - "ipSecPsk": "WtOBS9GRux2XtJPtHY2TUvrv", - "ikeEncryptionAlgorithm": "3des", - "ikeHashAlgorithm": "sha1", - "ikeDhGroup":"modp1536", - "ikeLifetime":86400, - "espEncryptionAlgorithm":"3des", - "espHashAlgorithm":"sha1", - "espPerfectForwardSecrecy":"modp1536", - "espLifetime":3600, - "dpd": false, - "forceEncap": false - } -``` - POST /services/:service_code/:environment_name/sitetositevpns - -Create a site-to-site VPN - -Required |   ------- | ----------- -`name`
*string* | The name of the site-to-site VPN. Must be unique in the environment. -`vpcId`
*UUID* | The VPC for which the site-to-site VPN was created. -`gateway`
*string* | The gateway of the network you want to connect to. NOTE: you cannot use a gateway that has already been used by a site-to-site VPN in your environment -`cidr`
*string* | CIDR of the network you want to connect to. -`ipSecPsk`
*string* | IPSec pre-shared key. Must contain at least 10 alphanumeric characters. -`ikeEncryptionAlgorithm`
*string* | The Internet Key Exchange (IKE) policy for phase-1. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. -`ikeHashAlgorithm`
*string* | The IKE hash for phase-1. The supported hash algorithms are SHA1 and MD5. -`ikeLifetime`
*integer* | The phase-1 lifetime of the security association in seconds. -`espEncryptionAlgorithm`
*string* | Encapsulating Security Payload (ESP) algorithm within phase-2. The supported encryption algorithms are AES128, AES192, AES256, and 3DES. -`espHashAlgorithm`
*string* | Encapsulating Security Payload (ESP) hash for phase-2. Supported hash algorithms are SHA1 and MD5. -`espLifetime`
*integer* | The phase-2 lifetime of the security association in seconds - -Optional |   ------- | ----------- -`ikeDhGroup`
*string* | A public-key cryptography protocol which allows two parties to establish a shared secret over an insecure communications channel. The supported options are Group-5 (1536-bit) and Group-2 (1024-bit). -`espPerfectForwardSecrecy`
*string* | Perfect Forward Secrecy (or PFS) is the property that ensures that a session key derived from a set of long-term public and private keys will not be compromised. The supported options are Group-5 (1536-bit) and Group-2 (1024-bit). -`dpd`
*boolean* | A method to detect an unavailable Internet Key Exchange (IKE) peer. Defaults to false -`forceEncap`
*boolean* | Force encapsulation for NAT Traversal. Defaults to false - - - - -#### Delete a site-to-site VPN - - -```shell - -# Example: - -curl -X DELETE \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns/d49b2922-0581-4587-94df-6fe719327d0f" -``` - -DELETE /services/:service_code/:environment_name/sitetositevpns/:id - -Delete an existing site-to-site VPN. - - - - -#### Reset the connection of a site-to-site VPN - -```shell - -curl -X POST \ - -H "Content-Type: application/json" \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/sitetositevpns/ca86b14f-20db-463d-b58a-9d3fa5959af2?operation=reset" - -``` - POST /services/:service_code/:environment_name/sitetositevpns/:id?operation=reset - -Reset a site-to-site VPN. \ No newline at end of file diff --git a/source/includes/compute/_snapshots.md b/source/includes/compute/_snapshots.md deleted file mode 100644 index a0e87e7b85d..00000000000 --- a/source/includes/compute/_snapshots.md +++ /dev/null @@ -1,90 +0,0 @@ -### Snapshots - - A volume snapshot is a full image of a volume. They are often considered as backups, but in reality this is not 100% true since you have only the data written on disk. Volume Snapshots are typically used to derive new templates out of a running instance. - - - -#### List snapshots - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/snapshots" - -# Example: -``` -```json -{ - "data": [ - { - "id": "33a27b8d-5a27-42a5-aec4-37606e372bda", - "name": "i-douglas-ADM_foo_20161116211009", - "state": "BackedUp", - "intervalType": "MANUAL", - "volumeId": "c779ca42-6966-41af-a7dc-23db4e41d4ee", - "volume": "ROOT-35545", - "volumeType": "ROOT-35545" - } - ], - "metadata": { - "recordCount": 1 - } -} -``` - -GET /services/:service_code/:environment_name/snapshots - -Retrieve a list of all snapshots in an [environment](#environments) - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the snapshot -`name`
*string* | The name of the snapshot -`state`
*string* | The state of the snapshot -`intervalType`
*string* | The interval type. `MANUAL` means that you created the snapshot manually (i.e. it's not a recurring snapshot) -`volumeId`
*UUID* | The id of the [volume](#volumes) that was snapshotted -`volume`
*string* | The name of the [volume](#volumes) that was snapshotted -`volumeType`
*string* | The type of the [volume](#volumes) that was snapshotted - -Query Parameters |   ----------- | ----- -`volume_id`
*UUID* | Filter the list to only retrieve the snapshots of a specific [volume](#volumes) - - - -#### Retrieve a snapshot - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/snapshots/1bd672f4-b274-4371-a792-b0a6c6778cc7" - -# Example: -``` -```json -{ - "data": { - "id": "33a27b8d-5a27-42a5-aec4-37606e372bda", - "name": "i-douglas-ADM_foo_20161116211009", - "state": "BackedUp", - "intervalType": "MANUAL", - "volumeId": "c779ca42-6966-41af-a7dc-23db4e41d4ee", - "volume": "ROOT-35545", - "volumeType": "ROOT-35545" - } -} -``` - -GET /services/:service_code/:environment_name/snapshots/:id - -Retrieve information about a snapshot. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the snapshot -`name`
*string* | The name of the snapshot -`state`
*string* | The state of the snapshot -`intervalType`
*string* | The interval type. `MANUAL` means that you created the snapshot manually (i.e. it's not a recurring snapshot) -`volumeId`
*UUID* | The id of the [volume](#volumes) that was snapshotted -`volume`
*string* | The name of the [volume](#volumes) that was snapshotted -`volumeType`
*string* | The type of the [volume](#volumes) that was snapshotted diff --git a/source/includes/compute/_storage.md b/source/includes/compute/_storage.md deleted file mode 100644 index 78897cb2707..00000000000 --- a/source/includes/compute/_storage.md +++ /dev/null @@ -1 +0,0 @@ -## Storage diff --git a/source/includes/compute/_templates.md b/source/includes/compute/_templates.md deleted file mode 100644 index b7a8e5e1e3e..00000000000 --- a/source/includes/compute/_templates.md +++ /dev/null @@ -1,97 +0,0 @@ -### Templates -A template is a virtual disk image that can be used on the creation of an [instance](#instances). It contains the operating system which can contain some predefined configuration, files and software. Cloud.ca provides many default templates but you can also upload your own custom templates. - -#### List templates - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ - "https://api.cloud.ca/v1/services/compute-on/test_area/templates" - -# Example: -``` -```json -{ - "data": [{ - "id": "0b3fea04-b1ed-48cf-921d-96795dfe9a81", - "name": "ubuntu", - "description": "Example template", - "size": 52428800, - "isPublic": false, - "isReady": true, - "isDynamicallyScalable": true, - "sshKeyEnabled": true, - "created":"2016-10-24 2:40:29 PM EDT", - "osType": "Other (64-bit)", - "availableInZones": [ - "ea901007-056b-4c50-bb3a-2dd635fce2ab" - ] - }], - "metadata": { - "recordCount": 1 - } -} -``` - -GET /services/:service_code/:environment_name/templates - -Retrieve a list of all templates of an [environment](#environments) It will include all the public templates of the system. - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the template -`name`
*string* | The name of the template -`description`
*string* | The description of the template -`size`
*long* | The size of the template in bytes -`isPublic`
*boolean* | true if public to everyone. Your custom templates will always be private -`isReady`
*boolean* | true if the template is ready to be used for a new [instance](#instances) -`isDynamicallyScalable`
*boolean* | true if you can dynamically scale an [instance](#instances) with this template -`created`
*string* | The creation date of the template -`osType`
*string* | The OS type of the template (e.g. Ubuntu, CentOS...) -`availableInZones`
*array[UUID]* | List of all [zone ids](#zones) that the template is available in - -#### Retrieve a template - -```shell -curl -X GET \ - -H "MC-Api-Key: your_api_key" \ -"https://api.cloud.ca/v1/services/compute-on/test_area/templates/162cdfcb-45e5-4aa6-81c4-124c94621bdb" - -# Example: -``` -```json -{ - "data": { - "id": "0b3fea04-b1ed-48cf-921d-96795dfe9a81", - "name": "ubuntu", - "description": "Example template", - "size": 52428800, - "isPublic": false, - "isReady": true, - "isDynamicallyScalable": true, - "sshKeyEnabled": true, - "created":"2016-10-24 2:40:29 PM EDT", - "osType": "Other (64-bit)", - "availableInZones": [ - "ea901007-056b-4c50-bb3a-2dd635fce2ab" - ] - } -} -``` - -GET /services/:service_code/:environment_name/templates/:id - -Retrieve information about a public or private template of an [environment](#environments) - -Attributes |   ----------- | ----- -`id`
*UUID* | The id of the template -`name`
*string* | The name of the template -`description`
*string* | The description of the template -`size`
*long* | The size of the template in bytes -`isPublic`
*boolean* | true if public to everyone. Your custom templates will always be private -`isReady`
*boolean* | true if the template is ready to be used for a new [instance](#instances) -`isDynamicallyScalable`
*boolean* | true if you can dynamically scale an [instance](#instances) with this template -`created`
*string* | The creation date of the template -`osType`
*string* | The OS type of the template (e.g. Ubuntu, CentOS...) -`availableInZones`
*array[UUID]* | List of all [zone ids](#zones) that the template is available in diff --git a/source/index.html.md b/source/index.html.md deleted file mode 100644 index d62bbbedfe4..00000000000 --- a/source/index.html.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: cloud.ca API Documentation - -language_tabs: - - shell : curl - - go : go - - hcl: terraform - -toc_footers: - - Documentation Powered by Slate - -includes: - - getting_started - - administration - - compute - -subsections: - administration: - - service_connections - - organizations - - users - - environments - - usage - compute: - - - compute # Compute section - - instances - - templates - - ssh_keys - - affinity_groups - - networking # Networking section - - vpcs - - networks - - network_acls - - public_ips - - port_forwarding_rules - - load_balancer_rules - - nics - - remote_access_vpns - - vpn_users - - s2s_vpns - - storage # Storage section - - volumes - - snapshots - - offerings # Offerings section - - vpc_offerings - - network_offerings - - compute_offerings - - disk_offerings - - zones # Zones section -search: true ---- diff --git a/source/javascripts/all.js b/source/javascripts/all.js deleted file mode 100644 index 5f5d4067ba6..00000000000 --- a/source/javascripts/all.js +++ /dev/null @@ -1,2 +0,0 @@ -//= require ./all_nosearch -//= require ./app/_search diff --git a/source/javascripts/all_nosearch.js b/source/javascripts/all_nosearch.js deleted file mode 100644 index b18c1d833d4..00000000000 --- a/source/javascripts/all_nosearch.js +++ /dev/null @@ -1,16 +0,0 @@ -//= require ./lib/_energize -//= require ./app/_toc -//= require ./app/_lang - -$(function() { - loadToc($('#toc'), '.toc-link', '.toc-list-h2', 10); - setupLanguages($('body').data('languages')); - $('.content').imagesLoaded( function() { - window.recacheHeights(); - window.refreshToc(); - }); -}); - -window.onpopstate = function() { - activateLanguage(getLanguageFromQueryString()); -}; diff --git a/source/javascripts/app/_lang.js b/source/javascripts/app/_lang.js deleted file mode 100644 index 48642e8d95d..00000000000 --- a/source/javascripts/app/_lang.js +++ /dev/null @@ -1,180 +0,0 @@ -//= require ../lib/_jquery - -/* -Copyright 2008-2013 Concur Technologies, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); you may -not use this file except in compliance with the License. You may obtain -a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License. -*/ -;(function () { - 'use strict'; - - var languages = []; - - window.setupLanguages = setupLanguages; - window.activateLanguage = activateLanguage; - window.getLanguageFromQueryString = getLanguageFromQueryString; - - function activateLanguage(language) { - if (!language) return; - if (language === "") return; - var tabLang = language - - //same same but different - language = (language == "hcl" ? "dart" : language) - languages = languages.map(function(l){ - return l == "hcl" ? "dart": l - }); - - - $(".lang-selector a").removeClass('active'); - $(".lang-selector a[data-language-name='" + tabLang + "']").addClass('active'); - //Gr8 h4xx - $(".highlight.json").hide(); - $(".lang-specific.json").hide(); - for (var i=0; i < languages.length; i++) { - $(".highlight.tab-" + languages[i]).hide(); - $(".lang-specific." + languages[i]).hide(); - } - $(".highlight.tab-" + language).show(); - $(".lang-specific." + language).show(); - - if(language === "shell"){ - $(".highlight.json").show(); - $(".lang-specific.json").show(); - } - - window.recacheHeights(); - - // scroll to the new location of the position - if ($(window.location.hash).get(0)) { - $(window.location.hash).get(0).scrollIntoView(true); - } - } - - // parseURL and stringifyURL are from https://github.com/sindresorhus/query-string - // MIT licensed - // https://github.com/sindresorhus/query-string/blob/7bee64c16f2da1a326579e96977b9227bf6da9e6/license - function parseURL(str) { - if (typeof str !== 'string') { - return {}; - } - - str = str.trim().replace(/^(\?|#|&)/, ''); - - if (!str) { - return {}; - } - - return str.split('&').reduce(function (ret, param) { - var parts = param.replace(/\+/g, ' ').split('='); - var key = parts[0]; - var val = parts[1]; - - key = decodeURIComponent(key); - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); - - if (!ret.hasOwnProperty(key)) { - ret[key] = val; - } else if (Array.isArray(ret[key])) { - ret[key].push(val); - } else { - ret[key] = [ret[key], val]; - } - - return ret; - }, {}); - }; - - function stringifyURL(obj) { - return obj ? Object.keys(obj).sort().map(function (key) { - var val = obj[key]; - - if (Array.isArray(val)) { - return val.sort().map(function (val2) { - return encodeURIComponent(key) + '=' + encodeURIComponent(val2); - }).join('&'); - } - - return encodeURIComponent(key) + '=' + encodeURIComponent(val); - }).join('&') : ''; - }; - - // gets the language set in the query string - function getLanguageFromQueryString() { - if (location.search.length >= 1) { - var language = parseURL(location.search).language; - if (language) { - return language; - } else if (jQuery.inArray(location.search.substr(1), languages) != -1) { - return location.search.substr(1); - } - } - - return false; - } - - // returns a new query string with the new language in it - function generateNewQueryString(language) { - var url = parseURL(location.search); - if (url.language) { - url.language = language; - return stringifyURL(url); - } - return language; - } - - // if a button is clicked, add the state to the history - function pushURL(language) { - if (!history) { return; } - var hash = window.location.hash; - if (hash) { - hash = hash.replace(/^#+/, ''); - } - history.pushState({}, '', '?' + generateNewQueryString(language) + '#' + hash); - - // save language as next default - localStorage.setItem("language", language); - } - - function setupLanguages(l) { - var defaultLanguage = localStorage.getItem("language"); - - languages = l; - - var presetLanguage = getLanguageFromQueryString(); - if (presetLanguage) { - // the language is in the URL, so use that language! - activateLanguage(presetLanguage); - - localStorage.setItem("language", presetLanguage); - } else if ((defaultLanguage !== null) && (jQuery.inArray(defaultLanguage, languages) != -1)) { - // the language was the last selected one saved in localstorage, so use that language! - activateLanguage(defaultLanguage); - } else { - // no language selected, so use the default - activateLanguage(languages[0]); - } - } - - // if we click on a language tab, activate that language - $(function() { - $(".lang-selector a").on("click", function() { - var language = $(this).data("language-name"); - pushURL(language); - activateLanguage(language); - return false; - }); - }); -})(); diff --git a/source/javascripts/app/_search.js b/source/javascripts/app/_search.js deleted file mode 100644 index 403058e3f12..00000000000 --- a/source/javascripts/app/_search.js +++ /dev/null @@ -1,98 +0,0 @@ -//= require ../lib/_lunr -//= require ../lib/_jquery -//= require ../lib/_jquery.highlight -;(function () { - 'use strict'; - - var content, searchResults; - var highlightOpts = { element: 'span', className: 'search-highlight' }; - var searchDelay = 0; - var timeoutHandle = 0; - - var index = new lunr.Index(); - - index.ref('id'); - index.field('title', { boost: 10 }); - index.field('body'); - index.pipeline.add(lunr.trimmer, lunr.stopWordFilter); - - $(populate); - $(bind); - - function populate() { - $('h1, h2, h3, h4').each(function() { - var title = $(this); - var body = title.nextUntil('h1, h2, h3, h4'); - index.add({ - id: title.prop('id'), - title: title.text(), - body: body.text() - }); - }); - - determineSearchDelay(); - } - function determineSearchDelay() { - if(index.tokenStore.length>5000) { - searchDelay = 300; - } - } - - function bind() { - content = $('.content'); - searchResults = $('.search-results'); - - $('#input-search').on('keyup',function(e) { - var wait = function() { - return function(executingFunction, waitTime){ - clearTimeout(timeoutHandle); - timeoutHandle = setTimeout(executingFunction, waitTime); - }; - }(); - wait(function(){ - search(e); - }, searchDelay ); - }); - } - - function search(event) { - - var searchInput = $('#input-search')[0]; - - unhighlight(); - searchResults.addClass('visible'); - - // ESC clears the field - if (event.keyCode === 27) searchInput.value = ''; - - if (searchInput.value) { - var results = index.search(searchInput.value).filter(function(r) { - return r.score > 0.0001; - }); - - if (results.length) { - searchResults.empty(); - $.each(results, function (index, result) { - var elem = document.getElementById(result.ref); - searchResults.append("
  • " + $(elem).text() + "
  • "); - }); - highlight.call(searchInput); - } else { - searchResults.html('
  • '); - $('.search-results li').text('No Results Found for "' + searchInput.value + '"'); - } - } else { - unhighlight(); - searchResults.removeClass('visible'); - } - } - - function highlight() { - if (this.value) content.highlight(this.value, highlightOpts); - } - - function unhighlight() { - content.unhighlight(highlightOpts); - } -})(); - diff --git a/source/javascripts/app/_toc.js b/source/javascripts/app/_toc.js deleted file mode 100644 index eb20fef93f2..00000000000 --- a/source/javascripts/app/_toc.js +++ /dev/null @@ -1,122 +0,0 @@ -//= require ../lib/_jquery -//= require ../lib/_imagesloaded.min -;(function () { - 'use strict'; - - var htmlPattern = /<[^>]*>/g; - var loaded = false; - - var debounce = function(func, waitTime) { - var timeout = false; - return function() { - if (timeout === false) { - setTimeout(function() { - func(); - timeout = false; - }, waitTime); - timeout = true; - } - }; - }; - - var closeToc = function() { - $(".toc-wrapper").removeClass('open'); - $("#nav-button").removeClass('open'); - }; - - function loadToc($toc, tocLinkSelector, tocListSelector, scrollOffset) { - var headerHeights = {}; - var pageHeight = 0; - var windowHeight = 0; - var originalTitle = document.title; - - var recacheHeights = function() { - headerHeights = {}; - pageHeight = $(document).height(); - windowHeight = $(window).height(); - - $toc.find(tocLinkSelector).each(function() { - var targetId = $(this).attr('href'); - if (targetId[0] === "#") { - headerHeights[targetId] = $(targetId).offset().top; - } - }); - }; - - var refreshToc = function() { - var currentTop = $(document).scrollTop() + scrollOffset; - - if (currentTop + windowHeight >= pageHeight) { - // at bottom of page, so just select last header by making currentTop very large - // this fixes the problem where the last header won't ever show as active if its content - // is shorter than the window height - currentTop = pageHeight + 1000; - } - - var best = null; - for (var name in headerHeights) { - if ((headerHeights[name] < currentTop && headerHeights[name] > headerHeights[best]) || best === null) { - best = name; - } - } - - // Catch the initial load case - if (currentTop == scrollOffset && !loaded) { - best = window.location.hash; - loaded = true; - } - - var $best = $toc.find("[href='" + best + "']").first(); - if (!$best.hasClass("active")) { - // .active is applied to the ToC link we're currently on, and its parent
      s selected by tocListSelector - // .active-expanded is applied to the ToC links that are parents of this one - $toc.find(".active").removeClass("active"); - $toc.find(".active-parent").removeClass("active-parent"); - $best.addClass("active"); - $best.parents(tocListSelector).addClass("active").siblings(tocLinkSelector).addClass('active-parent'); - $best.siblings(tocListSelector).addClass("active"); - $toc.find(tocListSelector).filter(":not(.active)").slideUp(150); - $toc.find(tocListSelector).filter(".active").slideDown(150); - if (window.history.replaceState) { - window.history.replaceState(null, "", best); - } - var thisTitle = $best.data("title") - if (thisTitle !== undefined && thisTitle.length > 0) { - document.title = thisTitle + " – " + originalTitle; - } else { - document.title = originalTitle; - } - } - }; - - var makeToc = function() { - recacheHeights(); - refreshToc(); - - $("#nav-button").click(function() { - $(".toc-wrapper").toggleClass('open'); - $("#nav-button").toggleClass('open'); - return false; - }); - $(".page-wrapper").click(closeToc); - $(".toc-link").click(closeToc); - - // reload immediately after scrolling on toc click - $toc.find(tocLinkSelector).click(function() { - setTimeout(function() { - refreshToc(); - }, 0); - }); - - $(window).scroll(debounce(refreshToc, 200)); - $(window).resize(debounce(recacheHeights, 200)); - }; - - makeToc(); - - window.recacheHeights = recacheHeights; - window.refreshToc = refreshToc; - } - - window.loadToc = loadToc; -})(); diff --git a/source/javascripts/lib/_energize.js b/source/javascripts/lib/_energize.js deleted file mode 100644 index 6798f3c03f3..00000000000 --- a/source/javascripts/lib/_energize.js +++ /dev/null @@ -1,169 +0,0 @@ -/** - * energize.js v0.1.0 - * - * Speeds up click events on mobile devices. - * https://github.com/davidcalhoun/energize.js - */ - -(function() { // Sandbox - /** - * Don't add to non-touch devices, which don't need to be sped up - */ - if(!('ontouchstart' in window)) return; - - var lastClick = {}, - isThresholdReached, touchstart, touchmove, touchend, - click, closest; - - /** - * isThresholdReached - * - * Compare touchstart with touchend xy coordinates, - * and only fire simulated click event if the coordinates - * are nearby. (don't want clicking to be confused with a swipe) - */ - isThresholdReached = function(startXY, xy) { - return Math.abs(startXY[0] - xy[0]) > 5 || Math.abs(startXY[1] - xy[1]) > 5; - }; - - /** - * touchstart - * - * Save xy coordinates when the user starts touching the screen - */ - touchstart = function(e) { - this.startXY = [e.touches[0].clientX, e.touches[0].clientY]; - this.threshold = false; - }; - - /** - * touchmove - * - * Check if the user is scrolling past the threshold. - * Have to check here because touchend will not always fire - * on some tested devices (Kindle Fire?) - */ - touchmove = function(e) { - // NOOP if the threshold has already been reached - if(this.threshold) return false; - - this.threshold = isThresholdReached(this.startXY, [e.touches[0].clientX, e.touches[0].clientY]); - }; - - /** - * touchend - * - * If the user didn't scroll past the threshold between - * touchstart and touchend, fire a simulated click. - * - * (This will fire before a native click) - */ - touchend = function(e) { - // Don't fire a click if the user scrolled past the threshold - if(this.threshold || isThresholdReached(this.startXY, [e.changedTouches[0].clientX, e.changedTouches[0].clientY])) { - return; - } - - /** - * Create and fire a click event on the target element - * https://developer.mozilla.org/en/DOM/event.initMouseEvent - */ - var touch = e.changedTouches[0], - evt = document.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, window, 0, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); - evt.simulated = true; // distinguish from a normal (nonsimulated) click - e.target.dispatchEvent(evt); - }; - - /** - * click - * - * Because we've already fired a click event in touchend, - * we need to listed for all native click events here - * and suppress them as necessary. - */ - click = function(e) { - /** - * Prevent ghost clicks by only allowing clicks we created - * in the click event we fired (look for e.simulated) - */ - var time = Date.now(), - timeDiff = time - lastClick.time, - x = e.clientX, - y = e.clientY, - xyDiff = [Math.abs(lastClick.x - x), Math.abs(lastClick.y - y)], - target = closest(e.target, 'A') || e.target, // needed for standalone apps - nodeName = target.nodeName, - isLink = nodeName === 'A', - standAlone = window.navigator.standalone && isLink && e.target.getAttribute("href"); - - lastClick.time = time; - lastClick.x = x; - lastClick.y = y; - - /** - * Unfortunately Android sometimes fires click events without touch events (seen on Kindle Fire), - * so we have to add more logic to determine the time of the last click. Not perfect... - * - * Older, simpler check: if((!e.simulated) || standAlone) - */ - if((!e.simulated && (timeDiff < 500 || (timeDiff < 1500 && xyDiff[0] < 50 && xyDiff[1] < 50))) || standAlone) { - e.preventDefault(); - e.stopPropagation(); - if(!standAlone) return false; - } - - /** - * Special logic for standalone web apps - * See http://stackoverflow.com/questions/2898740/iphone-safari-web-app-opens-links-in-new-window - */ - if(standAlone) { - window.location = target.getAttribute("href"); - } - - /** - * Add an energize-focus class to the targeted link (mimics :focus behavior) - * TODO: test and/or remove? Does this work? - */ - if(!target || !target.classList) return; - target.classList.add("energize-focus"); - window.setTimeout(function(){ - target.classList.remove("energize-focus"); - }, 150); - }; - - /** - * closest - * @param {HTMLElement} node current node to start searching from. - * @param {string} tagName the (uppercase) name of the tag you're looking for. - * - * Find the closest ancestor tag of a given node. - * - * Starts at node and goes up the DOM tree looking for a - * matching nodeName, continuing until hitting document.body - */ - closest = function(node, tagName){ - var curNode = node; - - while(curNode !== document.body) { // go up the dom until we find the tag we're after - if(!curNode || curNode.nodeName === tagName) { return curNode; } // found - curNode = curNode.parentNode; // not found, so keep going up - } - - return null; // not found - }; - - /** - * Add all delegated event listeners - * - * All the events we care about bubble up to document, - * so we can take advantage of event delegation. - * - * Note: no need to wait for DOMContentLoaded here - */ - document.addEventListener('touchstart', touchstart, false); - document.addEventListener('touchmove', touchmove, false); - document.addEventListener('touchend', touchend, false); - document.addEventListener('click', click, true); // TODO: why does this use capture? - -})(); \ No newline at end of file diff --git a/source/javascripts/lib/_imagesloaded.min.js b/source/javascripts/lib/_imagesloaded.min.js deleted file mode 100644 index d66f658937d..00000000000 --- a/source/javascripts/lib/_imagesloaded.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * imagesLoaded PACKAGED v3.1.8 - * JavaScript is all like "You images are done yet or what?" - * MIT License - */ - -(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); \ No newline at end of file diff --git a/source/javascripts/lib/_jquery.highlight.js b/source/javascripts/lib/_jquery.highlight.js deleted file mode 100644 index 9dcf3c7af3f..00000000000 --- a/source/javascripts/lib/_jquery.highlight.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * jQuery Highlight plugin - * - * Based on highlight v3 by Johann Burkard - * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html - * - * Code a little bit refactored and cleaned (in my humble opinion). - * Most important changes: - * - has an option to highlight only entire words (wordsOnly - false by default), - * - has an option to be case sensitive (caseSensitive - false by default) - * - highlight element tag and class names can be specified in options - * - * Usage: - * // wrap every occurrance of text 'lorem' in content - * // with (default options) - * $('#content').highlight('lorem'); - * - * // search for and highlight more terms at once - * // so you can save some time on traversing DOM - * $('#content').highlight(['lorem', 'ipsum']); - * $('#content').highlight('lorem ipsum'); - * - * // search only for entire word 'lorem' - * $('#content').highlight('lorem', { wordsOnly: true }); - * - * // don't ignore case during search of term 'lorem' - * $('#content').highlight('lorem', { caseSensitive: true }); - * - * // wrap every occurrance of term 'ipsum' in content - * // with - * $('#content').highlight('ipsum', { element: 'em', className: 'important' }); - * - * // remove default highlight - * $('#content').unhighlight(); - * - * // remove custom highlight - * $('#content').unhighlight({ element: 'em', className: 'important' }); - * - * - * Copyright (c) 2009 Bartek Szopka - * - * Licensed under MIT license. - * - */ - -jQuery.extend({ - highlight: function (node, re, nodeName, className) { - if (node.nodeType === 3) { - var match = node.data.match(re); - if (match) { - var highlight = document.createElement(nodeName || 'span'); - highlight.className = className || 'highlight'; - var wordNode = node.splitText(match.index); - wordNode.splitText(match[0].length); - var wordClone = wordNode.cloneNode(true); - highlight.appendChild(wordClone); - wordNode.parentNode.replaceChild(highlight, wordNode); - return 1; //skip added node in parent - } - } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children - !/(script|style)/i.test(node.tagName) && // ignore script and style nodes - !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted - for (var i = 0; i < node.childNodes.length; i++) { - i += jQuery.highlight(node.childNodes[i], re, nodeName, className); - } - } - return 0; - } -}); - -jQuery.fn.unhighlight = function (options) { - var settings = { className: 'highlight', element: 'span' }; - jQuery.extend(settings, options); - - return this.find(settings.element + "." + settings.className).each(function () { - var parent = this.parentNode; - parent.replaceChild(this.firstChild, this); - parent.normalize(); - }).end(); -}; - -jQuery.fn.highlight = function (words, options) { - var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false }; - jQuery.extend(settings, options); - - if (words.constructor === String) { - words = [words]; - } - words = jQuery.grep(words, function(word, i){ - return word != ''; - }); - words = jQuery.map(words, function(word, i) { - return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - }); - if (words.length == 0) { return this; }; - - var flag = settings.caseSensitive ? "" : "i"; - var pattern = "(" + words.join("|") + ")"; - if (settings.wordsOnly) { - pattern = "\\b" + pattern + "\\b"; - } - var re = new RegExp(pattern, flag); - - return this.each(function () { - jQuery.highlight(this, re, settings.element, settings.className); - }); -}; - diff --git a/source/javascripts/lib/_jquery.js b/source/javascripts/lib/_jquery.js deleted file mode 100644 index d2d8ca4790e..00000000000 --- a/source/javascripts/lib/_jquery.js +++ /dev/null @@ -1,10253 +0,0 @@ -/*! - * jQuery JavaScript Library v3.2.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2017-03-20T18:59Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var document = window.document; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - - - - function DOMEval( code, doc ) { - doc = doc || document; - - var script = doc.createElement( "script" ); - - script.text = code; - doc.head.appendChild( script ).parentNode.removeChild( script ); - } -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.2.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android <=4.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - - if ( copyIsArray ) { - copyIsArray = false; - clone = src && Array.isArray( src ) ? src : []; - - } else { - clone = src && jQuery.isPlainObject( src ) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isFunction: function( obj ) { - return jQuery.type( obj ) === "function"; - }, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - - // As of jQuery 3.0, isNumeric is limited to - // strings and numbers (primitives or objects) - // that can be coerced to finite numbers (gh-2662) - var type = jQuery.type( obj ); - return ( type === "number" || type === "string" ) && - - // parseFloat NaNs numeric-cast false positives ("") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - !isNaN( obj - parseFloat( obj ) ); - }, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - - /* eslint-disable no-unused-vars */ - // See https://github.com/eslint/eslint/issues/6125 - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - globalEval: function( code ) { - DOMEval( code ); - }, - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE <=9 - 11, Edge 12 - 13 - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // Support: Android <=4.0 only - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.3 - * https://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2016-08-08 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - disabledAncestor = addCombinator( - function( elem ) { - return elem.disabled === true && ("form" in elem || "label" in elem); - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - - // ID selector - if ( (m = match[1]) ) { - - // Document context - if ( nodeType === 9 ) { - if ( (elem = context.getElementById( m )) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !compilerCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - - if ( nodeType !== 1 ) { - newContext = context; - newSelector = selector; - - // qSA looks outside Element context, which is not what we want - // Thanks to Andrew Dupont for this workaround technique - // Support: IE <=8 - // Exclude object elements - } else if ( context.nodeName.toLowerCase() !== "object" ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement("fieldset"); - - try { - return !!fn( el ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - disabledAncestor( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9-11, Edge - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - if ( preferredDoc !== document && - (subWindow = document.defaultView) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( el ) { - el.className = "i"; - return !el.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( el ) { - el.appendChild( document.createComment("") ); - return !el.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); - - // ID filter and find - if ( support.getById ) { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( (elem = elems[i++]) ) { - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( el ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); - - assert(function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll(":enabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll(":disabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( el ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === document ? -1 : - b === document ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - !compilerCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch (e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return (sel + "").replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - // Use previously-cached element index if available - if ( useCache ) { - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - // Don't keep the element (issue #299) - input[0] = null; - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( (oldCache = uniqueCache[ key ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context === document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - if ( !context && elem.ownerDocument !== document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context || document, xml) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( el ) { - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( el ) { - return el.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -}; -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Simple selector that can be filtered directly, removing non-Elements - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - // Complex selector, compare the two sets, removing non-Elements - qualifier = jQuery.filter( qualifier, elements ); - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; - } ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( nodeName( elem, "iframe" ) ) { - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( jQuery.isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( jQuery.isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the master Deferred - master = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ jQuery.camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ jQuery.camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( jQuery.camelCase ); - } else { - key = jQuery.camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - jQuery.contains( elem.ownerDocument, elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - -var swap = function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, - scale = 1, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - do { - - // If previous iteration zeroed out, double until we get *something*. - // Use string for doubling so we don't accidentally see scale as unchanged below - scale = scale || ".5"; - - // Adjust and apply - initialInUnit = initialInUnit / scale; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Update scale, tolerating zero or NaN from tween.cur() - // Break the loop if scale is unchanged or perfect, or if we've just had enough. - } while ( - scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations - ); - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); - -var rscriptType = ( /^$|\/(?:java|ecma)script/i ); - - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // Support: IE <=9 only - option: [ 1, "" ], - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
      " ], - col: [ 2, "", "
      " ], - tr: [ 2, "", "
      " ], - td: [ 3, "", "
      " ], - - _default: [ 0, "", "" ] -}; - -// Support: IE <=9 only -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -} )(); -var documentElement = document.documentElement; - - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 only -// See #13393 for more info -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = {}; - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - // Make a writable jQuery.Event from the native event object - var event = jQuery.event.fix( nativeEvent ); - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or 2) have namespace(s) - // a subset or equal to those in the bound event (both can have no namespace). - if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: jQuery.isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } -}, jQuery.event.addProp ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - /* eslint-disable max-len */ - - // See https://github.com/eslint/eslint/issues/3229 - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - - /* eslint-enable */ - - // Support: IE <=10 - 11, Edge 12 - 13 - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( ">tbody", elem )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.access( src ); - pdataCur = dataPriv.set( dest, pdataOld ); - events = pdataOld.events; - - if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html.replace( rxhtmlTag, "<$1>" ); - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rmargin = ( /^margin/ ); - -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - div.style.cssText = - "box-sizing:border-box;" + - "position:relative;display:block;" + - "margin:auto;border:1px;padding:1px;" + - "top:1%;width:50%"; - div.innerHTML = ""; - documentElement.appendChild( container ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = divStyle.marginLeft === "2px"; - boxSizingReliableVal = divStyle.width === "4px"; - - // Support: Android 4.0 - 4.3 only - // Some styles come back with percentage values, even though they shouldn't - div.style.marginRight = "50%"; - pixelMarginRightVal = divStyle.marginRight === "4px"; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + - "padding:0;margin-top:1px;position:absolute"; - container.appendChild( div ); - - jQuery.extend( support, { - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelMarginRight: function() { - computeStyleTests(); - return pixelMarginRightVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }, - - cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style; - -// Return a css property mapped to a potentially vendor prefixed property -function vendorPropName( name ) { - - // Shortcut for names that are not vendor prefixed - if ( name in emptyStyle ) { - return name; - } - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a property mapped along what jQuery.cssProps suggests or to -// a vendor prefixed property. -function finalPropName( name ) { - var ret = jQuery.cssProps[ name ]; - if ( !ret ) { - ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; - } - return ret; -} - -function setPositiveNumber( elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i, - val = 0; - - // If we already have the right measurement, avoid augmentation - if ( extra === ( isBorderBox ? "border" : "content" ) ) { - i = 4; - - // Otherwise initialize for horizontal or vertical properties - } else { - i = name === "width" ? 1 : 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // At this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - - // At this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // At this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with computed style - var valueIsBorderBox, - styles = getStyles( elem ), - val = curCSS( elem, name, styles ), - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test( val ) ) { - return val; - } - - // Check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && - ( support.boxSizingReliable() || val === elem.style[ name ] ); - - // Fall back to offsetWidth/Height when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - if ( val === "auto" ) { - val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ]; - } - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - - // Use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - "float": "cssFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - if ( type === "number" ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = jQuery.camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( i, name ) { - jQuery.cssHooks[ name ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, name, extra ); - } ) : - getWidthOrHeight( elem, name, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = extra && getStyles( elem ), - subtract = extra && augmentWidthOrHeight( - elem, - name, - extra, - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - styles - ); - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ name ] = value; - value = jQuery.css( elem, name ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( !rmargin.test( prefix ) ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && - ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || - jQuery.cssHooks[ tween.prop ] ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = jQuery.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 13 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = jQuery.camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( jQuery.isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - jQuery.proxy( result.stop, result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( jQuery.isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( jQuery.isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( jQuery.isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue && type !== false ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = jQuery.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnothtmlwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnothtmlwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value; - - if ( typeof stateVal === "boolean" && type === "string" ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( jQuery.isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( type === "string" ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = value.match( rnothtmlwhite ) || []; - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, isFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup contextmenu" ).split( " " ), - function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; -} ); - -jQuery.fn.extend( { - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -} ); - - - - -support.focusin = "onfocusin" in window; - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = jQuery.now(); - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && jQuery.type( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = jQuery.isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( jQuery.isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; - } - } - match = responseHeaders[ key.toLowerCase() ]; - } - return match == null ? null : match; - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 13 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available, append data to url - if ( s.data ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( jQuery.isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - - -jQuery._evalUrl = function( url ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - "throws": true - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( jQuery.isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain requests - if ( s.crossDomain ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( "