about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2022-07-03Remove redundant pseudo-classMichael Howell-1/+1
2022-07-02rustdoc: add test case for background color of the sidebar toggle buttonMichael Howell-1/+1
2022-07-02rustdoc: add explanatory comment to `width: 100%` lineMichael Howell-0/+1
2022-07-02rustdoc: make source sidebar toggle a real buttonMichael Howell-6/+21
This fixes tab focus, so that you can open and close the sidebar from keyboard.
2022-07-01rustdoc: add spacing to the source view sidebarMichael Howell-1/+5
https://user-images.githubusercontent.com/1593513/176974336-20cecdc3-1885-402a-a6d5-81a8dd03a45d.png
2022-07-01Rollup merge of #98460 - GuillaumeGomez:css-simplification, r=jshaGuillaume Gomez-216/+73
Use CSS variables to handle theming This is the start for our simplification of theming. Considering how big the diff quickly becomes, I think it's better to do it in multiple parts. (The 3 first commits come from https://github.com/rust-lang/rust/pull/98297 so once it's merged, they'll disappear). Normally they shouldn't be any UI changes. You can check it [here](https://rustdoc.crud.net/imperio/css-simplification/doc/foo/index.html). cc `@notriddle` r? `@jsha`
2022-07-01Rollup merge of #97249 - GuillaumeGomez:details-summary-fixes, r=notriddleGuillaume Gomez-2/+7
`<details>`/`<summary>` UI fixes With images it's easier to understand: ![Screenshot from 2022-05-21 14-10-42](https://user-images.githubusercontent.com/3050060/169653038-9c58de67-589a-4986-a8ff-dbdddaf136a4.png) ![Screenshot from 2022-05-21 14-08-49](https://user-images.githubusercontent.com/3050060/169653042-56e87258-13fe-4f80-9858-4e15c318c3fb.png) The headings in `<summary>` should not have bottom border so I removed it as well alongside the other fixes. r? `@jsha`
2022-07-01Improve click behavior of the source code mobile full-screen "sidebar"Michael Howell-2/+24
On desktop, if you open the source code sidebar, it stays open even when you move from page to page. It used to do the same thing on mobile, but I think that's stupid. Since the file list fills the entire screen on mobile, and you can't really do anything with the currently selected file other than dismiss the "sidebar" to look at it, it's safe to assume that anybody who clicks a file in that list probably wants the list to go away so they can see it.
2022-07-01rustdoc cleanup: remove unused functionMichael Howell-5/+4
2022-07-01rustdoc: use <details> tag for the source code sidebarMichael Howell-48/+25
This fixes the extremely poor accessibility of the old system, making it possible to navigate the sidebar by keyboard, and also implicitly gives the sidebar items the correct ARIA roles.
2022-06-30Rollup merge of #98709 - GuillaumeGomez:rm-decl-for-old-browsers, r=Dylan-DPCMatthias Krüger-34/+0
Remove unneeded methods declaration for old web browsers All these methods were not defined for IE mostly. But since we don't support it anymore, no need to keep them around. cc ```@jsha``` r? ```@notriddle```
2022-06-30Rollup merge of #98671 - GuillaumeGomez:source-sidebar-fixes, r=notriddleMatthias Krüger-1/+21
Fix source sidebar bugs This PR fixes the following two bugs: ![Screenshot from 2022-06-29 14-39-58](https://user-images.githubusercontent.com/3050060/176449070-3e3762da-2bfe-4acf-8eb0-34f6eb4c94ed.png) ![Screenshot from 2022-06-29 15-05-09](https://user-images.githubusercontent.com/3050060/176449073-b164820b-bd71-4b1a-990c-bba4e5fce196.png) I added regression tests to prevent them to happen again. I think we should backport it to beta as well. You can test it [here](https://rustdoc.crud.net/imperio/source-sidebar-fixes/src/std/lib.rs.html). cc ```@jsha``` r? ```@notriddle```
2022-06-30Fix scroll when source sidebar is open on mobileGuillaume Gomez-0/+15
2022-06-30Remove unneeded methods declaration for old web browsersGuillaume Gomez-34/+0
2022-06-29Rollup merge of #98646 - notriddle:notriddle/main.js, r=GuillaumeGomezMatthias Krüger-2/+6
rustdoc: fix bugs in main.js popover help and settings
2022-06-29Fix display of toggle on expanded source sidebarGuillaume Gomez-0/+3
2022-06-29Fix height for the source sidebar in mobile modeGuillaume Gomez-1/+3
2022-06-28rustdoc: make keyboard commands work when checkboxes are selectedMichael Howell-1/+2
2022-06-28rustdoc: fix keyboard shortcuts bug in settings menuMichael Howell-1/+1
This commit fixes the keyboard shorts code to call localStorage every time a key is pressed. This matters because you're supposed to be able to change a setting and have it immediately take effect.
2022-06-28rustdoc: fix help menu popover togglingMichael Howell-0/+3
2022-06-28Auto merge of #98475 - notriddle:notriddle/index-fn-signatures, r=GuillaumeGomezbors-35/+187
rustdoc: reference function signature types from the `p` array This reduces the size of the function signature index, because it's common to have many functions that operate on the same types. $ wc -c search-index-old.js search-index-new.js 5224374 search-index-old.js 3932314 search-index-new.js By my math, this reduces the uncompressed size of the search index by 32%. On compressed signatures, the wins are less drastic, a mere 8%: $ wc -c search-index-old.js.gz search-index-new.js.gz 404532 search-index-old.js.gz 371635 search-index-new.js.gz
2022-06-28Simplify CSS theming by setting CSS variablesGuillaume Gomez-199/+73
2022-06-28Remove unused CSS rulesGuillaume Gomez-17/+0
2022-06-27Add comments, fixes for `0` sentinelMichael Howell-4/+9
2022-06-27Update src/librustdoc/html/static/js/externs.jsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-06-27Put back, fix ()-output optimizationMichael Howell-1/+1
2022-06-27Add documentationMichael Howell-1/+87
2022-06-26Rollup merge of #98297 - GuillaumeGomez:help-pocket-menu, r=notriddleMatthias Krüger-168/+171
Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ``````````@jsha``````````
2022-06-25Fix CSS rule for selected and hovered items in the source sidebarGuillaume Gomez-6/+6
2022-06-24rustdoc: reference function signature types from the `p` arrayMichael Howell-35/+96
This reduces the size of the function signature index, because it's common to have many functions that operate on the same types. $ wc -c search-index-old.js search-index-new.js 5224374 search-index-old.js 3932314 search-index-new.js By my math, this reduces the uncompressed size of the search index by 32%. On compressed signatures, the wins are less drastic, a mere 8%: $ wc -c search-index-old.js.gz search-index-new.js.gz 404532 search-index-old.js.gz 371635 search-index-new.js.gz
2022-06-23Rollup merge of #98310 - jsha:defer-source-sidebar, r=GuillaumeGomezMichael Goulet-20/+36
rustdoc: optimize loading of source sidebar The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster. Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html r? ````@GuillaumeGomez````
2022-06-23Merge all popover hide functions into oneGuillaume Gomez-27/+18
2022-06-23Move help popup into a pocket menu as wellGuillaume Gomez-158/+170
2022-06-20rustdoc: optimize loading of source sidebarJacob Hoffman-Andrews-20/+36
The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster.
2022-06-20Improve loading of crates.js and sidebar-items.jsJacob Hoffman-Andrews-100/+76
Now that the "All Crates" dropdown is only rendered on the search results page, there is no need to load crates.js on most pages. Load it only on crate pages. Also, add the `defer` attribute so it does not block page rendering. For sidebar-items.js, move the script tag to `<head>`. Since it already has the defer attribute it won't block loading. The defer attribute does preserve ordering between scripts, so instead of the callback on load, it can set a global variable on load, which is slightly simpler. Also, since it is required to finish rendering the page, beginning its load earlier is better. Remove generation and handling of sidebar-vars. Everything there can be computed with information available in JS via other means. Remove the "other" wrapper in the sidebar. It was unnecessary. Remove excess script fields
2022-06-19Rollup merge of #98230 - GuillaumeGomez:weird-js-condition, r=notriddleMatthias Krüger-4/+1
Fix weird js condition While going around the code, I found this weird condition. Fixing also affects the generated results in some cases apparently (could only find this one). Any idea maybe `@notriddle?` r? `@notriddle`
2022-06-18Remove weird JS conditionGuillaume Gomez-4/+1
2022-06-18Adding new eslint checks:Guillaume Gomez-0/+2
* no-sequences * no-throw-literal
2022-06-14Fix expand/collapse on source viewer sidebar foldersGuillaume Gomez-3/+3
2022-06-11Add eslint rule "no-script-url"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-return-assign"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-multi-assign"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-mixed-operator"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-lonely-if"Guillaume Gomez-0/+1
2022-06-07Rollup merge of #97792 - GuillaumeGomez:eslint-checks, r=Dylan-DPCMatthias Krüger-1/+7
More eslint checks Here is the list of newly added eslint checks: * [no-confusing-arrow](https://eslint.org/docs/rules/no-confusing-arrow) * [no-div-regex](https://eslint.org/docs/rules/no-div-regex) * [no-floating-decimal](https://eslint.org/docs/rules/no-floating-decimal) * [no-implicit-globals](https://eslint.org/docs/rules/no-implicit-globals) * [no-implied-eval](https://eslint.org/docs/rules/no-implied-eval) * [no-label-var](https://eslint.org/docs/rules/no-label-var) Since you already reviewed the previous ones: r? `@Dylan-DPC`
2022-06-06Add "no-label-var" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-implied-eval" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-implicit-globals" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-floating-decimal" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-div-regex" eslint checkGuillaume Gomez-0/+1