Wide Github

Change all Github repository and gist pages to be full width and dynamically sized.

目前为 2018-04-25 提交的版本。查看 最新版本

  1. "use strict";
  2.  
  3. // ==UserScript==
  4. // @name Wide Github
  5. // @namespace https://github.com/xthexder/wide-github
  6. // @description Change all Github repository and gist pages to be full width and dynamically sized.
  7. // @author xthexder
  8. // @copyright 2013+, xthexder (https://github.com/xthexder)
  9. // @contributor Jason Frey (https://github.com/Fryguy)
  10. // @contributor Marti Martz (https://github.com/Martii)
  11. // @license MIT; https://raw.githubusercontent.com/xthexder/wide-github/master/LICENSE
  12. // @version 1.2.0-joey3
  13. // @icon https://raw.githubusercontent.com/xthexder/wide-github/master/icon.png
  14. // @homepageURL https://github.com/xthexder/wide-github
  15. // @supportURL https://github.com/xthexder/wide-github/issues
  16. // @include *github.com*
  17. // @grant none
  18. //// Added by Joey:
  19. // @run-at document-start
  20. // ==/UserScript==
  21.  
  22. var styleSheet = "" +
  23. "header .container," +
  24. "header .container-lg {" +
  25. "width: auto !important;" +
  26. "margin-left: 20px !important;" +
  27. "margin-right: 20px !important;" +
  28. "min-width: 980px;" +
  29. "max-width: initial;" +
  30. "}" +
  31. "#js-repo-pjax-container .container {" +
  32. "width: auto !important;" +
  33. //"margin-left: 20px !important;" +
  34. //"margin-right: 20px !important;" +
  35. "min-width: 980px;" +
  36. // I use zoom 90% in Chrome. But that causes the left border of the file list to disappear, if I use an even max-width. So I have to use an odd max-width.
  37. "max-width: 1499px;" +
  38. "margin-left: auto !important;" +
  39. "margin-right: auto !important;" +
  40. "}" +
  41. ".full-width .container {" +
  42. "padding-left: auto !important;" +
  43. "padding-right: auto !important;" +
  44. "}" +
  45.  
  46. // New PR split diff
  47. ".full-width .new-pr-form {" +
  48. "max-width: none !important;" +
  49. "}" +
  50.  
  51. // Repository Issues
  52. "#js-repo-pjax-container .repository-content .discussion-timeline {" + // Issue body
  53. "margin-left: -220px;" +
  54. "padding-left: 220px;" +
  55. "width: 100% !important;" +
  56. "}" +
  57. ".repository-content .discussion-sidebar {" +
  58. "width: 200px !important;" +
  59. "}" +
  60. ".repository-content .timeline-new-comment {" + // New Issue / issue comment form
  61. "max-width: 100% !important;" +
  62. "}" +
  63. ".repository-content .inline-comments .comment-holder {" + // Diff / code comments
  64. "max-width: 960px !important;" +
  65. "}" +
  66. ".repository-content .inline-comments .inline-comment-form-container {" +
  67. "max-width: 960px !important;" +
  68. "}" +
  69. ".repository-content .inline-comments .inline-comment-form {" +
  70. "max-width: 960px !important;" +
  71. "}" +
  72.  
  73. // Repository pulse page
  74. ".repository-content .authors-and-code .section {" + // Contributors bar graph
  75. "width: 50%;" +
  76. "height: 180px;" +
  77. "}" +
  78. ".repository-content .authors-and-code .section svg {" +
  79. "height: 180px;" +
  80. "}" +
  81.  
  82. // Repository graph page
  83. ".repository-content .capped-card {" + // Graph cards on contributors / graph list
  84. "margin:10px 10px 0 0 !important;" +
  85. "}" +
  86.  
  87. // Gists
  88. ".gist-content-wrapper .container {" +
  89. "width: auto !important;" +
  90. "margin-left: 20px !important;" +
  91. "margin-right: 20px !important;" +
  92. "min-width: 980px;" +
  93. "}" +
  94.  
  95. "";
  96.  
  97. (function () {
  98. var s = document.createElement('style');
  99. s.type = "text/css";
  100. s.innerHTML = styleSheet;
  101. (document.head || document.documentElement).appendChild(s);
  102. })();