Greasy Fork is available in English.

牛客网布局优化去广告

牛客网布局优化去广告、添加了几个按钮

Per 30-06-2018. Zie de nieuwste versie.

  1. // ==UserScript==
  2. // @name 牛客网布局优化去广告
  3. // @namespace www.logicr.club
  4. // @version 2.0
  5. // @description 牛客网布局优化去广告、添加了几个按钮
  6. // @author Logicr
  7. // @match https://www.nowcoder.com/*
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12. //去除反馈
  13. $(".fixed-menu").remove();
  14. //顶栏优化icon-mobile-phone
  15. //$(".icon-mobile-phone").remove();
  16.  
  17. $("li>a").remove(".icon-mobile-phone");
  18. $("li").remove(".nav-msg");
  19. //顶栏收起
  20. $(".header-main.clearfix").hide();
  21. //按钮样式改不了啊,算了
  22. var showHeadButton = "<button class='' id='SHB' style='display: block;'>点我展开</button>";
  23. var hideHeadButton = "<button class='clearfix' id='HHB'>点我隐藏</button>";
  24. $(".header-main.clearfix").before(showHeadButton);
  25. $(".header-main.clearfix").before(hideHeadButton);
  26. $("#HHB").hide();
  27. $("#SHB").click(function(){
  28. $(".header-main.clearfix").show();
  29. $("#SHB").hide();
  30. $("#HHB").show();
  31. })
  32. $("#HHB").click(function(){
  33. $(".header-main.clearfix").hide();
  34. $("#HHB").hide();
  35. $("#SHB").show();
  36. })
  37.  
  38. //马上挑战下面的条条去除
  39. //$(".subject-action.clearfix").remove();
  40. $(".subject-menu").remove();
  41. //
  42. $("#jsSideTopicList.module-box.side-topic-box").remove();
  43. $(".module-headclearfix").remove();
  44. //module-body
  45. //$(".module-body").remove();
  46. //侧边广告
  47. $(".side-topic-list").remove();
  48. //去除挑战通过的具体名单
  49. $(".list-mod").remove();
  50.  
  51. //收起牛友的回答
  52. $("#jsComment.module-body.answer-mod").hide();
  53. //添加展开按钮
  54. var responseButton = "<button class='tag-label' id='responseShowButton'>点我展开</button>";
  55. var responseButtonHide = "<button class='tag-label' id='responseHideButton'>点我隐藏</button>";
  56. $(".module-box.js-discussion").before(responseButton);
  57. $(".module-box.js-discussion").before(responseButtonHide);
  58. $("#responseHideButton").hide();
  59. $("#responseShowButton").click(function(){
  60. $("#jsComment.module-body.answer-mod").show();
  61. $("#responseShowButton").hide();
  62. $("#responseHideButton").show();
  63.  
  64. })
  65. $("#responseHideButton").click(function(){
  66. $("#jsComment.module-body.answer-mod").hide();
  67. $("#responseHideButton").hide();
  68. $("#responseShowButton").show();
  69.  
  70. })
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. //收起回复框框
  78. $("#jsEditorModuleBody.module-body").hide();
  79. //添加点击打开回复框框到“添加回答”
  80. $("#jsDealAnswer.btn.btn-primary.float-right.nc-req-auth").click(function(){
  81. $("#jsEditorModuleBody.module-body").show();
  82. })
  83.  
  84. //相关试题收起
  85. $(".list-module").hide();
  86. //提示
  87. //var abutton = "<a class='tag-label id='showButton' href='#'>点我展开</a>";
  88. //"<button id='hideMe'>隐藏侧边栏</button>";
  89. var abutton = "<button class='tag-label' id='showButton'>点我展开</button>";
  90. var abuttonHide = "<button class='tag-label' id='hideButton'>点我隐藏</button>";
  91. //点击展开
  92. $(".list-module").before(abutton);
  93. $(".list-module").before(abuttonHide);
  94. $("#hideButton").hide();
  95.  
  96. $("#showButton").click(function(){
  97. $(".list-module").show();
  98. $("#showButton").hide();
  99. $("#hideButton").show();
  100. })
  101. //点击隐藏
  102. $("#hideButton").click(function(){
  103. $(".list-module").hide();
  104. $("#showButton").show();
  105. $("#hideButton").hide();
  106. })
  107.  
  108. //修改右侧“查看代码的样式”
  109. // document.getElementById("mod-head-link").className = "tag-label";
  110.  
  111. //oprt-tool clearfix 解答收藏按钮
  112. $(".oprt-tool.clearfix").hide();
  113.  
  114. //foot
  115. $(".ft-wrap").remove();
  116.  
  117.  
  118. //module-head clearfix
  119. // Your code here...
  120. })();