ToolFlight

A set of tools and features for the online notation platform called Noteflight.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name         ToolFlight
// @namespace    Unseeable's Noteflight Tools
// @version      1.0.0-b2r0
// @description  A set of tools and features for the online notation platform called Noteflight.
// @author       Colton Stone
// @homepage     https://github.com/Unseeable8710/ToolFlight
// @license      GPL-3.0-or-later
// @tag          productivity
// @tag          utilities
// @match        https://www.noteflight.com/*
// @require      https://update.greasyfork.org/scripts/540433/1612221/JSVL.js
// @icon         https://www.google.com/s2/favicons?sz=32&domain=noteflight.com
// @grant        unsafeWindow
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @run-at       document-start
// ==/UserScript==

var uwin;
var udoc;
(function () {
  // I'm not British, I just used single quotes for this. I usually prefer using double quotes because my American self is used to them.
  uwin = unsafeWindow;
  udoc = uwin.document;
  // uwin.alert("vars");
  function searchUserScores() {
    var name = prompt("Enter the username of the person whose scores you want to find:");
    if (name != null) {
      open(`https://noteflight.com/music/search?term=${name}`);
    }
  }
  // uwin.alert("search user scores");
  GM_registerMenuCommand("Search scores by user", searchUserScores, {
    accessKey: "u",
    title: "Searches for scores by a specific user. This can be handy if their scores aren't displayed on their profile."
  });
  // uwin.alert("register menu command");
  GM_addStyle(`
    textarea {
      resize: vertical !important;
      field-sizing: content !important;
    }
  `);
  // uwin.alert("style");
  // uwin.onload = () => {
  //   udoc.addEventListener("DOMContentLoaded", () => {
  //     uwin.alert("dom loaded");
  //     uwin.console.log("dom loaded");
  //     async function loop() {
  //       uwin.alert("called loop");
  //       const observer = new ResizeObserver(entries => {
  //         for (let entry of entries) {
  //           const newHeight = entry.contentRect.height;
  //           entry.target.style.height = "unset";
  //           entry.target.style.minHeight = newHeight;
  //           uwin.alert("resized");
  //         }
  //       });
  //       uwin.alert("observer");
  //       await function () {
  //         return new Promise((resolve, reject) => {
  //           try {
  //             var textareas = [];
  //             udoc.querySelectorAll("textarea").forEach((element) => {
  //               textareas[textareas.length] = element;
  //               element.style.minHeight = element.style.height;
  //               element.style.height = "unset";
  //               observer.observe(element);
  //             });
  //           } catch (error) {
  //             uwin.alert(error);
  //             console.error(error);
  //           }
  //         });
  //       }
  //       uwin.alert("returned promise");
  //       await loop();
  //     }
  //     loop();
  //   });
  // }
})();