IMSLP Expand Composition Information

Expands composition information in the IMSLP library.

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);
})();