genius-date

script to inject today's date when transcribing a new song

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         genius-date
// @description  script to inject today's date when transcribing a new song
// @namespace    http://tampermonkey.net/
// @license MIT
// @version      1.0.1
// @description  A simple example userscript
// @author       solomoncyj
// @match        https://genius.com/new
// @grant        none
// ==/UserScript==

function selectElement(id, valueToSelect) {
    let element = document.getElementById(id);
    element.value = valueToSelect;
}

function inject()
{
    const today = new Date(Date.now());
    selectElement('song_release_date_1i', today.getFullYear());
    selectElement('song_release_date_2i', today.getMonth() + 1);
    selectElement('song_release_date_3i', today.getDate());
}

(function() {
   'use strict';

    let btn = document.createElement("button");
    btn.onclick = () => {
        inject()
    };
    const info = document.createTextNode("Today");
    let div = document.querySelector(".add_song_page-release_date");
    div.appendChild(btn);
    btn.appendChild(info);
})();