Jump to content

User:Timeshifter/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Timeshifter (talk | contribs) at 23:54, 15 June 2023 (Button to expand table of contents in Vector 2022). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// 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')));