1
Fork 0
Commit graph

390 commits

Author SHA1 Message Date
Carol (Nichols || Goulding)
e85df08bde
Don't move cursor in search box when using arrows to navigate search results 2020-06-03 21:09:55 -04:00
Dylan DPC
6cd9a67314
Rollup merge of #72691 - GuillaumeGomez:escape-key-handling, r=kinnison
Fix escape key handling

Fixes #72647.

The problem was that you could have a timeout just after the moment you press "escape", putting back the results.

r? @kinnison
2020-05-31 21:30:00 +02:00
Guillaume Gomez
7a2efa3a10 Put input timeout clearance inside a function 2020-05-31 14:27:33 +02:00
Guillaume Gomez
bcf57d8f20 Fix escape key handling 2020-05-28 14:51:12 +02:00
Guillaume Gomez
a423d2d4b0 Improve formatting 2020-05-26 15:11:44 +02:00
Guillaume Gomez
f41d284ea0 Fix eslint lints 2020-05-26 11:18:10 +02:00
Guillaume Gomez
872ddf243e Reexported functions are now declared directly as "windows" field 2020-05-26 11:18:10 +02:00
Guillaume Gomez
deaf5e200e Move "global" code into anonymous functions 2020-05-26 11:18:10 +02:00
Guillaume Gomez
0fa4762a80 Move focusSearchBar and defocusSearchBar functions to the top of the file with other functions 2020-05-26 11:18:10 +02:00
Ralf Jung
e279bd5366
Rollup merge of #72272 - GuillaumeGomez:fix-back-on-page-with-search-behaviour, r=kinnison
Fix going back in history to a search result page on firefox

