User:Timeshifter/common.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/common.css. |
// https://en.wikipedia.org/wiki/User:PrimeHunter/Pageviews.js
// It creates a "Page views" link in the Tools section of the sidebar.
// There is a "Page statistics" link and a "Pageviews" link at top of history page.
// Those exist with and without this user script.
importScript('User:PrimeHunter/Pageviews.js'); // Backlink: [[User:PrimeHunter/Pageviews.js]]
// Button to expand table of contents in Vector 2022
// https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Button_to_expand_table_of_contents_in_Vector_2022
document.querySelectorAll('.vector-toc-level-1')
.forEach((item=>item.classList.add('vector-toc-list-item-expanded')));
document.querySelectorAll('.vector-toc-contents [aria-expanded="false"]')
.forEach((item=>item.setAttribute('aria-expanded', 'true')));