Guillaume Gomez
33245e0bb3
Add new eslint rule "comma-style"
2022-05-25 13:57:08 +02:00
Guillaume Gomez
4dbc6764cf
Add new eslint rule "comma-dangle"
2022-05-25 13:56:27 +02:00
Guillaume Gomez
c5e3954887
Add new eslint rule "space-before-blocks"
2022-05-25 13:55:54 +02:00
Guillaume Gomez
6c7156d488
Add new eslint rule "space-before-function-paren"
2022-05-25 13:55:09 +02:00
Guillaume Gomez
231b47b2b9
Add eslint rule "space-infix-ops"
2022-05-25 13:53:19 +02:00
Guillaume Gomez
399299fba2
Add new eslint rule to prevent whitespace before function call paren
2022-05-22 22:29:44 +02:00
Guillaume Gomez
116c5a25e7
Add eslint key-spacing check
2022-05-20 20:27:35 +02:00
Guillaume Gomez
b036fd378b
Add eslint arrow-spacing check
2022-05-20 20:27:34 +02:00
Guillaume Gomez
8fe333abd0
Add new lint to enforce whitespace after keywords
2022-05-19 17:19:22 +02:00
Guillaume Gomez
72496d88d3
Move some DOM generation into the HTML settings file directly
2022-05-18 11:40:15 +02:00
Yuki Okushi
b8dd27079c
Rollup merge of #97113 - GuillaumeGomez:search-ui-fixes, r=notriddle
...
Search GUI fixes
The first fix is about the duplicated "in":

The second fix is about the `<select>` broken style:


