Simple Print LeetCode Problems

Removed unnecessary elements in the page for a clear PDF print of the leetcode question only

Versione datata 19/04/2017. Vedi la nuova versione l'ultima versione.

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         Simple Print LeetCode Problems
// @namespace    https://greatest.deepsurf.us/en/users/114838-groundzyy
// @version      0.1
// @description  Removed unnecessary elements in the page for a clear PDF print of the leetcode question only
// @author       groundzyy
// @match        https://leetcode.com/problems/*
// ==/UserScript==

(function() {
    'use strict';
    $(document).ready(function() {
        var diff = $('.question-info > ul li:nth-child(5)').text();
        $('#tab-view-app').remove();
        $('#add-to-favorite').remove();
        $('.question-info').remove();
        $('.notepad-wrapper').remove();
        $('#interviewed-div').remove();
        $('section.action').remove();
        $('div.ng-scope').remove();
        $('div.navbar').remove();
        // $('footer').remove();
        $('#chat-link').remove();
        $('span.hidebutton').css('display', 'inline');
        $('#tags').remove();
        $('#similar').remove();
        $('a.btn-primary').css('border', '1px solid silver');
        $('a.btn-primary').removeAttr("href");
        $('a[href="/subscribe/"]').parent().remove();
        $('head title').text($('.question-title > h3').text().trim().replace('.', ''));
        $('body').css('font-size', '28px');
        $('pre').css('font-size', '22px');
        $('a.btn-primary').css('font-size', '20px');
        // $('a.btn-primary').parent().parent().css('margin-top', '10px');
        $('div.question-title h3').css('font-size', '32px');
        $('p').css('margin-bottom', '28px');
        $('p').css('margin-top', '28px');
        $('footer').remove();
        $('body').append('<footer></footer>');
        $('footer').append($('a.btn-primary').parent().parent());
        $('pre').css('white-space', 'pre-wrap');
        $('pre').css('font-size', '28px');
        $('.question-content').css('line-height', '42px');
        $('footer > a').css('font-size', '28px');
        $('.showspoilers').remove();
        $('div.spoilers').css('display', 'block');
        $('div.spoilers').css('margin-top', '100px');
         $('div.spoilers').css('font-size', '20px');
        $('footer').css('margin-top', '-200px');
    });
})();