IMSLP Expand Composition Information

Expands composition information in the IMSLP library.

  1. // ==UserScript==
  2. // @name IMSLP Expand Composition Information
  3. // @namespace https://github.com/Enchoseon/enchos-assorted-userscripts/raw/main/imslp-expand-composition-information.user.js
  4. // @version 1.0.3
  5. // @description Expands composition information in the IMSLP library.
  6. // @author Enchoseon
  7. // @include *imslp.org*
  8. // @run-at document-end
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. "use strict";
  14. // ==============================
  15. // Expand Composition Information
  16. // ==============================
  17. expandCompositionInformation();
  18. document.getElementById("cathassecselp1").addEventListener("click", function (event) {
  19. expandCompositionInformation();
  20. }, true);
  21. function expandCompositionInformation() {
  22. Object.values(document.getElementById("mw-pages").getElementsByTagName("li")).forEach((elem) => {
  23. elem.dispatchEvent(new Event("mouseover"));
  24. window.addEventListener("mouseout", function (event) {
  25. event.stopPropagation();
  26. }, true);
  27. });
  28. }
  29. // ============
  30. // Style Tweaks
  31. // ============
  32. const css = `
  33. .showHSList a {
  34. font-weight: bold;
  35. }
  36. `;
  37. var s = document.createElement("style");
  38. s.setAttribute("type", "text/css");
  39. s.appendChild(document.createTextNode(css));
  40. document.getElementsByTagName("head")[0].appendChild(s);
  41. })();