牛客网布局优化去广告

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

Από την 29/06/2018. Δείτε την τελευταία έκδοση.

  1. // ==UserScript==
  2. // @name 牛客网布局优化去广告
  3. // @namespace www.logicr.club
  4. // @version 1.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. $("li").remove(".nav-msg");
  17. //
  18. $("#jsSideTopicList.module-box.side-topic-box").remove();
  19. $(".module-headclearfix").remove();
  20. //module-body
  21. //$(".module-body").remove();
  22. //侧边广告
  23. $(".side-topic-list").remove();
  24. //去除挑战通过的具体名单
  25. $(".list-mod").remove();
  26.  
  27. //收起牛友的回答
  28. $("#jsComment.module-body.answer-mod").hide();
  29. //添加展开按钮
  30. var responseButton = "<button class='tag-label' id='responseShowButton'>点我展开</button>";
  31. var responseButtonHide = "<button class='tag-label' id='responseHideButton'>点我隐藏</button>";
  32. $(".module-box.js-discussion").before(responseButton);
  33. $(".module-box.js-discussion").before(responseButtonHide);
  34. $("#responseHideButton").hide();
  35. $("#responseShowButton").click(function(){
  36. $("#jsComment.module-body.answer-mod").show();
  37. $("#responseShowButton").hide();
  38. $("#responseHideButton").show();
  39.  
  40. })
  41. $("#responseHideButton").click(function(){
  42. $("#jsComment.module-body.answer-mod").hide();
  43. $("#responseHideButton").hide();
  44. $("#responseShowButton").show();
  45.  
  46. })
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. //收起回复框框
  54. $("#jsEditorModuleBody.module-body").hide();
  55. //添加点击打开回复框框到“添加回答”
  56. $("#jsDealAnswer.btn.btn-primary.float-right.nc-req-auth").click(function(){
  57. $("#jsEditorModuleBody.module-body").show();
  58. })
  59.  
  60. //相关试题收起
  61. $(".list-module").hide();
  62. //提示
  63. //var abutton = "<a class='tag-label id='showButton' href='#'>点我展开</a>";
  64. //"<button id='hideMe'>隐藏侧边栏</button>";
  65. var abutton = "<button class='tag-label' id='showButton'>点我展开</button>";
  66. var abuttonHide = "<button class='tag-label' id='hideButton'>点我隐藏</button>";
  67. //点击展开
  68. $(".list-module").before(abutton);
  69. $(".list-module").before(abuttonHide);
  70. $("#hideButton").hide();
  71.  
  72. $("#showButton").click(function(){
  73. $(".list-module").show();
  74. $("#showButton").hide();
  75. $("#hideButton").show();
  76. })
  77. //点击隐藏
  78. $("#hideButton").click(function(){
  79. $(".list-module").hide();
  80. $("#showButton").show();
  81. $("#hideButton").hide();
  82. })
  83. //oprt-tool clearfix 解答收藏按钮
  84. $(".oprt-tool.clearfix").hide();
  85.  
  86. //foot
  87. $(".ft-wrap").remove();
  88.  
  89.  
  90. //module-head clearfix
  91. // Your code here...
  92. })();