GreasyFork Plus

Improves the layout of GreasyFork.org

当前为 2014-10-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name GreasyFork Plus
  3. // @namespace 407d4100-4661-11e4-916c-0800200c9a66
  4. // @description Improves the layout of GreasyFork.org
  5. // @include https://greasyfork.org*
  6. // @version 1.0.0
  7. // @grant GM_addStyle
  8. // ==/UserScript==
  9. GM_addStyle("\
  10. body {\
  11. background: #F1F1F1;\
  12. }\
  13. a {\
  14. color: #167AC6;\
  15. text-decoration: none;\
  16. }\
  17. a:hover {\
  18. text-decoration: underline;\
  19. }\
  20. ");
  21. if(document.location.href.indexOf("greasyfork.org/scripts") > -1) {
  22. GM_addStyle("\
  23. #browse-script-list {\
  24. margin-top: 0px;\
  25. font-size: 0px;\
  26. }\
  27. #browse-script-list li {\
  28. margin: 0px;\
  29. }\
  30. article {\
  31. padding: 6px 12px;\
  32. width: 920px;\
  33. margin: 0px auto;\
  34. border: 1px solid #E2E2E2;\
  35. border-bottom: 0px;\
  36. background: #FFFFFF;\
  37. }\
  38. article h2 .name-description-separator {\
  39. display: none;\
  40. }\
  41. article h2 .description {\
  42. display: block;\
  43. }\
  44. article dl {\
  45. display: none;\
  46. }\
  47. article .description {\
  48. font-size: 14px;\
  49. }\
  50. .pagination {\
  51. padding: 16px 212px 6px;\
  52. height: 30px;\
  53. width: 520px;\
  54. background: #FFFFFF;\
  55. border: 1px solid #E2E2E2;\
  56. border-top: 0px;\
  57. margin: 0px auto;\
  58. -webkit-border-bottom-left-radius: 6px;\
  59. -webkit-border-bottom-right-radius: 6px;\
  60. -moz-border-radius-bottomleft: 6px;\
  61. -moz-border-radius-bottomright: 6px;\
  62. border-bottom-left-radius: 6px;\
  63. border-bottom-right-radius: 6px;\
  64. }\
  65. .pagination .current {\
  66. font-style: normal;\
  67. font-weight: bold;\
  68. }\
  69. .pagination a:last-child {\
  70. float: right;\
  71. }\
  72. body>p {\
  73. display: none;\
  74. }\
  75. body>ol li:last-child article {\
  76. border-bottom: 1px solid #E2E2E2;\
  77. }\
  78. #script-list-option-groups {\
  79. float: none;\
  80. width: 920px;\
  81. margin: 16px auto 0px;\
  82. padding: 6px 12px;\
  83. background: #FFFFFF;\
  84. border: 1px solid #E2E2E2;\
  85. border-bottom: 0px;\
  86. -webkit-border-top-left-radius: 6px;\
  87. -webkit-border-top-right-radius: 6px;\
  88. -moz-border-radius-topleft: 6px;\
  89. -moz-border-radius-topright: 6px;\
  90. border-top-left-radius: 6px;\
  91. border-top-right-radius: 6px;\
  92. }\
  93. #script-list-option-groups #script-list-filter {\
  94. display: none;\
  95. }\
  96. #script-list-option-groups #script-list-sort {\
  97. padding: 0px;\
  98. background: none;\
  99. height: 40px;\
  100. }\
  101. #script-list-option-groups #script-list-sort li {\
  102. display: block;\
  103. float: left;\
  104. width: 12%;\
  105. text-align: center;\
  106. font-size: 14px;\
  107. margin: 12px auto;\
  108. }\
  109. #script-list-option-groups #script-list-sort {\
  110. font-size: 0px;\
  111. }\
  112. \
  113. #script-content {\
  114. border: 1px solid #E1E1E1;\
  115. background: #FFFFFF;\
  116. width: 920px;\
  117. margin: 0px auto 16px;\
  118. padding: 12px;\
  119. -webkit-border-radius: 6px;\
  120. -moz-border-radius: 6px;\
  121. border-radius: 6px;\
  122. }\
  123. #script-info header h2, #script-info header p {\
  124. margin: 6px auto;\
  125. width: 920px;\
  126. }\
  127. #script-links {\
  128. width: 920px;\
  129. margin: 0px auto;\
  130. }\
  131. #script-links li {\
  132. border-color: #E1E1E1;\
  133. -webkit-border-top-left-radius: 2px;\
  134. -webkit-border-top-right-radius: 2px;\
  135. -moz-border-radius-topleft: 2px;\
  136. -moz-border-radius-topright: 2px;\
  137. border-top-left-radius: 2px;\
  138. border-top-right-radius: 2px;\
  139. }\
  140. #install-stats-chart-container {\
  141. display: none;\
  142. }\
  143. #additional-info div {\
  144. background: none;\
  145. padding: 0px;\
  146. padding-top: 6px;\
  147. }\
  148. ");
  149.  
  150. if(document.location.href.indexOf("-") == -1) { // Applies only on search results (not script pages)
  151. document.body.children[3].children[0].innerHTML = "◀";
  152. document.body.children[3].lastChild.innerHTML = "▶";
  153. document.body.children[3].innerHTML += "<a href='/script_versions/new'>Post a script</a>";
  154. }
  155. }
  156. else if(document.location.href.indexOf("greasemonkey.org/forum/") == -1 ) {
  157. var el, wrapper = document.createElement('div');
  158. wrapper.setAttribute("id", "wrapper");
  159. while (el = document.body.children[1]) {
  160. wrapper.appendChild(el);
  161. }
  162. document.body.appendChild(wrapper);
  163. GM_addStyle("\
  164. #wrapper {\
  165. width: 920px;\
  166. padding: 6px 12px;\
  167. background: #FFFFFF;\
  168. margin: 16px auto;\
  169. border: 1px solid #E1E1E1;\
  170. -webkit-border-radius: 6px;\
  171. -moz-border-radius: 6px;\
  172. border-radius: 6px;\
  173. }\
  174. ");
  175. }