govuk_tech_docs 2.4.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of govuk_tech_docs might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +13 -0
- data/.github/pull_request_template.md +14 -1
- data/.github/workflows/publish.yaml +76 -0
- data/.github/workflows/test.yaml +23 -0
- data/.nvmrc +1 -1
- data/CHANGELOG.md +39 -0
- data/README.md +15 -1
- data/lib/assets/javascripts/_modules/search.js +59 -66
- data/lib/assets/javascripts/_modules/table-of-contents.js +0 -1
- data/lib/assets/javascripts/_vendor/jquery.js +2 -5
- data/lib/assets/javascripts/_vendor/lodash.js +5 -3
- data/lib/assets/stylesheets/modules/_search.scss +51 -73
- data/lib/assets/stylesheets/modules/_technical-documentation.scss +0 -4
- data/lib/assets/stylesheets/modules/_toc.scss +0 -3
- data/lib/govuk_tech_docs/api_reference/api_reference_renderer.rb +10 -0
- data/lib/govuk_tech_docs/api_reference/templates/api_reference_full.html.erb +2 -2
- data/lib/govuk_tech_docs/api_reference/templates/operation.html.erb +1 -1
- data/lib/govuk_tech_docs/api_reference/templates/parameters.html.erb +1 -1
- data/lib/govuk_tech_docs/api_reference/templates/responses.html.erb +1 -1
- data/lib/govuk_tech_docs/api_reference/templates/schema.html.erb +2 -2
- data/lib/govuk_tech_docs/contribution_banner.rb +8 -2
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/govuk_tech_docs.rb +3 -1
- data/lib/source/layouts/_header.erb +3 -3
- data/lib/source/layouts/_search.erb +0 -7
- data/lib/source/layouts/core.erb +1 -1
- data/lib/source/search/index.html.erb +31 -0
- data/node_modules/govuk-frontend/govuk/all.js +272 -75
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +275 -98
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +169 -65
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -4
- data/node_modules/govuk-frontend/govuk/components/button/button.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +3 -3
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +14 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +8 -10
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +2 -1
- data/node_modules/govuk-frontend/govuk/components/details/details.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +6 -37
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +10 -4
- data/node_modules/govuk-frontend/govuk/components/header/header.js +4 -4
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +1 -3
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +499 -2
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +13 -1
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +14 -0
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +4 -4
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +13 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +1108 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +15 -23
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +2 -2
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -5
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/core/_all.scss +0 -1
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_links.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +0 -6
- data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +2 -2
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +22 -4
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +15 -30
- data/node_modules/govuk-frontend/govuk/{core → objects}/_template.scss +1 -5
- data/node_modules/govuk-frontend/govuk/overrides/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +14 -0
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +0 -6
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -10
- data/node_modules/govuk-frontend/govuk/tools/_all.scss +0 -1
- data/package-lock.json +6 -6
- data/package.json +1 -1
- metadata +13 -10
- data/.travis.yml +0 -19
- data/CONTRIBUTING.md +0 -12
- data/node_modules/govuk-frontend/govuk/tools/_iff.scss +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b05aaaeb08b75633793f5ede8102ef35d54cedbe6bc419b9fe262a3596d6cfef
|
4
|
+
data.tar.gz: 30ab85794e056634591d692999364da7644908653e06d2707aa15eeff9b5bfea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 406187054e9b14fd631fb56a2602f8c607ab2abfe8be466673ffee99fba6451ebe684dca40e53270b66b5b1a6b12142336ad26124335b33b02205e13005290e8
|
7
|
+
data.tar.gz: fc0afcd3567241e487bb75fbfebb26561ee8b6c9dd0a50d5f2d8252ea2d8a95c71976ae2540ff1f58e2d89886234c25b6d6b726fb74e618a1fba05ae97b0303d
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!--
|
2
|
+
Please fill in the sections below.
|
3
|
+
|
4
|
+
After you submit your issue, the technical writing team from the Central Digital and Data Office (CDDO) will discuss and prioritise it at our fortnightly triage meeting. We’ll then let you know if and when we’ll move it forward.
|
5
|
+
-->
|
6
|
+
|
7
|
+
## What should change
|
8
|
+
|
9
|
+
<!-- What would fix the issue? Is this something you think should behave differently, or something that you currently cannot do? -->
|
10
|
+
|
11
|
+
## User need
|
12
|
+
|
13
|
+
<!-- Do you have evidence that this meets the needs of users? Let us know about any user research or testing you’ve done. -->
|
@@ -1 +1,14 @@
|
|
1
|
-
|
1
|
+
<!--
|
2
|
+
## Please fill in the sections below
|
3
|
+
|
4
|
+
After you submit your pull request, the technical writing team from the Central Digital and Data Office (CDDO) will discuss and prioritise it at our fortnightly triage meeting. We’ll then let you know if and when we’ll move it forward.
|
5
|
+
-->
|
6
|
+
|
7
|
+
## What’s changed
|
8
|
+
|
9
|
+
<!-- What are you trying to do? Is this something that changes how the Tech Docs Template behaves, or is it fixing a bug? -->
|
10
|
+
|
11
|
+
|
12
|
+
## Identifying a user need
|
13
|
+
|
14
|
+
<!-- Do you have evidence that this meets the needs of users? Let us know about any user research or testing you’ve done. -->
|
@@ -0,0 +1,76 @@
|
|
1
|
+
name: Publish
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
workflow_dispatch:
|
8
|
+
|
9
|
+
concurrency: rubygems
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
pre:
|
13
|
+
name: Pre-flight checks
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
outputs:
|
16
|
+
go: ${{ steps.gem_version.outputs.new_version }}
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
|
23
|
+
- name: Check if new version to release
|
24
|
+
id: gem_version
|
25
|
+
run: |
|
26
|
+
gem_version=$(ruby -r rubygems -e "puts Gem::Specification::load('govuk_tech_docs.gemspec').version")
|
27
|
+
echo "::set-output name=gem_version::$gem_version"
|
28
|
+
|
29
|
+
if git fetch origin "refs/tags/v$gem_version" >/dev/null 2>&1
|
30
|
+
then
|
31
|
+
echo "Tag 'v$gem_version' already exists"
|
32
|
+
echo "::set-output name=new_version::false"
|
33
|
+
else
|
34
|
+
echo "::set-output name=new_version::true"
|
35
|
+
fi
|
36
|
+
|
37
|
+
deploy:
|
38
|
+
name: Publish Ruby Gem
|
39
|
+
environment: rubygems
|
40
|
+
permissions:
|
41
|
+
contents: write # needed to be able to tag the release
|
42
|
+
runs-on: ubuntu-latest
|
43
|
+
needs: pre
|
44
|
+
if: ${{ needs.pre.outputs.go == 'true' }}
|
45
|
+
|
46
|
+
steps:
|
47
|
+
- uses: actions/checkout@v2
|
48
|
+
|
49
|
+
- uses: actions/setup-node@v2
|
50
|
+
with:
|
51
|
+
cache: 'npm'
|
52
|
+
node-version: '14'
|
53
|
+
|
54
|
+
- uses: ruby/setup-ruby@v1
|
55
|
+
with:
|
56
|
+
bundler-cache: true
|
57
|
+
|
58
|
+
- name: Publish
|
59
|
+
env:
|
60
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
61
|
+
run: |
|
62
|
+
mkdir -p ~/.gem
|
63
|
+
|
64
|
+
cat << EOF > ~/.gem/credentials
|
65
|
+
---
|
66
|
+
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
67
|
+
EOF
|
68
|
+
|
69
|
+
chmod 0600 ~/.gem/credentials
|
70
|
+
|
71
|
+
# tag will be associated with github-actions bot user, see
|
72
|
+
# https://github.community/t/github-actions-bot-email-address/17204
|
73
|
+
git config user.name "github-actions[bot]"
|
74
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
75
|
+
|
76
|
+
bundle exec rake release
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
name: Test
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
|
13
|
+
- uses: actions/setup-node@v2
|
14
|
+
with:
|
15
|
+
node-version: '14'
|
16
|
+
cache: 'npm'
|
17
|
+
|
18
|
+
- uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
bundler-cache: true
|
21
|
+
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rake
|
data/.nvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
14
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,45 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 3.1.0
|
6
|
+
|
7
|
+
### New features
|
8
|
+
|
9
|
+
There are some steps you should follow as the Technical Documentation Template (TDT) now uses GOV.UK Frontend 4.0.0.
|
10
|
+
|
11
|
+
1. Update your documentation site to use the latest template version. You can [follow the TDT guidance on using the latest template version](https://tdt-documentation.london.cloudapps.digital/maintain_project/use_latest_template/).
|
12
|
+
2. Check your documentation site displays correctly. If your site does not display correctly, you can refer to the [GOV.UK Frontend 4.0.0 release note](https://github.com/alphagov/govuk-frontend/releases/tag/v4.0.0) for more information.
|
13
|
+
|
14
|
+
## 3.0.1
|
15
|
+
|
16
|
+
### Fixes
|
17
|
+
|
18
|
+
We’ve made the following fixes to the tech docs gem in [pull request #281: Don't break TOC when OpenAPI description includes headers](https://github.com/alphagov/tech-docs-gem/pull/281):
|
19
|
+
|
20
|
+
* we now render OpenAPI Markdown with the same Markdown renderer as other documents
|
21
|
+
* table of contents (TOC) uses `TechDocsHTMLRenderer` to render the headings with IDs
|
22
|
+
|
23
|
+
Thanks to [@jamietanna](https://github.com/jamietanna) for contributing to this issue and its solution.
|
24
|
+
|
25
|
+
## 3.0.0
|
26
|
+
|
27
|
+
### Breaking changes
|
28
|
+
|
29
|
+
The search user experience is now more accessible for screenreader users. Search results are now on a separate page instead of a modal window.
|
30
|
+
|
31
|
+
Users can no longer see search results as they type. They must press the Return key or select the search button to see the search results page.
|
32
|
+
|
33
|
+
This was added in [pull request #263: Change search to only show results after submit](https://github.com/alphagov/tech-docs-gem/pull/263).
|
34
|
+
|
35
|
+
### Fixes
|
36
|
+
|
37
|
+
- [#265: Fix mark styles in Windows High Contrast Mode](https://github.com/alphagov/tech-docs-gem/pull/265)
|
38
|
+
|
39
|
+
## 2.4.3
|
40
|
+
|
41
|
+
- [#236: Fix search 'autocomplete' behaviour](https://github.com/alphagov/tech-docs-gem/pull/236)
|
42
|
+
- [#203: Update vendored javascripts](https://github.com/alphagov/tech-docs-gem/pull/203)
|
43
|
+
|
5
44
|
## 2.4.2
|
6
45
|
|
7
46
|
- [#251 Fix missing `<ul>` in single page navigation](https://github.com/alphagov/tech-docs-gem/pull/251)
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ To find out more about setting up and managing content for a website using this
|
|
9
9
|
|
10
10
|
Everybody who uses this project is encouraged to contribute.
|
11
11
|
|
12
|
-
|
12
|
+
Find out how to [contribute](https://tdt-documentation.london.cloudapps.digital/support/#contribute).
|
13
13
|
|
14
14
|
## GOV.UK frontend
|
15
15
|
|
@@ -34,6 +34,8 @@ gem 'govuk_tech_docs', path: '../tech-docs-gem'
|
|
34
34
|
|
35
35
|
To preview your documentation changes locally, see the [Tech Docs Template documentation on previewing your documentation](https://tdt-documentation.london.cloudapps.digital/create_project/preview/#preview-your-documentation).
|
36
36
|
|
37
|
+
If you experience [the FFI gem issue for Mojave users](https://github.com/alphagov/tech-docs-gem/issues/254), you should refer to this [list of possible fixes](#issue-with-ffi-on-osx-mohave).
|
38
|
+
|
37
39
|
### Use the example in this repo
|
38
40
|
|
39
41
|
To start the example in this repo, run:
|
@@ -46,6 +48,8 @@ bundle exec middleman server
|
|
46
48
|
|
47
49
|
See your website on `http://localhost:4567` in your browser.
|
48
50
|
|
51
|
+
If you experience [the FFI gem issue for Mojave users](https://github.com/alphagov/tech-docs-gem/issues/254), you should refer to this [list of possible fixes](#issue-with-ffi-on-osx-mohave).
|
52
|
+
|
49
53
|
For more information on previewing your documentation locally, see the [Tech Docs template documentation on previewing your documentation](https://tdt-documentation.london.cloudapps.digital/create_project/preview/#preview-your-documentation).
|
50
54
|
|
51
55
|
## Tests
|
@@ -63,6 +67,16 @@ To run the tests and see the results in your terminal, run:
|
|
63
67
|
bundle exec rake jasmine:ci
|
64
68
|
```
|
65
69
|
|
70
|
+
## Issue with FFI on OSX Mojave
|
71
|
+
|
72
|
+
Users on OSX Mojave (10.14) may get this error when running `bundle exec middleman serve` on apps that use this gem.
|
73
|
+
|
74
|
+
There are 3 possible ways to solve this. From best to worst, you can:
|
75
|
+
|
76
|
+
* upgrade to macOS 10.15 (Catalina) or higher
|
77
|
+
* tell rubygems not to use the system ffi by running `gem install ffi -- --disable-system-libffi` in the command line when the error shows
|
78
|
+
* pin the ffi version back to 1.12.2 by editing the Gemfile of your app
|
79
|
+
|
66
80
|
## Releasing new versions
|
67
81
|
|
68
82
|
To release a new version, create a new pull request (PR) that updates [version.rb](lib/govuk_tech_docs/version.rb) and [CHANGELOG.md](CHANGELOG.md).
|
@@ -6,35 +6,48 @@
|
|
6
6
|
Modules.Search = function Search () {
|
7
7
|
var s = this
|
8
8
|
var $html = $('html')
|
9
|
-
var $tocNav
|
10
9
|
var $searchForm
|
11
10
|
var $searchLabel
|
12
11
|
var $searchInput
|
13
12
|
var $searchResults
|
14
13
|
var $searchResultsTitle
|
15
14
|
var $searchResultsWrapper
|
16
|
-
var $
|
15
|
+
var $searchHelp
|
17
16
|
var results
|
18
17
|
var query
|
19
|
-
var queryTimer
|
20
18
|
var maxSearchEntries = 20
|
21
19
|
|
22
20
|
this.start = function start ($element) {
|
23
21
|
$searchForm = $element.find('form')
|
24
22
|
$searchInput = $element.find('#search')
|
25
23
|
$searchLabel = $element.find('.search__label')
|
26
|
-
$searchResultsWrapper = $
|
24
|
+
$searchResultsWrapper = $('#search-results')
|
27
25
|
$searchResults = $searchResultsWrapper.find('.search-results__content')
|
28
26
|
$searchResultsTitle = $searchResultsWrapper.find('.search-results__title')
|
29
|
-
$
|
30
|
-
|
31
|
-
|
32
|
-
attach()
|
27
|
+
$searchHelp = $('#search-help')
|
28
|
+
|
29
|
+
changeSearchAction()
|
33
30
|
changeSearchLabel()
|
31
|
+
|
32
|
+
// Only do searches on the search page
|
33
|
+
if (s.isOnSearchPage()) {
|
34
|
+
s.downloadSearchIndex()
|
35
|
+
$html.addClass('has-search-results-open')
|
36
|
+
|
37
|
+
if (window.location.search) {
|
38
|
+
query = s.getQuery()
|
39
|
+
if (query) {
|
40
|
+
$searchInput.val(query)
|
41
|
+
doSearch(query)
|
42
|
+
doAnalytics()
|
43
|
+
document.title = query + ' - ' + document.title
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
34
47
|
}
|
35
48
|
|
36
49
|
this.downloadSearchIndex = function downloadSearchIndex () {
|
37
|
-
updateTitle('Loading search
|
50
|
+
updateTitle('Loading search results')
|
38
51
|
$.ajax({
|
39
52
|
url: '/search.json',
|
40
53
|
cache: true,
|
@@ -48,46 +61,45 @@
|
|
48
61
|
})
|
49
62
|
}
|
50
63
|
|
51
|
-
function
|
52
|
-
//
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
renderResults(query)
|
59
|
-
updateTitle()
|
60
|
-
})
|
61
|
-
if (window.ga) {
|
62
|
-
window.clearTimeout(queryTimer)
|
63
|
-
queryTimer = window.setTimeout(sendQueryToAnalytics, 1000)
|
64
|
-
}
|
65
|
-
})
|
64
|
+
function changeSearchAction () {
|
65
|
+
// We need JavaScript to do search, so if JS is not available the search
|
66
|
+
// input sends the query string to Google. This JS function changes the
|
67
|
+
// input to instead send it to the search page.
|
68
|
+
$searchForm.prop('action', '/search')
|
69
|
+
$searchForm.find('input[name="as_sitesearch"]').remove()
|
70
|
+
}
|
66
71
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
e.preventDefault()
|
71
|
-
showResults()
|
72
|
-
var $firstResult = $searchResults.find('.search-result__title a').first()
|
73
|
-
if ($firstResult.length) {
|
74
|
-
$firstResult.focus()
|
75
|
-
} else {
|
76
|
-
// if there are no results, show the "0 results" state
|
77
|
-
results = []
|
78
|
-
updateTitle()
|
79
|
-
}
|
80
|
-
})
|
72
|
+
function changeSearchLabel () {
|
73
|
+
$searchLabel.text('Search this documentation')
|
74
|
+
}
|
81
75
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
76
|
+
this.isOnSearchPage = function isOnSearchPage () {
|
77
|
+
return Boolean(window.location.pathname.match(/\/search(\/|\/index.html)?$/))
|
78
|
+
}
|
79
|
+
|
80
|
+
this.getQuery = function getQuery () {
|
81
|
+
var query = decodeURIComponent(
|
82
|
+
window.location.search
|
83
|
+
.match(/q=([^&]*)/)[1]
|
84
|
+
.replace(/\+/g, ' ')
|
85
|
+
)
|
86
|
+
return query
|
87
|
+
}
|
88
|
+
|
89
|
+
function doSearch (query) {
|
90
|
+
s.search(query, function (r) {
|
91
|
+
results = r
|
92
|
+
renderResults(query)
|
93
|
+
updateTitle()
|
87
94
|
})
|
95
|
+
}
|
88
96
|
|
89
|
-
|
97
|
+
// TODO: remove this and sendQueryToAnalytics in a future breaking release
|
98
|
+
function doAnalytics () {
|
90
99
|
if (window.ga) {
|
100
|
+
sendQueryToAnalytics()
|
101
|
+
|
102
|
+
// Attach analytics events to search result clicks
|
91
103
|
$searchResults.on('click', '.search-result__title a', function () {
|
92
104
|
var href = $(this).attr('href')
|
93
105
|
ga('send', {
|
@@ -99,15 +111,6 @@
|
|
99
111
|
})
|
100
112
|
})
|
101
113
|
}
|
102
|
-
|
103
|
-
// When selecting navigation link, close the search results.
|
104
|
-
$('#toc').on('click', 'a', function (e) {
|
105
|
-
hideResults()
|
106
|
-
})
|
107
|
-
}
|
108
|
-
|
109
|
-
function changeSearchLabel () {
|
110
|
-
$searchLabel.text('Search this documentation')
|
111
114
|
}
|
112
115
|
|
113
116
|
function getResults (query) {
|
@@ -122,7 +125,6 @@
|
|
122
125
|
|
123
126
|
this.search = function search (query, callback) {
|
124
127
|
if (query === '') {
|
125
|
-
hideResults()
|
126
128
|
return
|
127
129
|
}
|
128
130
|
showResults()
|
@@ -192,23 +194,14 @@
|
|
192
194
|
function updateTitle (text) {
|
193
195
|
if (typeof text === 'undefined') {
|
194
196
|
var count = results.length
|
195
|
-
var resultsText = count + ' results'
|
197
|
+
var resultsText = 'Search - ' + query + ' - ' + count + ' results'
|
196
198
|
}
|
197
199
|
$searchResultsTitle.text(text || resultsText)
|
198
200
|
}
|
199
201
|
|
200
202
|
function showResults () {
|
201
|
-
$searchResultsWrapper.
|
202
|
-
|
203
|
-
$html.addClass('has-search-results-open')
|
204
|
-
$tocNav.addClass('search-results-open')
|
205
|
-
}
|
206
|
-
|
207
|
-
function hideResults () {
|
208
|
-
$searchResultsWrapper.removeClass('is-open')
|
209
|
-
.attr('aria-hidden', 'true')
|
210
|
-
$html.removeClass('has-search-results-open')
|
211
|
-
$tocNav.removeClass('search-results-open')
|
203
|
+
$searchResultsWrapper.removeAttr('hidden')
|
204
|
+
$searchHelp.attr('hidden', 'true')
|
212
205
|
}
|
213
206
|
|
214
207
|
function sendQueryToAnalytics () {
|