Commit Graph

34 Commits

Author SHA1 Message Date
Takayuki SHIMIZUKAWA
099b91a9d9
Bump `ENV_VERSION for _CurrentDocument` (#13246)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-16 17:53:40 +00:00
Adam Turner
013dcdc3b8 Run Ruff on `tests/js/roots/` 2025-01-02 23:53:59 +00:00
James Addison
6678e35704
html search: add safety check before index property accesses (#13153) 2025-01-02 23:06:35 +00:00
James Addison
b75e695631
Write 'searchindex.js' using minimal JSON separators (#13062)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-24 17:54:41 +01:00
Adam Turner
7195d9a662 Remove copyright and licence comments from theme asset files 2024-10-04 12:31:45 +01:00
Adam Turner
45273f292e Remove titles from theme assets 2024-10-04 12:27:26 +01:00
Adam Turner
76110c3ea0
Add `_DomainsContainer` for better static typing (#12783)
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
2024-09-18 03:50:27 +01:00
Adam Turner
2e1415cf6c
Use `headlessFirefox` and update to Node 20 (#12794) 2024-08-16 23:18:24 +00:00
Tim Hoffmann
646a5d7482
Support type-dependent search result highlighting via CSS (#12474)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: James Addison <55152140+jayaddison@users.noreply.github.com>
2024-08-11 20:22:21 +01:00
James Addison
3bab3248e5
HTML search: Add test coverage & introduce test module file suffix (#12759) 2024-08-11 15:13:14 +01:00
James Addison
e3238260f6
Migrate JavaScript tests from Karma to the Jasmine framework (#12754) 2024-08-10 00:18:27 +01:00
Adam Turner
7c4db269af
Normalise `sys.path` manipulation in tests (#12665) 2024-07-23 16:55:21 +01:00
Bénédikt Tran
aacca3064e
Remove support for the Sphinx 0.5 `intersphinx_mapping` format (#12083)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-22 12:59:59 +01:00
James Addison
45f3cd6324
HTML Search: Remove unused function-call arguments in tests (#12628) 2024-07-20 23:32:25 +01:00
James Addison
47757c4062
HTML search: Ensure that `checkRanking` fails when the final entry is not found (#12608)
The ``checkRanking`` function in our test suite has a bug; it's currently possible for the final item in the expected ranking list *not* to be found in the result-set, and yet for the function to pass.

**Expected Behaviour**
The ``checkRanking`` function should confirm that all of the items specified in the ``expectedRanking`` argument appear within the ``results`` argument, and in the list-iteration-order provided.  If they do not, then an assertion error should be raised, failing the test.

**Actual Behaviour**
If all items up until the final entry in the ``expectedRanking`` argument are found in the expected order, but the final entry itself is not found at all in the ``results``, then no assertion error is raised, and the test passes.
2024-07-17 16:29:55 +01:00
Adam Turner
1c204e63a9
Increment the environment version to resolve C domain issues on incremental rebuilds (#12583) 2024-07-15 12:00:18 +01:00
James Addison
91c5cd3abd
Improve relevance scoring in HTML search results (#12441)
Co-authored-by: Will Lachance <wlach@protonmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-11 11:55:40 +01:00
James Addison
7eb77f2372
HTML Search: omit anchor reference from document titles in the search index. (#12047) 2024-07-08 13:34:11 +02:00
James Addison
568e26c797
[tests] JavaScript: refactor test fixtures (#12102)
This PR allows to serve JavaScript test fixtures using a fixture-based logic as for Python tests.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-13 13:07:46 +02:00
Will Lachance
208f4bcb66
HTML Search: Fix removal of unwanted anchor content from search results (#12321) 2024-04-24 19:09:14 +01:00
James Addison
bfce4f54b0
[HTML search] include partially-matched document titles in search results (#12041)
Co-authored-by: William Lachance <wlach@protonmail.com>
2024-03-26 12:18:26 +01:00
James Addison
bf0bec3b4b
[search] filter script and style elements from search result summary text. (#12057)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-17 15:14:03 +01:00
Will Lachance
ae51974e21
[search] fix multiple term matching edge case (#11960) 2024-03-03 18:01:10 +01:00
Will Lachance
1e4f80d7a4
[search] fix partial matches overwriting full matches (#11958) 2024-03-03 15:18:07 +01:00
Will Lachance
9a30ca7da1
[HTML search] use anchor for search preview (#11944) 2024-02-27 15:22:52 +01:00
Adam Turner
c7c0e4048d Split out sphinx_highlight.js 2022-09-24 15:10:57 +01:00
Adam Turner
61d7b0b47c Replace jssplitter with JavaScript 2022-03-19 23:16:27 +00:00
Adam Turner
3b01fbe2ad
Drop JavaScript Frameworks (#10028)
* Delete jQuery and underscore.js

* Move underscores.js setup to searchtools.js

* Update jQuery.url(en|de)code

* Update jQuery.getQueryParameters

* Firefox bug is no longer present

xref https://bugzilla.mozilla.org/show_bug.cgi?id=645075#c49

* Update jQuery.fn.highlightText

* Use enum instead of magic number

* Update test descriptions to remove obsolete jQuery reference

* Update Documentation.getCurrentURL

* Revert accidental fix of Documentation.getCurrentURL

* Update Documentation.initOnKeyListeners

* Update Documentation.hideSearchWords

* Update Documentation.highlightSearchWords

* Update Documentation.initDomainIndexTable

* Use arrow functions and const

* Replace $(document).ready

* Strict mode

* Move Documentation.hideSearchWords next to Documentation.highlightSearchWords

* Update translation functions in Documentation

* Replace $(document).ready in searchtools.js

* Update Scorer

* Update Search.hasIndex, Search.deferQuery, Search.stopPulse

* Prefer window.location

* Update Search.init

* Update Search.loadIndex

* Update Search.setIndex

* Update Search.startPulse

* Add _escapeRegExp

* Update Search.makeSearchSummary

* Update Search.htmlToText

* Update Search.performSearch

* Factor out _displayNextItem

* Update Search.query

* Update Search.performObjectSearch

* Update Search.performTermsSearch

* Remove underscores.js setup

* Use Sets

* Update test configuration

* Fix test failures

* Drop unused make/get URL functions

* Strict mode in searchtools.js

* Remove outmoded check for jQuery and underscore.js

* Ran prettier

prettier --print-width 120 --no-semi --quote-props as-needed --no-bracket-spacing --arrow-parens avoid --write sphinx/themes/basic/static

* Remove more references to jQuery and underscore.js

* Remove jQuery and underscore.js licences

* Update classic theme for no jQuery

* Update all other themes for no jQuery

* Restore jQuery & underscores.js to Sphinx themes

Enables a more gradual deprecation

* Added deprecation note to CHANGES

* Run prettier with defaults

* Update deprecation message to include extensions, note that sources must be copied

* oops

* Address Pradyun's feedback

* Forgot this one

* `let` doesn't work, as it is scoped to the block...

* Remove missed jQuery in sphinx13 theme
2022-01-30 20:27:12 +01:00
Daniel Hofmann
3e479d772b Closes #8123: Fix plus-handling (+) in search terms for basic html theme search
Note, that the default splitter will not index +, so this isn't of much of much use, unless
the splitter of the search-language is reconfigured.
2020-08-19 18:01:27 +02:00
Timotheus Kampik
64e64ffbd4 #5258 allow for some variability in test 2019-01-12 15:58:07 +01:00
Timotheus Kampik
c761ec248b #5258 test after control merge & polish 2019-01-12 14:48:35 +01:00
Timotheus Kampik
97fd09177c #5258 add tests for highlightText() 2018-08-05 10:45:21 +02:00
Timotheus Kampik
afe46ef74c #5186 add tests for getQueryParameters()
and fix test description of `urldecode()`
2018-07-28 21:12:05 +02:00
Timotheus Kampik
5fdf81fe2d #5186 configure karma
and add first karma test
2018-07-22 12:27:39 +02:00