This bug was actually firefox not re-running JS script when you go back in history. To trigger it on the current docs:

 * Make a search
 * Pick an element (which isn't on the same page as the current element!)
 * Go back in history

Instead of having the search results, you'll see the normal doc page. You can find a small explanation about it [here](http://web.archive.org/web/20100428053932/http://www.firefoxanswer.com/firefox/672-firefoxanswer.html).

r? @kinnison

cc @ollie27
2020-05-21 13:12:17 +02:00
Guillaume Gomez
ed8478036c Fix going back in history to a search result page on firefox 2020-05-19 16:48:21 +02:00
Guillaume Gomez
e17ac66899 * Update aliases data struct from HashMap to BTreeMap to have more deterministic results
* Update Javascript to take this change into account
* Update CrateData::aliases field to take a reference instead (it allowed to remove a conversion loop)
2020-05-14 11:36:02 +02:00
Guillaume Gomez
c4d9318be6 Make current crate aliases go first 2020-05-14 11:36:02 +02:00
Guillaume Gomez
883c177abb Move doc alias discovery into the Attributes struct and some code improvements 2020-05-14 11:35:44 +02:00
Guillaume Gomez
f581cf7544 Merge aliases and search-index 2020-05-07 20:08:08 +02:00
Guillaume Gomez
7590c393de Improve doc alias JS code 2020-05-07 20:08:08 +02:00
Guillaume Gomez
e17f36b82e Replace title "Methods" with "Implementations" 2020-05-05 22:56:23 +02:00
Guillaume Gomez
496256c561 Update src/librustdoc/html/static/main.js
Fix variable name

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-03-16 18:30:26 +01:00
Guillaume Gomez
5654cde729 formatting 2020-03-16 18:30:26 +01:00
Guillaume Gomez
b9167e6c7d Support type search for arguments and returned types 2020-03-16 18:29:19 +01:00
Guillaume Gomez
1244ced958 Remove "important traits" feature 2020-02-27 14:51:22 +01:00
bors
8ba3ca0e6b Auto merge of #68668 - GuillaumeGomez:struct-variant-field-search, r=ollie27
Struct variant field search

Fixes #16017.

Reopening of #64724.

cc @tomjakubowski
cc @ollie27

r? @kinnison
2020-02-15 22:32:51 +00:00
Tom Jakubowski
05c6f329e7 rustdoc: emit JS paths for struct-like variants
On the backend, rustdoc now emits `paths` entries to a crate's search
index for struct-like enum variants, and index items of type structfield
which belong to such variants point to their variant parents in the
`paths` table, rather than their enum grandparents.  The path entry for
a variant is the fully qualified module path plus the enum name.

On the frontend, the search code recognizes structfields belonging to
structlike variants in the `paths` table and re-constructs the URL to
the field's anchor on the enum documentation page.

closes #16017
2020-01-30 13:39:01 +01:00
Guillaume Gomez
0754461e02 Fix null synthetic_implementors error 2020-01-28 23:32:29 +01:00
Guillaume Gomez
12882a8392 Remove usage of global variable "inlined_types" 2020-01-20 13:34:44 +01:00
Oliver Middleton
79f59fa820 rustdoc: HTML escape arrows on help popup 2020-01-12 23:37:47 +00:00
Guillaume Gomez
71ff18fb89 Fix invalid results showing back 2019-12-22 15:42:29 +01:00
Guillaume Gomez
b67701347a Improve code readability 2019-12-22 15:42:10 +01:00
Guillaume Gomez
4ce2384501 Improve JS code a bit by avoid erasing all event handlers 2019-12-22 14:14:37 +01:00
Guillaume Gomez
5f68732b04 Fix JS error when loading page with search 2019-12-15 21:27:25 +01:00
Guillaume Gomez
5748b4ce95 Add missing check 2019-12-02 10:25:36 +01:00
Mazdak Farrokhzad
4bd9168d7f
Rollup merge of #66514 - GuillaumeGomez:fix-search-filter-save, r=kinnison
Fix selected crate search filter

Fixes #62929.

r? @kinnison
2019-11-20 18:32:10 +01:00
Mazdak Farrokhzad
00cbc75c74
Rollup merge of #66298 - Ppjet6:disable-search-field, r=GuillaumeGomez
rustdoc: fixes #64305: disable search field instead of hidding it

The result seems to be ok but I wasn't entirely sure how to get there. I tried to stay generic a bit but maybe it's not required at all.

@GuillaumeGomez

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 18:32:06 +01:00
Maxime “pep” Buquet
5cbd406a14 rustdoc: fixes #64305: disable search field instead of hidding it
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 11:32:58 +01:00
Mazdak Farrokhzad
95b9766e0a
Rollup merge of #66430 - dns2utf8:fix_code_selection_click_handler, r=GuillaumeGomez
[doc] Fix the source code highlighting on source comments

The code would always forget the previous selection.

r? @GuillaumeGomez
2019-11-19 13:10:15 +01:00
Guillaume Gomez
00ef5c1b98 Fix selected crate search filter 2019-11-18 14:15:00 +01:00
Stefan Schindler
1bbb8168ec Prevent jumps when selecting one or many lines 2019-11-15 02:30:44 +01:00
Stefan Schindler
71cf364c3c Fix the source code highlighting on source comments 2019-11-15 02:02:09 +01:00
Stefan Schindler
cee0403b5c Code cleanup to remove douplacte var definition
Also move the declaration outside the loop since they accumulate state with each iteration
2019-11-15 00:45:08 +01:00
Stefan Schindler
e3afe6ac23 Remove unused argument 2019-11-15 00:27:53 +01:00
Yuki Okushi
392ebad5c6
Rollup merge of #66123 - GuillaumeGomez:no-more-hidden-elements, r=Dylan-DPC
No more hidden elements

Fixes #66046.

Follow-up of #66082.

r? @kinnison
2019-11-08 13:42:19 +09:00
Mazdak Farrokhzad
59e79ff137
Rollup merge of #64696 - GuillaumeGomez:rustdoc-sub-settings, r=kinnison
[rustdoc] add sub settings

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

![Screenshot from 2019-09-23 00-46-14](https://user-images.githubusercontent.com/3050060/65395521-15aff300-dd9c-11e9-9437-429ca347d455.png)

r? @Mark-Simulacrum
2019-11-07 14:27:21 +01:00
Guillaume Gomez
d4527b7e00 Only call onHashChange instead of both functions 2019-11-07 10:39:53 +01:00
Guillaume Gomez
24e093c5c3 Remove old isHidden function 2019-11-07 10:13:44 +01:00
Guillaume Gomez
f66a331335 When a URL hash refers to a hidden element, it makes the element visible 2019-11-06 10:10:56 +01:00
Guillaume Gomez
1c78af7de2 clean highlightSourceLines code 2019-11-04 13:28:50 +01:00
bors
0d5264a03c Auto merge of #65780 - GuillaumeGomez:move-help-popup-generation-code, r=Mark-Simulacrum
Move help popup generation code

The first commit is just a small cleanup.

The idea behind this PR is to reduce a bit more the generated HTML files by moving the duplicated code into one place instead.

r? @kinnison
2019-11-03 21:55:48 +00:00
Tyler Mandry
c4960c2602
Rollup merge of #65741 - GuillaumeGomez:help-popup, r=Dylan-DPC
Prevent help popup to disappear when clicking on it

Fixes #65736.

r? @kinnison
2019-10-29 12:01:37 -07:00
Guillaume Gomez
79956b96e8 add sub settings in rustdoc 2019-10-29 13:54:11 +01:00
Guillaume Gomez
91ef9600db reduce size of generated HTML files by moving the popup helper code to the JS 2019-10-27 11:42:38 +01:00