about summary refs log tree commit diff
path: root/src/librustdoc/html/static/source-script.js
AgeCommit message (Collapse)AuthorLines
2021-07-07Clean up rustdoc static filesGuillaume Gomez-249/+0
2021-05-15Fix eslint errorsGuillaume Gomez-6/+7
2021-05-12Rollup merge of #85117 - jsha:bubble-bubble-toil-and-trouble, r=GuillaumeGomezGuillaume Gomez-0/+97
Move global click handlers to per-element ones. In rustdoc's main.js, we had an onclick handler for the whole document that would dispatch to handlers for various elements. This change attaches the handlers to the elements that trigger them, instead. This simplifies the code and avoids reimplementing the browser's bubbling functionality. As part of this change, change from a class to an id for help button. Move the handlers and associated code for highlighting source lines into source-script.js (and factor out a shared regex). Demo at https://hoffman-andrews.com/rust/bubble-bubble-toil-and-trouble/std/string/struct.String.html Note: this conflicts with / depends on #85074. Once that's merged I'll rebase this and resolve conflicts. Part of #83332. Thanks to `@Manishearth` for the [suggestion to not reimplement bubbling](https://github.com/rust-lang/rust/issues/83332#issuecomment-803497509). r? `@GuillaumeGomez`
2021-05-11Move global click handlers to per-element ones.Jacob Hoffman-Andrews-0/+97
In rustdoc's main.js, we had an onclick handler for the whole document that would dispatch to handlers for various elements. This change attaches the handlers to the elements that trigger them, instead. This simplfies the code and avoids reimplementing the browser's bubbling functionality. As part of this change, change from a class to an id for help button. Move the handlers and associated code for highlighting source lines into source-script.js (and factor out a shared regex).
2021-05-11rustdoc: remove explicit boolean comparisons.Jacob Hoffman-Andrews-5/+4
For boolean variables it's shorter and more readable to check the value directly, or negate it with `!`. In a couple of cases I reordered an if/else pair because it made the initial `if` statement simpler. Removed unused isType parameter from two functions.
2021-01-25Fix some bugs reported by eslintGuillaume Gomez-0/+2
2021-01-15Improve JS performance by storing length before comparing to it in loopsGuillaume Gomez-3/+5
2020-07-16Remove elements iterator clone and only keep first element insteadGuillaume Gomez-3/+3
2020-07-14Focus on the current file in the source file sidebarGuillaume Gomez-0/+5
2020-05-26Fix eslint lintsGuillaume Gomez-1/+1
2019-04-12Don't generate empty json variablesGuillaume Gomez-15/+19
2019-02-03Improve file list displayGuillaume Gomez-1/+1
2019-01-15Fix sources sidebar not showing upGuillaume Gomez-2/+0
2018-12-25Remove licensesMark Rousskov-12/+0
2018-12-04Added a bare-bones eslint config (removing jslint)John Heitmann-0/+6
This change removes the small bit of jslint config, replacing it with eslint. I've currently configured eslint to mostly only report the more serious of lints, although there are still some style nits turned on. Upcoming changes will start fixing lints.
2018-11-24Don't show file sidebar by defaultGuillaume Gomez-6/+6
2018-11-24Source sidebar improvementsGuillaume Gomez-12/+12
2018-11-24Add source file sidebarGuillaume Gomez-0/+147