Simple Print LeetCode Problems

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

Stan na 19-04-2017. Zobacz najnowsza wersja.

  1. // ==UserScript==
  2. // @name Simple Print LeetCode Problems
  3. // @namespace https://greatest.deepsurf.us/en/users/114838-groundzyy
  4. // @version 0.1
  5. // @description Removed unnecessary elements in the page for a clear PDF print of the leetcode question only
  6. // @author groundzyy
  7. // @match https://leetcode.com/problems/*
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12. $(document).ready(function() {
  13. var diff = $('.question-info > ul li:nth-child(5)').text();
  14. $('#tab-view-app').remove();
  15. $('#add-to-favorite').remove();
  16. $('.question-info').remove();
  17. $('.notepad-wrapper').remove();
  18. $('#interviewed-div').remove();
  19. $('section.action').remove();
  20. $('div.ng-scope').remove();
  21. $('div.navbar').remove();
  22. // $('footer').remove();
  23. $('#chat-link').remove();
  24. $('span.hidebutton').css('display', 'inline');
  25. $('#tags').remove();
  26. $('#similar').remove();
  27. $('a.btn-primary').css('border', '1px solid silver');
  28. $('a.btn-primary').removeAttr("href");
  29. $('a[href="/subscribe/"]').parent().remove();
  30. $('head title').text($('.question-title > h3').text().trim().replace('.', ''));
  31. $('body').css('font-size', '28px');
  32. $('pre').css('font-size', '22px');
  33. $('a.btn-primary').css('font-size', '20px');
  34. // $('a.btn-primary').parent().parent().css('margin-top', '10px');
  35. $('div.question-title h3').css('font-size', '32px');
  36. $('p').css('margin-bottom', '28px');
  37. $('p').css('margin-top', '28px');
  38. $('footer').remove();
  39. $('body').append('<footer></footer>');
  40. $('footer').append($('a.btn-primary').parent().parent());
  41. $('pre').css('white-space', 'pre-wrap');
  42. $('pre').css('font-size', '28px');
  43. $('.question-content').css('line-height', '42px');
  44. $('footer > a').css('font-size', '28px');
  45. $('.showspoilers').remove();
  46. $('div.spoilers').css('display', 'block');
  47. $('div.spoilers').css('margin-top', '100px');
  48. $('div.spoilers').css('font-size', '20px');
  49. $('footer').css('margin-top', '-200px');
  50. });
  51. })();