User:Timeshifter/vector-2022.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Timeshifter/vector-2022.css. |
// This expands/collapses the Vector 2022 table of contents (TOC) via a text button:
// "Expand all/Collapse all"
// Great for long pages and articles with multi-level TOCs. For example:
// https://en.wikipedia.org/wiki/Help:Table or articles for many country presidents.
// https://en.wikipedia.org/wiki/Barack_Obama
// https://phabricator.wikimedia.org/T302426
// From Village Pump discussions:
// https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_206#Button_to_expand_table_of_contents_in_Vector_2022
// https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_206#New_Vector_2022_Skin_Navigation_Bar_(Table_of_Contents)_--_Expanded_View
// More info: https://en.wikipedia.org/wiki/User:The_wub/tocExpandAll.js
// And here: https://en.wikipedia.org/wiki/User:The_wub/tocExpandAll.css
// Add code below to https://en.wikipedia.org/wiki/Special:MyPage/vector.js
importScript('User:The wub/tocExpandAll.js');