Hide Review Progress

Hides review progress while reviewing

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

You will need to install an extension such as Tampermonkey to install this 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         Hide Review Progress
// @namespace    http://tampermonkey.net/
// @version      1.0.2
// @description  Hides review progress while reviewing
// @author       Iaro
// @match        https://www.wanikani.com/review/session
// @grant        none
// ==/UserScript==

var hiding = false;

function addStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (head) {
        style = document.createElement('style');
        style.setAttribute('type', 'text/css');
        style.textContent = css;
        head.appendChild(style);
        return style;
    }
    return null;
}

(function() {
    //Does the thing!
    addStyle('#hiding-mode.active {color:#00f; opacity:1.0;}');
    hiding = localStorage.getItem('hiding');
    hiding = (hiding !== 'false');
    $('#summary-button').append('<a id="hiding-mode" href="#"' + (hiding ? ' class="active"' : '') + '><i class="icon-eye-open"></i></a>');
    $('#hiding-mode').click(function() {
        hiding = !hiding;
        console.log('Hiding mode ' + (hiding ? 'en' : 'dis') + 'abled!');
        localStorage.setItem('hiding', hiding);
        $(this).toggleClass('active', hiding);

        if (hiding) {
            $('#progress-bar').css('visibility', 'hidden');
            $('#stats').css('visibility', 'hidden');
        } else {
            $('#progress-bar').css('visibility', 'visible');
            $('#stats').css('visibility', 'visible');
        }
        return false;
    });

    if (hiding) {
        $('#progress-bar').css('visibility', 'hidden');
        $('#stats').css('visibility', 'hidden');
    } else {
        $('#progress-bar').css('visibility', 'visible');
        $('#stats').css('visibility', 'visible');
    }
})();