You can test it [here](https://rustdoc.crud.net/imperio/search-ui-fixes/doc/foo/index.html?search=test ).
r? `@notriddle`
2022-05-18 07:41:00 +09:00
Jacob Hoffman-Andrews
453979462a
rustdoc: make search.js a module
...
Previously, search.js relied on the DOM and the `window` object. It can now be
loaded in the absence of the DOM, for instance by Node. The same is true of
search-index.js.
This allows removing a lot of code from src/tools/rustdoc-js/tester.js that
tried to parse search.js and extract specific functions that were needed for
testing.
2022-05-17 09:26:18 -07:00
Guillaume Gomez
0f8b3f4cae
Fix display of search crate filter select
2022-05-17 14:20:34 +02:00
Guillaume Gomez
d765b73a01
Fix duplicated "in" in the search result text
2022-05-17 13:15:49 +02:00
Guillaume Gomez
5d84c0c569
Add new eslint rule about brace style
2022-05-15 13:59:51 +02:00
Guillaume Gomez
e8762757c3
Remove theme picker button
2022-05-14 17:21:52 +02:00
Guillaume Gomez
5e01ba36c9
Improve settings menu display
2022-05-14 17:21:52 +02:00
Michael Howell
d3fd6bfd30
rustdoc: fix GUI crash when searching for magic JS property values
2022-05-12 14:15:31 -07:00
Matthias Krüger
231cd0fd7d
Rollup merge of #96939 - GuillaumeGomez:settings-css, r=notriddle
...
Fix settings page CSS
In https://github.com/rust-lang/rust/pull/96741 , I moved the CSS loading outside of `settings.js`. The result was that on the settings page, there isn't the settings CSS anymore:

I also used this opportunity to remove unused CSS rules (we don't have `<select>` elements anymore in the settings).
cc `@jsha`
r? `@notriddle`
2022-05-12 16:41:04 +02:00
Guillaume Gomez
92482cabaa
Remove unused CSS settings rules
2022-05-11 11:27:13 +02:00
Yuki Okushi
95b2d37a39
Rollup merge of #96900 - GuillaumeGomez:fix-js-error, r=notriddle
...
Fix js error
On the source code pages, we get a JS error:

It's fixed in the first commit. The second one is removing an unused CSS rule and the third one is a little cleanup of a GUI test.
cc ``@jsha``
r? ``@notriddle``
2022-05-11 13:16:33 +09:00
Yuki Okushi
d34915f691
Rollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomez
...
rustdoc: search result ranking fix
# Before

# After

2022-05-11 00:09:35 +09:00
Guillaume Gomez
f9fc7ef097
Remove unused CSS rule
2022-05-10 16:40:32 +02:00
Guillaume Gomez
f82b3a16d5
Fix JS error in source code pages
2022-05-10 16:40:14 +02:00
Michael Howell
360d6e4b7d
rustdoc: search result ranking fix
2022-05-09 11:49:05 -07:00
Michael Howell
521d2c3d3c
Remove unused param from search.js::checkPath
2022-05-08 22:19:40 -07:00
Guillaume Gomez
1e93165b05
Enforce no trailing spaces with eslint
2022-05-08 14:08:33 +02:00
Guillaume Gomez
b7e5116375
Enforce linebreak style in js source code
2022-05-08 14:07:25 +02:00
Guillaume Gomez
14897180ae
Enforce quote rule for JS source code
2022-05-07 20:50:55 +02:00
Folyd
a8ede1248d
Change eslint rules from configuration comments to configuration files
2022-05-07 11:47:30 +08:00
Guillaume Gomez
bcfb95afd3
Rollup merge of #96754 - notriddle:notriddle/impl-dups, r=GuillaumeGomez
...
rustdoc: ensure HTML/JS side implementors don't have dups
Fixes #94641
Rendered:
- https://notriddle.com/notriddle-rustdoc-test/impl-dups/std/iter/trait.Iterator.html
- https://notriddle.com/notriddle-rustdoc-test/impl-dups/core/iter/trait.Iterator.html
2022-05-06 20:05:43 +02:00
Guillaume Gomez
93b86d69b6
Rollup merge of #96748 - GuillaumeGomez:reexports-in-search, r=notriddle
...
Fixes reexports in search
Fixes #96681 .
At some point we stopped reexporting items in search so this PR fixes it.
It also adds a regression test.
r? ```@notriddle```
2022-05-06 20:05:41 +02:00
Guillaume Gomez
fcb0bce25c
Rollup merge of #96590 - notriddle:notriddle/tab-bar-fn-search, r=GuillaumeGomez,jsha
...
rustdoc: when running a function-signature search, tweak the tab bar
# Before

# After

2022-05-06 20:05:38 +02:00
Guillaume Gomez
279dee5374
Fix reexports missing from the search index
2022-05-06 13:52:21 +02:00
Michael Goulet
7cdad77536
Rollup merge of #96741 - GuillaumeGomez:improve-settings-loading-strategy, r=jsha
...
Improve settings loading strategy
I learned about this thanks to ```@jsha``` who suggested this approach:
It improves the settings loading strategy by loading CSS and JS at the same time to prevent the style to be applied afterwards on slow connections.
r? ```@jsha```
2022-05-05 19:34:25 -07:00
Michael Goulet
292eefe753
Rollup merge of #96704 - GuillaumeGomez:rotation-animation, r=jsha
...
Add rotation animation on settings button when loading
As discussed, I added an animation when the settings JS file is loading (I voluntarily made the timeout at the end of the `settings.js` super long so we can see what the animation looks like):
https://user-images.githubusercontent.com/3050060/166693243-816a08b7-5e39-4142-acd3-686ad9950d8e.mp4
r? ````@jsha````
2022-05-05 19:34:24 -07:00
Michael Howell
20010d7597
rustdoc: ensure HTML/JS side implementors don't have dups
2022-05-05 17:45:33 -07:00
Guillaume Gomez
87b6326d67
Improve settings loading strategy by loading CSS and JS at the same time to prevent the style to be applied afterwards on slow connections
2022-05-05 20:19:40 +02:00
Michael Howell
4c183cd2d4
rustdoc: fix JS error when rendering parse error
2022-05-05 09:39:47 -07:00
Michael Howell
8b2147b497
rustdoc: fix keyboard shortcuts and console log on search page
2022-05-05 09:39:45 -07:00
Michael Howell
21a121332b
rustdoc: change the "In Function Signatures" to context-sensitive
...
* If it's just `-> a`, use "In Function Return Types"
* If it's just `a b`, use "In Function Parameters"
* Otherwise, still use "In Function Signatures"
2022-05-05 09:37:29 -07:00
Michael Howell
6c8a2d4715
rustdoc: when running a function-signature search, tweak the tab bar
2022-05-05 09:37:29 -07:00
Guillaume Gomez
13b45aa6c6
Add rotation animation on settings button when loading
2022-05-05 11:08:15 +02:00
Guillaume Gomez
1e204ddb3b
Use "strict" mode in JS scripts
2022-05-05 11:07:14 +02:00
Folyd
67ebeea7a0
Move callback to the () => {} syntax.
...
Fix lint
Fix main.js
Restore anonymous functions
Fix
Fix more
2022-05-04 11:10:48 +08:00
Guillaume Gomez
73688e4021
* Add documentation for settings page rendering functions.
...
* Improve code.
* Fix some documentation argument types.
* Make settings order the same as before this PR.
* Change timeout to 0 so that browser will render it as fast as possible.
2022-05-01 21:22:38 +02:00
Guillaume Gomez
9625ed8be7
Move settings into full JS
2022-04-30 13:12:41 +02:00
Dylan DPC
bfb13ec691
Rollup merge of #96390 - GuillaumeGomez:es6-part2, r=notriddle
...
Switch JS code to ES6 - part 2
Part of #93058 .
It's based on https://github.com/rust-lang/rust/pull/96361 so it needs to wait for it to be merged first.
r? `@notriddle`
2022-04-29 23:54:37 +02:00
Guillaume Gomez
4e0be6ddeb
Remove dead code in main.js
2022-04-26 20:59:33 +02:00
Guillaume Gomez
509b145744
Migrate scrape-examples.js to ES6
2022-04-26 20:59:33 +02:00