IMSLP Expand Composition Information

Expands composition information in the IMSLP library.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        IMSLP Expand Composition Information
// @namespace   https://github.com/Enchoseon/enchos-assorted-userscripts/raw/main/imslp-expand-composition-information.user.js
// @version     1.0.3
// @description Expands composition information in the IMSLP library.
// @author      Enchoseon
// @include     *imslp.org*
// @run-at      document-end
// @grant       none
// ==/UserScript==

(function() {
    "use strict";
    // ==============================
    // Expand Composition Information
    // ==============================
    expandCompositionInformation();
    document.getElementById("cathassecselp1").addEventListener("click", function (event) {
        expandCompositionInformation();
    }, true);
    function expandCompositionInformation() {
        Object.values(document.getElementById("mw-pages").getElementsByTagName("li")).forEach((elem) => {
            elem.dispatchEvent(new Event("mouseover"));
            window.addEventListener("mouseout", function (event) {
                event.stopPropagation();
            }, true);
        });
    }
    // ============
    // Style Tweaks
    // ============
    const css = `
        .showHSList a {
            font-weight: bold;
        }
    `;
    var s = document.createElement("style");
    s.setAttribute("type", "text/css");
    s.appendChild(document.createTextNode(css));
    document.getElementsByTagName("head")[0].appendChild(s);
})();