知乎美化

1.【重要更新】增加夜间模式按钮 2.知乎题目栏增加举报、匿名、问题日志、快捷键四个按钮 3.知乎按钮图标在鼠标悬停时变色(题目按钮、回答下方按钮、评论按钮等) 4.回答的发布时间移至顶部 5.图片原图显示 6.文字和卡片链接从知乎跳转链接改为直链 7.集成其他脚本的知乎视频下载功能 8.隐藏侧边栏 9.GIF图自动播放【默认不开启】 10.问题增加创建时间和最后编辑时间 11.鼠标悬停在回答时显示浅蓝色聚焦框 12.引用角标高亮 13.首页信息流增加不感兴趣按钮 14.【重要更新】增加设置界面

目前為 2021-03-27 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 知乎美化
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.1.5.4
  5. // @description 1.【重要更新】增加夜间模式按钮 2.知乎题目栏增加举报、匿名、问题日志、快捷键四个按钮 3.知乎按钮图标在鼠标悬停时变色(题目按钮、回答下方按钮、评论按钮等) 4.回答的发布时间移至顶部 5.图片原图显示 6.文字和卡片链接从知乎跳转链接改为直链 7.集成其他脚本的知乎视频下载功能 8.隐藏侧边栏 9.GIF图自动播放【默认不开启】 10.问题增加创建时间和最后编辑时间 11.鼠标悬停在回答时显示浅蓝色聚焦框 12.引用角标高亮 13.首页信息流增加不感兴趣按钮 14.【重要更新】增加设置界面
  6. // @author AN drew
  7. // @match *://*.zhihu.com/*
  8. // @match https://v.vzuu.com/video/*
  9. // @require https://lib.baomitu.com/jquery/3.5.0/jquery.min.js
  10. // @require https://cdn.bootcdn.net/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js
  11. // @connect zhihu.com
  12. // @connect vzuu.com
  13. // @grant GM_info
  14. // @grant GM_download
  15. // @grant GM_registerMenuCommand
  16. // @grant GM_setValue
  17. // @grant GM_getValue
  18. // @grant GM_deleteValue
  19. // @grant GM_addStyle
  20. // @grant unsafeWindow
  21. // @run-at document-end
  22. // ==/UserScript==
  23.  
  24. var hideIndexSidebar; //隐藏首页侧边栏
  25. var hideQuestionSidebar; //隐藏回答侧边栏
  26. var hideSearchSideBar; //隐藏搜索侧边栏
  27. var hideTopicSideBar; //隐藏话题侧边栏
  28. var hideCollectionSideBar; //隐藏收藏侧边栏
  29. var hideClubSideBar; //隐藏圈子侧边栏
  30. var hideDraftSideBar; //隐藏草稿侧边栏
  31. var hideLaterSideBar; //隐藏稍后答侧边栏
  32. var hideProfileSidebar; //隐藏用户主页侧边栏
  33. var hideRecommendedReading; //隐藏专栏推荐阅读
  34. var publishTop; //置顶回答时间
  35. var GIFAutoPlay; //GIF自动播放
  36. var hoverShadow; //悬停时显示浅蓝色边框
  37. var blockingPictureVideo; //隐藏图片/视频
  38.  
  39.  
  40. //日间模式图标(base64)
  41. var light = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDIC' +
  42. 'ItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTkxNjA2NzI5MzM4IiB' +
  43. 'jbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjkxNSIgd2lk' +
  44. 'dGg9IjMyIiBoZWlnaHQ9IjMyIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj5AZm9udC1mY' +
  45. 'WNlIHsgZm9udC1mYW1pbHk6IGVsZW1lbnQtaWNvbnM7IHNyYzogdXJsKCJjaHJvbWUtZXh0ZW5zaW9uOi8vYmJha2hubWZramVuZmJoamRkZGlwY2VmbmhwaWtqYmovZm9udH' +
  46. 'MvZWxlbWVudC1pY29ucy53b2ZmIikgZm9ybWF0KCJ3b2ZmIiksIHVybCgiY2hyb21lLWV4dGVuc2lvbjovL2JiYWtobm1ma2plbmZiaGpkZGRpcGNlZm5ocGlramJqL2ZvbnR' +
  47. 'zL2VsZW1lbnQtaWNvbnMudHRmICIpIGZvcm1hdCgidHJ1ZXR5cGUiKTsgfQo8L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNTEyLjEgNzQzLjVjLTEyNy42IDAtMjMxLjQtMTAz' +
  48. 'LjgtMjMxLjQtMjMxLjRzMTAzLjgtMjMxLjQgMjMxLjQtMjMxLjQgMjMxLjQgMTAzLjggMjMxLjQgMjMxLjQtMTAzLjggMjMxLjQtMjMxLjQgMjMxLjR6IG0wLTM5My40Yy04O' +
  49. 'S4zIDAtMTYyIDcyLjctMTYyIDE2MnM3Mi43IDE2MiAxNjIgMTYyIDE2Mi03Mi43IDE2Mi0xNjItNzIuNy0xNjItMTYyLTE2MnpNNTEyLjEgMjI3LjFjLTE5LjIgMC0zNC43LT' +
  50. 'E1LjUtMzQuNy0zNC43Vjk4LjdjMC0xOS4yIDE1LjUtMzQuNyAzNC43LTM0LjcgMTkuMiAwIDM0LjcgMTUuNSAzNC43IDM0Ljd2OTMuN2MwIDE5LjEtMTUuNSAzNC43LTM0Ljc' +
  51. 'gMzQuN3pNMjg2IDMyMC43Yy04LjkgMC0xNy44LTMuNC0yNC41LTEwLjJsLTY2LjMtNjYuM2MtMTMuNi0xMy42LTEzLjYtMzUuNSAwLTQ5LjEgMTMuNS0xMy42IDM1LjUtMTMu' +
  52. 'NiA0OS4xIDBsNjYuMyA2Ni4zYzEzLjYgMTMuNiAxMy42IDM1LjUgMCA0OS4xYTM0LjY4IDM0LjY4IDAgMCAxLTI0LjYgMTAuMnpNMTkyLjQgNTQ2LjhIOTguN2MtMTkuMiAwL' +
  53. 'TM0LjctMTUuNS0zNC43LTM0LjcgMC0xOS4yIDE1LjUtMzQuNyAzNC43LTM0LjdoOTMuN2MxOS4yIDAgMzQuNyAxNS41IDM0LjcgMzQuNyAwIDE5LjEtMTUuNSAzNC43LTM0Lj' +
  54. 'cgMzQuN3pNMjE5LjggODM5LjFjLTguOSAwLTE3LjgtMy40LTI0LjUtMTAuMi0xMy42LTEzLjYtMTMuNi0zNS41IDAtNDkuMWw2Ni4zLTY2LjNjMTMuNS0xMy42IDM1LjUtMTM' +
  55. 'uNiA0OS4xIDAgMTMuNiAxMy42IDEzLjYgMzUuNSAwIDQ5LjFsLTY2LjMgNjYuM2MtNi45IDYuOC0xNS43IDEwLjItMjQuNiAxMC4yek01MTIuMSA5NjAuMmMtMTkuMiAwLTM0' +
  56. 'LjctMTUuNS0zNC43LTM0Ljd2LTkzLjdjMC0xOS4yIDE1LjUtMzQuNyAzNC43LTM0LjcgMTkuMiAwIDM0LjcgMTUuNSAzNC43IDM0Ljd2OTMuN2MwIDE5LjItMTUuNSAzNC43L' +
  57. 'TM0LjcgMzQuN3pNODA0LjQgODM5LjFjLTguOSAwLTE3LjgtMy40LTI0LjUtMTAuMmwtNjYuMy02Ni4zYy0xMy42LTEzLjYtMTMuNi0zNS41IDAtNDkuMSAxMy41LTEzLjYgMz' +
  58. 'UuNS0xMy42IDQ5LjEgMGw2Ni4zIDY2LjNjMTMuNiAxMy42IDEzLjYgMzUuNSAwIDQ5LjFhMzQuNjggMzQuNjggMCAwIDEtMjQuNiAxMC4yek05MjUuNSA1NDYuOGgtOTMuN2M' +
  59. 'tMTkuMiAwLTM0LjctMTUuNS0zNC43LTM0LjcgMC0xOS4yIDE1LjUtMzQuNyAzNC43LTM0LjdoOTMuN2MxOS4yIDAgMzQuNyAxNS41IDM0LjcgMzQuNyAwIDE5LjEtMTUuNSAz' +
  60. 'NC43LTM0LjcgMzQuN3pNNzM4LjIgMzIwLjdjLTguOSAwLTE3LjgtMy40LTI0LjUtMTAuMi0xMy42LTEzLjYtMTMuNi0zNS41IDAtNDkuMWw2Ni4zLTY2LjNjMTMuNS0xMy42I' +
  61. 'DM1LjUtMTMuNiA0OS4xIDAgMTMuNiAxMy42IDEzLjYgMzUuNSAwIDQ5LjFsLTY2LjMgNjYuM2MtNi45IDYuOC0xNS44IDEwLjItMjQuNiAxMC4yeiIgZmlsbD0iI2Y0ZWEyYS' +
  62. 'IgcC1pZD0iOTE2Ij48L3BhdGg+PC9zdmc+';
  63.  
  64. //夜间模式图标(base64)
  65. var dark = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDI' +
  66. 'CItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTkxNjAzODE3ODAwI' +
  67. 'iBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjExMDEiI' +
  68. 'HhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+QGZvb' +
  69. 'nQtZmFjZSB7IGZvbnQtZmFtaWx5OiBlbGVtZW50LWljb25zOyBzcmM6IHVybCgiY2hyb21lLWV4dGVuc2lvbjovL2JiYWtobm1ma2plbmZiaGpkZGRpcGNlZm5ocGlramJqL' +
  70. '2ZvbnRzL2VsZW1lbnQtaWNvbnMud29mZiIpIGZvcm1hdCgid29mZiIpLCB1cmwoImNocm9tZS1leHRlbnNpb246Ly9iYmFraG5tZmtqZW5mYmhqZGRkaXBjZWZuaHBpa2pia' +
  71. 'i9mb250cy9lbGVtZW50LWljb25zLnR0ZiAiKSBmb3JtYXQoInRydWV0eXBlIik7IH0KPC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTUwMy40IDk1OS4yYy0xNTYuMSAwLTMwM' +
  72. 'y4xLTgzLjItMzgzLjUtMjE3LjNsLTQ1LjgtNzYuMyA4Ny4yIDE3LjNjNDQgOC44IDg4LjkgOC42IDEzMy4yLTAuNkMzODIuNiA2NjQuNCA0NTguMyA2MTMgNTA3LjggNTM4Y' +
  73. 'zQ5LjUtNzUuMSA2Ni44LTE2NC45IDQ4LjctMjUzLTExLjgtNTcuMy0zOC40LTExMC43LTc2LjktMTU0LjRsLTU4LjctNjYuNyA4OC44IDEuMmMyNDMuMSAzLjQgNDQwLjggM' +
  74. 'jAzLjkgNDQwLjggNDQ3IDAgMjQ2LjUtMjAwLjYgNDQ3LjEtNDQ3LjEgNDQ3LjF6TTIzOC4zIDc2OC4xYzY4LjUgNzEuNCAxNjMgMTEyLjMgMjY1LjEgMTEyLjMgMjAzLjEgM' +
  75. 'CAzNjguMy0xNjUuMiAzNjguMy0zNjguMyAwLTE3MS42LTExOS42LTMxNy40LTI3OS44LTM1Ny40IDE5LjQgMzUuNyAzMy41IDc0LjMgNDEuOCAxMTQuNCA0Ni4xIDIyNC40L' +
  76. 'Tk4LjkgNDQ0LjQtMzIzLjMgNDkwLjUtMjQgNS00OCA3LjgtNzIuMSA4LjV6IiBmaWxsPSIjMDAwMDAwIiBwLWlkPSIxMTAyIj48L3BhdGg+PC9zdmc+';
  77.  
  78. //显示快捷键窗口
  79. var $hint = $('<div>' +
  80. ' <div>' +
  81. ' <div>' +
  82. ' <div class=\"Modal-wrapper Modal-enter-done\">' +
  83. ' <div class=\"Modal-backdrop\"></div>' +
  84. ' <div class=\"Modal Modal--default ShortcutHintModal\" tabindex=\"0\">' +
  85. ' <div class=\"Modal-inner\">' +
  86. ' <h3 class=\"Modal-title\">快捷键帮助</h3>' +
  87. ' <div class=\"Modal-content\">' +
  88. ' <div class=\"ShortcutHintModal-content\">' +
  89. ' <div class=\"ShortcutHintModal-hintListContainer\">' +
  90. ' <div class=\"ShortcutHintModal-hintList\">' +
  91. ' <div class=\"ShortcutHintModal-hintTitle\">' +
  92. ' 操作' +
  93. ' </div>' +
  94. ' <div class=\"KeyHint\">' +
  95. ' <div class=\"KeyHint-keyContainer\">' +
  96. ' <div class=\"KeyHint-key\">' +
  97. ' <kbd class=\"KeyHint-kbd\">V</kbd>' +
  98. ' </div>' +
  99. ' </div>' +
  100. ' <div>' +
  101. ' :赞同' +
  102. ' </div>' +
  103. ' </div>' +
  104. ' <div class=\"KeyHint\">' +
  105. ' <div class=\"KeyHint-keyContainer\">' +
  106. ' <div class=\"KeyHint-key\">' +
  107. ' <kbd class=\"KeyHint-kbd\">D</kbd>' +
  108. ' </div>' +
  109. ' </div>' +
  110. ' <div>' +
  111. ' :反对' +
  112. ' </div>' +
  113. ' </div>' +
  114. ' <div class=\"KeyHint\">' +
  115. ' <div class=\"KeyHint-keyContainer\">' +
  116. ' <div class=\"KeyHint-key\">' +
  117. ' <kbd class=\"KeyHint-kbd\">L</kbd>' +
  118. ' </div>' +
  119. ' </div>' +
  120. ' <div>' +
  121. ' :喜欢' +
  122. ' </div>' +
  123. ' </div>' +
  124. ' <div class=\"KeyHint\">' +
  125. ' <div class=\"KeyHint-keyContainer\">' +
  126. ' <div class=\"KeyHint-key\">' +
  127. ' <kbd class=\"KeyHint-kbd\">C</kbd>' +
  128. ' </div>' +
  129. ' </div>' +
  130. ' <div>' +
  131. ' :展开 / 收起评论' +
  132. ' </div>' +
  133. ' </div>' +
  134. ' <div class=\"KeyHint\">' +
  135. ' <div class=\"KeyHint-keyContainer\">' +
  136. ' <div class=\"KeyHint-key\">' +
  137. ' <kbd class=\"KeyHint-kbd\">Shift</kbd>' +
  138. ' <div class=\"KeyHint-separator\">' +
  139. ' +' +
  140. ' </div>' +
  141. ' </div>' +
  142. ' <div class=\"KeyHint-key\">' +
  143. ' <kbd class=\"KeyHint-kbd\">C</kbd>' +
  144. ' </div>' +
  145. ' </div>' +
  146. ' <div>' +
  147. ' :聚焦到评论框' +
  148. ' </div>' +
  149. ' </div>' +
  150. ' <div class=\"KeyHint\">' +
  151. ' <div class=\"KeyHint-keyContainer\">' +
  152. ' <div class=\"KeyHint-key\">' +
  153. ' <kbd class=\"KeyHint-kbd\">O</kbd>' +
  154. ' </div>' +
  155. ' </div>' +
  156. ' <div>' +
  157. ' :展开 / 收起全文' +
  158. ' </div>' +
  159. ' </div>' +
  160. ' <div class=\"KeyHint\">' +
  161. ' <div class=\"KeyHint-keyContainer\">' +
  162. ' <div class=\"KeyHint-key\">' +
  163. ' <kbd class=\"KeyHint-kbd\">S</kbd>' +
  164. ' <div class=\"KeyHint-separator KeyHint-separator--space\"> ' +
  165. ' </div>' +
  166. ' </div>' +
  167. ' <div class=\"KeyHint-key\">' +
  168. ' <kbd class=\"KeyHint-kbd\">C</kbd>' +
  169. ' </div>' +
  170. ' </div>' +
  171. ' <div>' +
  172. ' :收藏' +
  173. ' </div>' +
  174. ' </div>' +
  175. ' <div class=\"KeyHint\">' +
  176. ' <div class=\"KeyHint-keyContainer\">' +
  177. ' <div class=\"KeyHint-key\">' +
  178. ' <kbd class=\"KeyHint-kbd\">F</kbd>' +
  179. ' <div class=\"KeyHint-separator KeyHint-separator--space\"> ' +
  180. ' </div>' +
  181. ' </div>' +
  182. ' <div class=\"KeyHint-key\">' +
  183. ' <kbd class=\"KeyHint-kbd\">X</kbd>' +
  184. ' </div>' +
  185. ' </div>' +
  186. ' <div>' +
  187. ' :分享' +
  188. ' </div>' +
  189. ' </div>' +
  190. ' </div>' +
  191. ' <div class=\"ShortcutHintModal-hintList\">' +
  192. ' <div class=\"ShortcutHintModal-hintTitle\">' +
  193. ' 导航' +
  194. ' </div>' +
  195. ' <div class=\"KeyHint\">' +
  196. ' <div class=\"KeyHint-keyContainer\">' +
  197. ' <div class=\"KeyHint-key\">' +
  198. ' <kbd class=\"KeyHint-kbd\">J</kbd>' +
  199. ' </div>' +
  200. ' </div>' +
  201. ' <div>' +
  202. ' :下一项' +
  203. ' </div>' +
  204. ' </div>' +
  205. ' <div class=\"KeyHint\">' +
  206. ' <div class=\"KeyHint-keyContainer\">' +
  207. ' <div class=\"KeyHint-key\">' +
  208. ' <kbd class=\"KeyHint-kbd\">K</kbd>' +
  209. ' </div>' +
  210. ' </div>' +
  211. ' <div>' +
  212. ' :上一项' +
  213. ' </div>' +
  214. ' </div>' +
  215. ' <div class=\"KeyHint\">' +
  216. ' <div class=\"KeyHint-keyContainer\">' +
  217. ' <div class=\"KeyHint-key\">' +
  218. ' <kbd class=\"KeyHint-kbd\">G</kbd>' +
  219. ' <div class=\"KeyHint-separator KeyHint-separator--space\"> ' +
  220. ' </div>' +
  221. ' </div>' +
  222. ' <div class=\"KeyHint-key\">' +
  223. ' <kbd class=\"KeyHint-kbd\">G</kbd>' +
  224. ' </div>' +
  225. ' </div>' +
  226. ' <div>' +
  227. ' :第一项' +
  228. ' </div>' +
  229. ' </div>' +
  230. ' <div class=\"KeyHint\">' +
  231. ' <div class=\"KeyHint-keyContainer\">' +
  232. ' <div class=\"KeyHint-key\">' +
  233. ' <kbd class=\"KeyHint-kbd\">Shift</kbd>' +
  234. ' <div class=\"KeyHint-separator\">' +
  235. ' +' +
  236. ' </div>' +
  237. ' </div>' +
  238. ' <div class=\"KeyHint-key\">' +
  239. ' <kbd class=\"KeyHint-kbd\">G</kbd>' +
  240. ' </div>' +
  241. ' </div>' +
  242. ' <div>' +
  243. ' :最后一项' +
  244. ' </div>' +
  245. ' </div>' +
  246. ' <div class=\"KeyHint\">' +
  247. ' <div class=\"KeyHint-keyContainer\">' +
  248. ' <div class=\"KeyHint-key\">' +
  249. ' <kbd class=\"KeyHint-kbd\">Shift</kbd>' +
  250. ' <div class=\"KeyHint-separator\">' +
  251. ' +' +
  252. ' </div>' +
  253. ' </div>' +
  254. ' <div class=\"KeyHint-key\">' +
  255. ' <kbd class=\"KeyHint-kbd\">U</kbd>' +
  256. ' </div>' +
  257. ' </div>' +
  258. ' <div>' +
  259. ' :向上滚动半屏' +
  260. ' </div>' +
  261. ' </div>' +
  262. ' <div class=\"KeyHint\">' +
  263. ' <div class=\"KeyHint-keyContainer\">' +
  264. ' <div class=\"KeyHint-key\">' +
  265. ' <kbd class=\"KeyHint-kbd\">Shift</kbd>' +
  266. ' <div class=\"KeyHint-separator\">' +
  267. ' +' +
  268. ' </div>' +
  269. ' </div>' +
  270. ' <div class=\"KeyHint-key\">' +
  271. ' <kbd class=\"KeyHint-kbd\">D</kbd>' +
  272. ' </div>' +
  273. ' </div>' +
  274. ' <div>' +
  275. ' :向下滚动半屏' +
  276. ' </div>' +
  277. ' </div>' +
  278. ' <div class=\"KeyHint\">' +
  279. ' <div class=\"KeyHint-keyContainer\">' +
  280. ' <div class=\"KeyHint-key\">' +
  281. ' <kbd class=\"KeyHint-kbd\">/</kbd>' +
  282. ' </div>' +
  283. ' </div>' +
  284. ' <div>' +
  285. ' :搜索' +
  286. ' </div>' +
  287. ' </div>' +
  288. ' <div class=\"KeyHint\">' +
  289. ' <div class=\"KeyHint-keyContainer\">' +
  290. ' <div class=\"KeyHint-key\">' +
  291. ' <kbd class=\"KeyHint-kbd\">?</kbd>' +
  292. ' </div>' +
  293. ' </div>' +
  294. ' <div>' +
  295. ' :快捷键帮助' +
  296. ' </div>' +
  297. ' </div>' +
  298. ' </div>' +
  299. ' </div>' +
  300. ' </div>' +
  301. ' </div>' +
  302. ' </div>' +
  303. ' <button aria-label=\"关闭\" type=\"button\" class=\"Button Modal-closeButton Button--plain\">' +
  304. ' <svg class=\"Zi Zi--Close Modal-closeIcon\" fill=\"currentColor\" viewbox=\"0 0 24 24\" width=\"24\" height=\"24\">' +
  305. ' <path d=\"M13.486 12l5.208-5.207a1.048 1.048 0 0 0-.006-1.483 1.046 1.046 0 0 0-1.482-.005L12 10.514 6.793 5.305a1.048 1.048 0 0 0-1.483.005 1.046 1.046 0 0 0-.005 1.483L10.514 12l-5.208 5.207a1.048 1.048 0 0 0 .006 1.483 1.046 1.046 0 0 0 1.482.005L12 13.486l5.207 5.208a1.048 1.048 0 0 0 1.483-.006 1.046 1.046 0 0 0 .005-1.482L13.486 12z\" fill-rule=\"evenodd\"></path>' +
  306. ' </svg></button>' +
  307. ' </div>' +
  308. ' </div>' +
  309. ' </div>' +
  310. ' </div>' +
  311. '</div>');
  312.  
  313.  
  314. //添加"匿名"按钮
  315. function addAnonymous ($QuestionHeaderActions, $more) {
  316. var a = '<button type=\"button\" class=\"Button Button--plain Button--withIcon Button--withLabel\">' +
  317. '<span style=\"display: inline-flex; align-items: center; vertical-align:middle;\">' +
  318. '<svg class=\"Zi Zi--Anonymous Button-zi\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\" width=\"1.2em\" height=\"1.2em\">' +
  319. '<path d=\"M831.994 442.66v436.364c0 24.906 7.312 45.124 42.654 45.124 35.344 0 42.656-20.218 42.656-45.124V442.66h-85.31z\"></path>' +
  320. '<path d=\"M895.992 582.814c0 11.78 9.532 21.342 21.312 21.342v-42.654a21.3 21.3 0 0 0-21.312 21.312zM895.992 668.156c0 11.78 9.532 21.342 21.312 21.342v-42.686c-11.78 0-21.312 9.564-21.312 21.344zM895.992 753.496a21.3 21.3 0 0 0 21.312 21.312v-42.656c-11.78 0-21.312 9.562-21.312 21.344zM895.992 838.806c0 11.812 9.532 21.344 21.312 21.344v-42.654c-11.78 0-21.312 9.562-21.312 21.31zM853.306 582.814c0 11.78-9.532 21.342-21.312 21.342v-42.654a21.3 21.3 0 0 1 21.312 21.312zM853.306 668.156c0 11.78-9.532 21.342-21.312 21.342v-42.686c11.782 0 21.312 9.564 21.312 21.344zM853.306 753.496a21.3 21.3 0 0 1-21.312 21.312v-42.656c11.782 0 21.312 9.562 21.312 21.344zM853.306 838.806c0 11.812-9.532 21.344-21.312 21.344v-42.654c11.782 0 21.312 9.562 21.312 21.31z\"></path><path d=\"M831.994 590.688c26.25-14.124 56.592-34.404 85.31-62.402V442.66h-85.31v148.028z\"></path>' +
  321. '<path d=\"M1021.52 168.916c-15.532-160.26-413.238 8.594-509.516 8.594S17.986 8.656 2.486 168.916c-29.436 303.68 212.838 396.178 254.65 405.772 147.84 33.904 201.15-48.044 254.868-48.044 53.686 0 107.028 81.95 254.836 48.044 41.812-9.592 284.086-102.092 254.68-405.772zM392.85 399.318c-23.624 8.328-52.154 12.906-80.342 12.906-24.78 0-47.904-3.594-66.904-10.39-18.75-6.718-32.812-16.204-41.842-28.202-14.75-19.67-16.906-48.578-6.436-85.95 2.5-1.156 9.342-3.532 23.592-3.532 36.062 0 88.216 15.03 132.84 38.28 44.75 23.312 66.342 46.624 71.81 59.25-3.97 3.904-13.844 10.982-32.718 17.638z m427.364-25.688c-9 12-23.094 21.484-41.844 28.202-18.968 6.796-42.124 10.39-66.874 10.39-28.218 0-56.748-4.578-80.342-12.906-18.906-6.656-28.75-13.734-32.75-17.64 5.468-12.624 27.062-35.936 71.812-59.25 44.622-23.25 96.778-38.28 132.872-38.28 14.25 0 21.06 2.376 23.56 3.532 10.502 37.376 8.314 66.282-6.434 85.952z\" ></path>' +
  322. '<path d=\"M867.71 276.15a42.61 42.61 0 0 0-22.998-27.124c-10.718-5-24.716-7.546-41.624-7.546-43.094 0-101.56 16.516-152.59 43.11-46.406 24.186-79.688 53.404-91.248 80.154a42.642 42.642 0 0 0 9.342 47.466c7.532 7.344 22.032 18.062 48.376 27.342 28.032 9.89 61.592 15.344 94.53 15.344 29.592 0 57.716-4.468 81.28-12.89 26.75-9.578 47.436-23.968 61.56-42.764 12.31-16.406 19.404-36.186 21.124-58.764 1.436-19.284-1.158-40.938-7.752-64.328z m-47.496 97.48c-9 12-23.094 21.484-41.844 28.202-18.968 6.796-42.124 10.39-66.874 10.39-28.218 0-56.748-4.578-80.342-12.906-18.906-6.656-28.75-13.734-32.75-17.64 5.468-12.624 27.062-35.936 71.812-59.25 44.622-23.25 96.778-38.28 132.872-38.28 14.25 0 21.06 2.376 23.56 3.532 10.502 37.376 8.314 66.282-6.434 85.952zM464.722 364.742c-11.562-26.75-44.81-55.968-91.248-80.154-51.03-26.594-109.498-43.11-152.558-43.11-16.906 0-30.906 2.532-41.624 7.532a42.69 42.69 0 0 0-23.03 27.14c-6.562 23.39-9.156 45.044-7.718 64.326 1.688 22.578 8.782 42.358 21.092 58.764 14.124 18.796 34.842 33.188 61.592 42.764 23.562 8.422 51.654 12.89 81.278 12.89 32.906 0 66.468-5.454 94.53-15.344 26.312-9.28 40.812-20 48.342-27.342a42.638 42.638 0 0 0 9.344-47.466z m-71.872 34.576c-23.624 8.328-52.154 12.906-80.342 12.906-24.78 0-47.904-3.594-66.904-10.39-18.75-6.718-32.812-16.204-41.842-28.202-14.75-19.67-16.906-48.578-6.436-85.95 2.5-1.156 9.342-3.532 23.592-3.532 36.062 0 88.216 15.03 132.84 38.28 44.75 23.312 66.342 46.624 71.81 59.25-3.97 3.904-13.844 10.982-32.718 17.638z\"></path>' +
  323. '</svg></span> 匿名</button>';
  324. var $anonymous = $(a);
  325. $anonymous.bind("click", function () {
  326. $more.find("button").click();
  327. $(".Menu.QuestionHeader-menu").children().eq(0).click();
  328. });
  329. $QuestionHeaderActions.append($anonymous);
  330. }
  331.  
  332. //添加"问题日志"按钮
  333. function addLog ($QuestionHeaderActions) {
  334. var url = window.location.href;
  335. var end, href;
  336. if (url.indexOf("?") > -1) {
  337. end = url.indexOf("?");
  338. url = url.substring(0, end);
  339. }
  340.  
  341. if (url.indexOf("answer") > -1) {
  342. end = url.indexOf("answer");
  343. href = url.substring(0, end);
  344. }
  345. else {
  346. href = url + "/";
  347. }
  348. var L = '<button type=\"button\" class=\"Button Button--plain Button--withIcon Button--withLabel\"><a href=\"' + href + 'log\" target=\"_self\"><span style=\"display: inline-flex; align-items: center; vertical-align:middle;\"><svg class=\"Zi Zi--Log Button-zi\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\" width=\"1.2em\" height=\"1.2em\"><path d=\"M733.129568 1.700997H1.700997v1020.598006h1020.598006v-765.448505z m204.119601 935.548172h-850.498338v-850.498338h614.910299l235.588039 206.671096z\"></path><path d=\"M170.099668 171.800664h279.813953v85.049834H170.099668zM170.099668 372.518272h683.800664v85.049834H170.099668zM170.099668 567.282392h683.800664v85.049834H170.099668zM170.099668 762.046512h683.800664v85.049834H170.099668z\"></path></svg></span>问题日志</a></button>';
  349. var $log = $(L);
  350. $QuestionHeaderActions.append($log);
  351. }
  352.  
  353. //添加"快捷键"按钮
  354. function addShortCut ($QuestionHeaderActions) {
  355. var s = '<button type=\"button\" class=\"Button Button--plain Button--withIcon Button--withLabel\"><span style=\"display: inline-flex; align-items: center; vertical-align:middle;\"><svg class=\"Zi Zi--ShortCut Button-zi\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\" width=\"1.5em\" height=\"1.2em\"><path d=\"M1088 128H64C28.8 128 0 156.8 0 192v640c0 35.2 28.8 64 64 64h1024c35.2 0 64-28.8 64-64V192c0-35.2-28.8-64-64-64zM640 256h128v128h-128V256z m192 192v128h-128v-128h128zM448 256h128v128h-128V256z m192 192v128h-128v-128h128zM256 256h128v128H256V256z m192 192v128h-128v-128h128zM128 256h64v128H128V256z m0 192h128v128H128v-128z m64 320H128v-128h64v128z m576 0H256v-128h512v128z m256 0h-192v-128h192v128z m0-192h-128v-128h128v128z m0-192h-192V256h192v128z\"></path></svg></span> 快捷键</button>';
  356. var $shortcut = $(s);
  357. $shortcut.css({ "margin-left": "10px" });
  358. $shortcut.click(function () {
  359. $(".Modal-wrapper").show();
  360. });
  361. $QuestionHeaderActions.append($shortcut);
  362.  
  363. }
  364.  
  365. //UTC标准时转UTC+8北京时间
  366. function getUTC8 (datetime) {
  367. let month = (datetime.getMonth() + 1) < 10 ? "0" + (datetime.getMonth() + 1) : (datetime.getMonth() + 1);
  368. let date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  369. let hours = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  370. let minutes = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  371. let seconds = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  372. return (datetime.getFullYear() + "-" + month + "-" + date + "\xa0\xa0" + hours + ":" + minutes + ":" + seconds);
  373. }
  374.  
  375.  
  376. //回答页
  377. function question () {
  378. if (hideQuestionSidebar == 1) //隐藏侧边栏并拉宽内容
  379. {
  380. $(".Question-sideColumn.Question-sideColumn--sticky").hide();
  381. if ($(".ListShortcut").length > 0) {
  382. $(".ListShortcut").width($(".Question-main").width());
  383. $(".Question-mainColumn").width($(".ListShortcut").width());
  384. $(".ContentItem-actions").width($(".Question-mainColumn").width() - 40); //每个回答的的margin-left + margin-right=40px,减去才能正好居中
  385.  
  386. }
  387. else {
  388. $(".Question-mainColumn").width($(".Question-main").width());
  389. $(".ContentItem-actions").width($(".Question-mainColumn").width() - 40); //每个回答的的margin-left + margin-right=40px,减去才能正好居中
  390. }
  391. }
  392. else if (hideQuestionSidebar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  393. {
  394. $(".Question-sideColumn.Question-sideColumn--sticky").hide();
  395.  
  396. $(".Question-main").attr("style", "display:flex;justify-content:center;");
  397. $(".ContentItem-actions").width($(".Question-mainColumn").width() - 40); //每个回答的的margin-left + margin-right=40px,减去才能正好居中
  398. }
  399.  
  400. //首页顶部导航栏"等你来答"页
  401. if (window.location.href.indexOf("waiting") > -1) {
  402. if (hideIndexSidebar == 1) //隐藏侧边栏并拉宽内容
  403. {
  404. $(".GlobalSideBar").hide();
  405. $(".QuestionWaiting-mainColumn").width($(".QuestionWaiting").width());
  406. }
  407. else if (hideIndexSidebar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  408. {
  409. $(".GlobalSideBar").hide();
  410. $(".QuestionWaiting").attr("style", "display:flex;justify-content:center;");
  411. }
  412. }
  413.  
  414. //稍后答功能
  415. if (hideLaterSideBar == 1) //隐藏侧边栏并拉宽内容
  416. {
  417. $(".GlobalSideBar").hide();
  418. $(".QuestionLater-mainColumn").width($(".QuestionLater").width());
  419. }
  420. else if (hideLaterSideBar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  421. {
  422. $(".GlobalSideBar").hide();
  423. $(".QuestionLater").attr("style", "display:flex;justify-content:center;");
  424. }
  425.  
  426. //问题编辑时间参考:https://gf.qytechs.cn/zh-CN/scripts/398195
  427. if ($(".QuestionPage .QuestionHeader-side p").length == 0 && window.location.href.indexOf("log") == -1) //非问题日志页
  428. {
  429. let createtime = $(".QuestionPage>[itemprop~=dateCreated]").attr("content");
  430. let modifiedtime = $(".QuestionPage>[itemprop~=dateModified]").attr("content");
  431. createtime = getUTC8(new Date(createtime));
  432. modifiedtime = getUTC8(new Date(modifiedtime));
  433.  
  434. $(".QuestionPage .QuestionHeader-side").append('<div style=\"color:#8590a6; margin-top:15px\"><p>创建时间:&nbsp;&nbsp;' + createtime + '</p><p>最后编辑:&nbsp;&nbsp;' + modifiedtime + '</p></div>');
  435. }
  436.  
  437. //快捷键提示框
  438. if ($(".Modal-wrapper").length == 0) {
  439. $(document.body).append($hint);
  440. $(".Modal-wrapper").hide();
  441. $(".Modal-closeButton").click(function () {
  442. $(".Modal-wrapper").hide();
  443. });
  444. }
  445.  
  446. //问题标题
  447. var $QuestionHeaderActions = $("div.QuestionHeaderActions");
  448.  
  449. var $titlemore = $QuestionHeaderActions.find(".Zi--Dots").parent().parent().parent(); //更多
  450. var $titlereport = $QuestionHeaderActions.find(".Title.Zi--Report"); //举报
  451. var $anonymous = $(".Zi--Anonymous");//匿名
  452. var $log = $(".Zi--Log"); //日志
  453. var $shortcut = $(".Zi--ShortCut"); //快捷键
  454.  
  455. if ($(".AppHeader-profileAvatar").length > 0) //已登录(不可用)
  456. {
  457. if ($titlereport.length == 0) //题目未添加举报
  458. {
  459. $titlemore.hide();
  460. let button_text = '<button type=\"button\" class=\"Button Button--plain Button--withIcon Button--withLabel\"><span style=\"display: inline-flex; align-items: center; vertical-align:middle;\"><svg class=\"Title Zi--Report \" fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z\" fill-rule=\"evenodd\"></path></svg></span> 举报</button>';
  461. let $report = $(button_text);
  462. $report.bind("click", function () {
  463. $titlemore.find("button").click();
  464. $(".Menu.QuestionHeader-menu").children().eq(2).click();
  465. });
  466. $titlemore.after($report);
  467. }
  468. if ($anonymous.length == 0) //未添加匿名
  469. {
  470. addAnonymous($QuestionHeaderActions, $titlemore);
  471. }
  472. if ($log.length == 0) //未添加查看问题日志
  473. {
  474. addLog($QuestionHeaderActions);
  475. }
  476. if ($shortcut.length == 0) //未添加快捷键帮助
  477. {
  478. addShortCut($QuestionHeaderActions);
  479. }
  480.  
  481. //回答举报按钮
  482. $(".ContentItem-actions").each(function () {
  483.  
  484. if ($(this).find(".Zi--Report").length == 0 && $(this).find(".Zi--Settings").length == 0) //未添加举报 且 不是自己的回答
  485. {
  486. let $question_dot = $(this).find(".Zi--Dots").closest(".ContentItem-action");
  487. $question_dot.hide();
  488. let button_text = '<button type=\"button\" class=\"Button ContentItem-action Button--plain Button--withIcon Button--withLabel\"><span style=\"display: inline-flex; align-items: center;\"><svg class=\"Zi Zi--Report\" fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z\" fill-rule=\"evenodd\"></path></svg></span> 举报</button>';
  489. let $report = $(button_text);
  490. $report.bind("click", function () {
  491. $question_dot.find("button").click();
  492. $(".Menu.AnswerItem-selfMenu").find("button").each(function () {
  493. if ($(this).text().indexOf("举报") > -1)
  494. $(this).click();
  495. });
  496. });
  497. $question_dot.after($report);
  498. }
  499. else
  500. {
  501. $(this).find(".Zi--Dots").closest(".ContentItem-action").hide();
  502. }
  503. });
  504.  
  505. }
  506. else //未登录(不可用)
  507. {
  508. $(".Zi--Dots").parent().parent().parent().hide();
  509.  
  510. $log = $(".Zi--Log"); //日志
  511. $shortcut = $(".Zi--ShortCut"); //快捷键
  512.  
  513. if ($log.length == 0) //未添加查看问题日志
  514. {
  515. addLog($QuestionHeaderActions);
  516. }
  517. if ($shortcut.length == 0) //未添加快捷键帮助
  518. {
  519. addShortCut($QuestionHeaderActions);
  520. }
  521. }
  522.  
  523. //调整问题的按钮间距
  524. $(".QuestionHeaderActions .QuestionHeader-Comment").css({ "margin": "0px 0px 0px 0px" });
  525. $(".QuestionHeaderActions .Popover.ShareMenu").css({ "margin": "0px 0px 0px 0px" });
  526. $(".QuestionHeaderActions .Button.Button--plain.Button--withIcon.Button--withLabel").css({ "margin": "0px 0px 0px 9px" });
  527.  
  528. var $QuestionButtonGroup = $(".QuestionHeader-footer-main").find(".QuestionButtonGroup");
  529. $QuestionButtonGroup.children().eq(0).css({ "margin": "0px 0px 0px 8px" });
  530. $QuestionButtonGroup.children().eq(1).css({ "margin": "0px 0px 0px 8px" });
  531.  
  532. $(".QuestionHeaderActions").children().eq(0).css({ "margin": "0px 8px 0px 0px" });
  533.  
  534. $(".GoodQuestionAction-commonBtn").css("margin", "0px 0px 0px 0px");
  535.  
  536.  
  537. //回答的发布时间
  538. $(".ContentItem.AnswerItem").each(function () {
  539. if (!($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length > 0 && $(this).find(".ContentItem-time").find("span").text() != null) {
  540. if ($(this).find(".ContentItem-time").text().indexOf("发布于") == -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip
  541. {
  542. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  543. var oldtext = $(this).find(".ContentItem-time").find("span").text();
  544. $(this).find(".ContentItem-time").find("span").text(data_tooltip + "\xa0\xa0,\xa0\xa0" + oldtext);
  545. $(this).find(".ContentItem-time").addClass("full");
  546. }
  547. else if ($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip
  548. {
  549. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  550. $(this).find(".ContentItem-time").find("span").text(data_tooltip);
  551. $(this).find(".ContentItem-time").addClass("full");
  552. }
  553.  
  554. //发布时间置顶
  555. if (publishTop == 1) {
  556. if (!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) {
  557. let temp_time = $(this).find(".ContentItem-time").clone();
  558. $(this).find(".RichContent .ContentItem-time").hide();
  559. $(this).find(".ContentItem-meta").append(temp_time);
  560. }
  561. }
  562. }
  563.  
  564. });
  565.  
  566. $(".Pc-card.Card").attr("style", "display:none");
  567.  
  568. //查看全部回答按钮变色
  569. $(".QuestionMainAction").attr("style", "color:white;background-color:#0084FF");
  570.  
  571. }
  572.  
  573.  
  574. //知乎跳转链接转为直链
  575. function directLink () {
  576. var equal, colon, external_href, protocol, path, new_href;
  577. //文字链接
  578. $("a[class*=\'external\']").each(function () {
  579. if ($(this).find("span").length > 0) {
  580. new_href = $(this).text();
  581. $(this).attr("href", new_href);
  582. }
  583. else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) {
  584. external_href = $(this).attr("href");
  585. new_href = external_href.substring($(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length);
  586. $(this).attr("href", decodeURIComponent(new_href));
  587. }
  588. else {
  589. external_href = $(this).attr("href");
  590. if (external_href.lastIndexOf("https%3A"))
  591. new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A"));
  592. else if (external_href.lastIndexOf("http%3A%2F%2F"))
  593. new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A"));
  594. $(this).attr("href", decodeURIComponent(new_href));
  595. }
  596. });
  597.  
  598. //卡片链接
  599. $("a[class*=\'LinkCard\']:not([class*=\'MCNLinkCard\']):not([class*=\'ZVideoLinkCard\'])").each(function () {
  600. if ($(this).find("LinkCard-title").length > 0 && $(this).find("LinkCard-title").indexOf("http") > -1) {
  601. new_href = $(this).find("LinkCard-title").text();
  602. $(this).attr("href", new_href);
  603. }
  604. else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) {
  605. external_href = $(this).attr("href");
  606. new_href = external_href.substring($(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length);
  607. $(this).attr("href", decodeURIComponent(new_href));
  608. }
  609. else {
  610. external_href = $(this).attr("href");
  611. if (external_href.lastIndexOf("https%3A"))
  612. new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A"));
  613. else if (external_href.lastIndexOf("http%3A%2F%2F"))
  614. new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A"));
  615. $(this).attr("href", decodeURIComponent(new_href));
  616. }
  617. });
  618.  
  619. //旧版视频卡片链接
  620. $("a.VideoCard-link").each(function () {
  621. if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) {
  622. external_href = $(this).attr("href");
  623. equal = external_href.lastIndexOf("http");
  624. colon = external_href.lastIndexOf("%3A");
  625. protocol = external_href.substring(equal, colon);
  626. path = external_href.substring(colon + 5, external_href.length);
  627. new_href = protocol + "://" + path;
  628. $(this).attr("href", decodeURIComponent(new_href));
  629. }
  630. });
  631.  
  632. //隐藏首页广告卡片
  633. $(".TopstoryItem--advertCard").hide();
  634.  
  635. }
  636.  
  637. var upload_video_main_flag=0;
  638.  
  639. //知乎专栏
  640. function zhuanlan () {
  641. //隐藏推荐文章
  642. if(hideRecommendedReading == 1)
  643. {
  644. $(".Recommendations-Main").hide();
  645. }
  646.  
  647. //专栏举报按钮
  648. if ($(".Zi--Report").length == 0) //未添加举报
  649. {
  650. let $lastchild = $(".ContentItem-actions").children().eq(-1);
  651. if ($lastchild.find(".Zi--Dots").length > 0)
  652. $lastchild.hide();
  653. var button_text = '<button type=\"button\" class=\"Button ContentItem-action Button--plain\"><span style=\"display: inline-flex; align-items: center;\"><svg class=\"Zi Zi--Report\" fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z\" fill-rule=\"evenodd\"></path></svg></span> 举报</button>';
  654. var $report = $(button_text);
  655. $report.bind("click", function () {
  656. $lastchild.find("button").click();
  657. $(".Menu.Post-ActionMenu").find("button").click();
  658. });
  659. $lastchild.after($report);
  660. }
  661.  
  662. //有"编辑于"时,增加发布时间
  663. if ($(".ContentItem-time").text().indexOf("编辑于") > -1 && !$(".ContentItem-time").hasClass("done")) {
  664. let bianjiyu = $(".ContentItem-time").text();
  665. $(".ContentItem-time").click();
  666. $(".ContentItem-time").text($(".ContentItem-time").text() + "\xa0\xa0,\xa0\xa0" + bianjiyu);
  667. $(".ContentItem-time").addClass("done");
  668. }
  669.  
  670. //发布时间置顶
  671. if (publishTop == 1 && $(".Post-Header").find(".ContentItem-time").length == 0) {
  672. $(".ContentItem-time").css({ "padding": "0px 0px 0px 0px", "margin-top": "14px" });
  673. $(".ContentItem-time").appendTo($(".Post-Header"));
  674. }
  675.  
  676. //专栏设置的已选菜单项变色
  677. $(".css-17px4ve").parent().each(function () {
  678. if ($(this).find(".css-17px4ve").children().length > 0) {
  679. $(this).css("color", "black");
  680. $(this).find(".Zi--Check").attr("fill", "black");
  681. }
  682. });
  683.  
  684. }
  685.  
  686. //视频页
  687. function zvideo () {
  688. //隐藏推荐视频
  689. $(".ZVideo-sideColumn").hide();
  690. }
  691.  
  692. //知乎圈子
  693. function club () {
  694. if (hideClubSideBar == 1) //隐藏侧边栏并拉宽内容
  695. {
  696. $(".ClubSideBar").hide();
  697. $(".Club-mainColumn").width($(".Club-container").width());
  698. $(".ClubEdit").width($(".Club-mainColumn").width() - 40);//每个提问的的margin-left + margin-right=40px,减去才能正好居中
  699. $('.ClubTopPosts').width($(".Club-mainColumn").width()-32);
  700. $('.ClubPostList').width($(".Club-mainColumn").width());
  701. $('.PostItem.css-1b27c42').width($(".Club-mainColumn").width() - 32);
  702. $('section').css('border-right','none');
  703. }
  704. else if (hideClubSideBar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  705. {
  706. $(".ClubSideBar").hide();
  707. $(".Club-mainColumn").parent().attr("style", "display:flex;justify-content:center;");
  708. $(".ClubEdit").width($(".Club-mainColumn").width() - 40); //每个提问的的margin-left + margin-right=40px,减去才能正好居中
  709. $('.ClubTopPosts').width($(".Club-mainColumn").width()-32);
  710. $('.ClubPostList').width($(".Club-mainColumn").width());
  711. $('.PostItem.css-1b27c42').width($(".Club-mainColumn").width() - 32);
  712. $('section').css('border-right','none');
  713. }
  714.  
  715. //退出圈子按钮
  716. var $ClubHeaderInfo_buttonGroup = $(".ClubHeaderInfo-buttonGroup");
  717. var $child1 = $ClubHeaderInfo_buttonGroup.children().eq(1 - 1);
  718. var $child2 = $ClubHeaderInfo_buttonGroup.children().eq(2 - 1);
  719. if ($child2.length > 0 && $child2.text().indexOf("签到") > -1 && $child2.text().indexOf("加入") == -1) //退出圈子
  720. {
  721. $child1.hide();
  722. let button_text = '<button class=\"ClubJoinOrCheckinButton\" style=\"margin-right:20px\"><img src=\"https://gitee.com/AN_drew/picBed/raw/master/img/exit.svg\"/><span style=\"color:red\">&nbsp;退出圈子</span></button>';
  723. let $report = $(button_text);
  724. $report.bind("click", function () {
  725. $child1.find("button").click();
  726. $(".ClubHeaderInfoMoreButton-item").click();
  727. });
  728. $child1.after($report);
  729. }
  730.  
  731. //圈子中提问举报按钮
  732. $(".PostReaction").each(function () {
  733. var $post_dot = $(this).find(".Zi--Dots").closest(".Popover");
  734. if ($(this).find(".Zi--Report").length == 0) //未添加举报
  735. {
  736. $post_dot.hide();
  737. let button_text = '<button type=\"button\" class=\"Button PostWebActionButtons-comment Button--plain Button--withIcon Button--withLabel\"><span style=\"display: inline-flex; align-items: center;\"><svg class=\"Zi Zi--Report\" fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z\" fill-rule=\"evenodd\"></path></svg></span> 举报</button>';
  738. let $report = $(button_text);
  739. $report.bind("click", function () {
  740. $post_dot.find("button").click();
  741. $(".PostWebActionButtons-item").click();
  742. });
  743. $post_dot.after($report);
  744. }
  745. });
  746.  
  747. //有"最后回复"时,增加发布时间
  748. $(".PostItem-time").each(function () {
  749.  
  750. if ($(this).text().indexOf("发布时间") == -1 && $(this).parent().text().indexOf("最后回复") > -1) {
  751. let datetime = new Date($(this).attr("datetime"));
  752. let posttime = getUTC8(datetime);
  753. let replytime = $(this).text();
  754.  
  755. $(this).parent().get(0).childNodes[1].nodeValue = "";
  756. $(this).parent().get(0).childNodes[2].nodeValue = "";
  757. $(this).text("发布时间 " + posttime + "\xa0\xa0,\xa0\xa0" + "最后回复 " + replytime);
  758.  
  759. }
  760. });
  761. }
  762.  
  763. //获取url中?后面的参数
  764. function getQueryVariable (variable) {
  765. var query = window.location.search.substring(1);
  766. var vars = query.split("&");
  767. for (var i = 0; i < vars.length; i++) {
  768. var pair = vars[i].split("=");
  769. if (pair[0] == variable) { return pair[1]; }
  770. }
  771. return (false);
  772. }
  773.  
  774. //搜索结果页
  775. function search () {
  776. if (hideSearchSideBar == 1) //隐藏侧边栏并拉宽内容
  777. {
  778. $(".SearchSideBar").hide();
  779. $(".SearchMain").width($(".Search-container").width());
  780. }
  781. else if (hideSearchSideBar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  782. {
  783. $(".SearchSideBar").hide();
  784. $(".Search-container").attr("style", "display:flex;justify-content:center;");
  785. }
  786.  
  787.  
  788. $(".ContentItem.AnswerItem, .ContentItem.ArticleItem").each(function () {
  789. if (!($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length > 0 && $(this).find(".ContentItem-time").find("span").text() != null) {
  790. if ($(this).find(".ContentItem-time").text().indexOf("发布于") == -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时,增加具体发布时间data-tooltip
  791. {
  792. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  793. var oldtext = $(this).find(".ContentItem-time").find("span").text();
  794. $(this).find(".ContentItem-time").find("span").text(data_tooltip + "\xa0\xa0,\xa0\xa0" + oldtext);
  795. $(this).find(".ContentItem-time").addClass("full");
  796. }
  797. else if ($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip
  798. {
  799. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  800. $(this).find(".ContentItem-time").find("span").text(data_tooltip);
  801. $(this).find(".ContentItem-time").addClass("full");
  802. }
  803.  
  804. //发布时间置顶
  805. if (publishTop == 1) {
  806. if (!$(this).find(".ContentItem-time").parent().hasClass("SearchItem-meta")) {
  807. let temp_time = $(this).find(".ContentItem-time").clone();
  808. $(this).find(".RichContent .ContentItem-time").hide();
  809. $(this).find(".SearchItem-meta").append(temp_time);
  810. }
  811. }
  812. }
  813.  
  814. });
  815.  
  816. //隐藏相关推荐的卡片,仅保留问题卡片
  817. /*
  818. $(".RelevantQuery").closest(".Card.SearchResult-Card").hide();
  819. $(".KfeCollection-PcCollegeCard-wrapper").closest(".Card.SearchResult-Card").hide();
  820. if (getQueryVariable("type") == "content") {
  821. $('.Card.SearchResult-Card[data-za-detail-view-path-module=\"UserItem\"]').hide();
  822. }
  823. */
  824.  
  825. }
  826.  
  827. //知乎讲座
  828. function lives () {
  829. $("[class*=\'LiveWechatSpread\']").hide(); //隐藏微信推荐
  830. }
  831.  
  832. //收藏夹
  833. function collection () {
  834. if (hideCollectionSideBar == 1) //隐藏侧边栏并拉宽内容
  835. {
  836. $(".CollectionDetailPageSideBar").hide();
  837. $(".CollectionsDetailPage-mainColumn").width($(".CollectionsDetailPage").width());
  838.  
  839. $(".GlobalSideBar").hide();
  840. $(".Collections-mainColumn").width($(".Collections-container").width());
  841. }
  842. else if (hideCollectionSideBar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  843. {
  844. $(".CollectionDetailPageSideBar").hide();
  845. $(".CollectionsDetailPage-mainColumn").parent().attr("style", "display:flex;justify-content:center;");
  846.  
  847. $(".GlobalSideBar").hide();
  848. $(".Collections-mainColumn").parent().attr("style", "display:flex;justify-content:center;");
  849. }
  850.  
  851. //收藏夹举报按钮
  852. $(".ContentItem-actions").each(function () {
  853. var $collect_dot = $(this).find(".Zi--Dots").closest(".Popover");
  854. if ($(this).find(".Zi--Report").length == 0) //未添加举报
  855. {
  856. $collect_dot.hide();
  857. let button_text = '<button type=\"button\" class=\"Button ContentItem-action Button--plain\"><span style=\"display: inline-flex; align-items: center;\"><svg class=\"Zi Zi--Report\" fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z\" fill-rule=\"evenodd\"></path></svg></span> 举报</button>';
  858. let $report = $(button_text);
  859. $report.bind("click", function () {
  860. $collect_dot.find("button").click();
  861. $(".AnswerItem-selfMenu").children().eq(1).click();
  862. });
  863. $collect_dot.after($report);
  864. }
  865. });
  866. }
  867.  
  868. //按钮变色
  869. function iconColor () {
  870.  
  871. //引用角标高亮
  872. $('.ztext sup[data-draft-type=reference]').click(function(){
  873.  
  874. $('.ReferenceList li').removeClass('is-active');
  875. let ref_id = $(this).find('a').attr('href');
  876. $(this).closest('.List-item').find(ref_id).addClass('is-active');
  877. $(this).closest('.ContentItem.AnswerItem').find(ref_id).addClass('is-active');
  878. $(this).closest('.Post-content').find(ref_id).addClass('is-active');
  879. $(this).closest('.TopicIntroContent').find(ref_id).addClass('is-active');
  880. });
  881.  
  882. //悬停时显示浅蓝色边框
  883. if (hoverShadow == 1) {
  884. if (typeof ($("html").attr("data-hover-visible")) == "undefined") {
  885. $("html").attr("data-hover-visible", "1");
  886. }
  887. $("html").removeAttr("data-focus-visible"); //避免快捷键变色的影响
  888. }
  889.  
  890. $(".Zi--List").parent().parent().hover(function () {
  891. $(this).find(".Zi--List").attr("fill", "#0084FF");
  892. $(this).attr("style", "color:#0084FF");
  893. }, function () {
  894. $(this).find(".Zi--List").attr("fill", "currentColor");
  895. $(this).attr("style", "color:#8590A6");
  896. });
  897.  
  898. $(".Zi--Comment").parent().parent().hover(function () {
  899. $(this).find(".Zi--Comment").attr("fill", "#0084FF");
  900.  
  901. if ($(this).closest(".QuestionHeaderActions").length > 0)
  902. $(this).attr("style", "color:#0084FF;margin: 0px 0px 0px 9px;");
  903. else
  904. $(this).attr("style", "color:#0084FF");
  905.  
  906. }, function () {
  907. if ($(this).closest(".QuestionHeaderActions").length > 0) {
  908. $(this).find(".Zi--Comment").attr("fill", "currentColor");
  909. $(this).attr("style", "color:#8590A6;margin: 0px 0px 0px 9px;");
  910. }
  911. else {
  912. if ($(this).prop('lastChild').nodeValue.indexOf("收起评论") == -1) {
  913. $(this).find(".Zi--Comment").attr("fill", "currentColor");
  914. $(this).attr("style", "color:#8590A6");
  915. }
  916. }
  917. });
  918.  
  919. $(".Zi--Comment").parent().parent().each(function () {
  920. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("收起评论") > -1) {
  921. $(this).find(".Zi--Comment").attr("fill", "#0084FF");
  922. $(this).attr("style", "color:#0084FF");
  923. }
  924. });
  925.  
  926. $('.Zi--Catalog').closest('button').hover(function(){
  927. $(this).attr('style','color:#10dede');
  928. },function(){
  929. $(this).attr('style','color:#8590a6');
  930. });
  931.  
  932. $(".Zi--Close").on("click", function () {
  933. $(".Zi--Comment").parent().parent().each(function () {
  934. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("收起评论") > -1) {
  935. $(this).find(".Zi--Comment").attr("fill", "currentColor");
  936. $(this).attr("style", "color:#8590A6");
  937. }
  938. });
  939. });
  940.  
  941. $(".Zi--Comments").parent().parent().hover(function () {
  942. $(this).find(".Zi--Comments").find("path").attr("fill", "#00FF7F");
  943. $(this).css({ "color": "#00FF7F" });
  944. }, function () {
  945.  
  946. if ($(this).hasClass("CommentItemV2-talkBtn")) //评论区查看回复按钮变色
  947. {
  948. $(this).find(".Zi--Comments").find("path").attr("fill", "#8590a6");
  949. $(this).css({ "color": "#8590a6" });
  950. }
  951. else if ($(".Messages-content").length == 0) //私信框消失,私信按钮变色
  952. {
  953. if ($("html").attr("data-theme") == "dark") {
  954. $(this).find(".Zi--Comments").find("path").attr("fill", "#8590a6");
  955. $(this).css({ "color": "#8590a6" });
  956. }
  957. else {
  958. $(this).find(".Zi--Comments").find("path").attr("fill", "rgb(68,68,68)");
  959. $(this).css({ "color": "rgb(68,68,68)" });
  960. }
  961. }
  962. });
  963.  
  964. $(".Zi--Reply").parent().parent().hover(function () {
  965. $(this).find(".Zi--Reply").attr("fill", "#32CD32");
  966. $(this).attr("style", "color:#32CD32");
  967. }, function () {
  968. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("取消回复") == -1) {
  969. $(this).find(".Zi--Reply").attr("fill", "currentColor");
  970. $(this).attr("style", "color:#8590A6");
  971. }
  972. });
  973.  
  974. $(".Zi--Reply").parent().parent().each(function () {
  975. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("取消回复") > -1) {
  976. $(this).find(".Zi--Reply").attr("fill", "#32CD32");
  977. $(this).attr("style", "color:#32CD32");
  978. }
  979. });
  980.  
  981. $(".Zi--Like").parent().parent().hover(function () {
  982. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("踩") > -1 || $(this).attr("data-tooltip") == "不推荐") {
  983. if ($("html").attr("data-theme") == "dark") {
  984. $(this).find(".Zi--Like").attr("fill", "white");
  985. $(this).css("color", "white");
  986. }
  987. else {
  988. $(this).find(".Zi--Like").attr("fill", "black");
  989. $(this).css("color", "black");
  990. }
  991. }
  992. else if (window.location.href.indexOf("search") > -1) {
  993. if ($(this).hasClass("SearchTopicReview-Icon--like") || $(this).hasClass("SearchTopicReview-Icon--liked")) {
  994. $(this).find(".Zi--Like").find("path").attr("fill", "#FF4D82");
  995. $(this).attr("style", "color:#FF4D82;");
  996. }
  997. else {
  998. $(this).find(".Zi--Like").find("path").attr("fill", "black");
  999. $(this).attr("style", "color:black;");
  1000. }
  1001. }
  1002. else if (window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1) {
  1003. $(this).find(".Zi--Like").attr("fill", "#FF4D82");
  1004. $(this).attr("style", "color:#FF4D82;");
  1005. }
  1006. else {
  1007. $(this).find(".Zi--Like").attr("fill", "#FF4D82");
  1008. $(this).attr("style", "color:#FF4D82;margin:0px;");
  1009. }
  1010. }, function () {
  1011. if ($(this).find("#topic-recommend").length > 0 || $(this).find("#topic-against").length > 0 || $(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("取消踩") == -1)
  1012. $(this).find(".Zi--Like").attr("fill", "currentColor");
  1013.  
  1014. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("取消踩") > -1) {
  1015. $(this).attr("style", "color:black;");
  1016. }
  1017. else if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue.indexOf("踩") > -1 || $(this).attr("data-tooltip") == "不推荐") {
  1018. $(this).attr("style", "color:#8590A6;");
  1019. }
  1020. else if (window.location.href.indexOf("search") > -1) {
  1021. $(this).find(".Zi--Like").find("path").attr("fill", "#8590A6");
  1022. $(this).attr("style", "color:#8590A6;");
  1023. }
  1024. else if (window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1) {
  1025. if ($(this).hasClass("css-1pbw4sw")) //认证与成就
  1026. {
  1027. $(this).find(".Zi--Like").attr("fill", "#FF4D82");
  1028. $(this).attr("style", "color:#FF4D82;");
  1029. }
  1030. else //普通回答
  1031. {
  1032. $(this).find(".Zi--Like").attr("fill", "#8590A6");
  1033. $(this).attr("style", "color:#8590A6;");
  1034. }
  1035. }
  1036. else
  1037. $(this).attr("style", "color:#8590A6; margin:0px;");
  1038. });
  1039.  
  1040. $(".Zi--Like").parent().parent().each(function () {
  1041. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue == "取消踩")
  1042. $(this).find(".Zi--Like").attr("fill", "black");
  1043.  
  1044. if (window.location.href.indexOf("search") > -1) {
  1045. if ($(this).hasClass("SearchTopicReview-Icon--liked")) {
  1046. $(this).find(".Zi--Like").find("path").attr("fill", "#FF4D82");
  1047. $(this).attr("style", "color:#FF4D82;");
  1048. }
  1049. }
  1050. else if (window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1) {
  1051. if ($(this).hasClass("css-1pbw4sw") || $(this).hasClass("is-liked")) {
  1052. $(this).find(".Zi--Like").attr("fill", "#FF4D82");
  1053. $(this).attr("style", "color:#FF4D82;");
  1054. }
  1055. }
  1056. });
  1057.  
  1058. $(".GoodQuestionAction-highLightBtn").attr("style", "color:#FF4D82;margin:0px;"); //题目点赞后保持变色
  1059. $(".is-liked").attr("style", "color:#FF4D82;margin:0px;"); //评论点赞后保持变色
  1060.  
  1061.  
  1062. $(".Zi--Share").parent().parent().parent().hover(function () {
  1063. $(this).find(".Zi--Share").attr("fill", "blue");
  1064.  
  1065. if ($(this).closest(".QuestionHeaderActions").length > 0)
  1066. $(this).find("button").attr("style", "color:blue;margin: 0px 0px 0px 9px;");
  1067. else if ($(this).find(".Post-SideActions-icon").length > 0)
  1068. $(this).attr("style", "color:blue;");
  1069. else
  1070. $(this).find("button").attr("style", "color:blue;");
  1071.  
  1072. }, function () {
  1073. $(this).find(".Zi--Share").attr("fill", "currentColor");
  1074.  
  1075. if ($(this).closest(".QuestionHeaderActions").length > 0)
  1076. $(this).find("button").attr("style", "color:#8590A6;margin: 0px 0px 0px 9px;");
  1077. else if ($(this).find(".Post-SideActions-icon").length > 0)
  1078. $(this).attr("style", "color:#8590A6;");
  1079. else
  1080. $(this).find("button").attr("style", "color:#8590A6;");
  1081. });
  1082.  
  1083.  
  1084. $(".Zi--Star").parent().parent().hover(function () {
  1085. if (!$(this).hasClass("ExploreHomePage-ContentSection") && !$(this).hasClass("css-18biwo") && !$(this).hasClass("css-g9eqf4-StrutAlign")) {
  1086. $(this).find(".Zi--Star").attr("fill", "orange");
  1087. $(this).attr("style", "color:orange");
  1088. }
  1089. }, function () {
  1090. if (!$(this).hasClass("ExploreHomePage-ContentSection") && !$(this).hasClass("css-18biwo") && !$(this).hasClass("css-g9eqf4-StrutAlign")) {
  1091. $(this).find(".Zi--Star").attr("fill", "currentColor");
  1092. $(this).attr("style", "color:#8590A6");
  1093. }
  1094. });
  1095.  
  1096. $(".Zi--Heart").parent().parent().hover(function () {
  1097. $(this).find(".Zi--Heart").attr("fill", "red");
  1098. $(this).attr("style", "color:red");
  1099. }, function () {
  1100. if ($(this).prop('lastChild').nodeValue == "喜欢")
  1101. $(this).find(".Zi--Heart").attr("fill", "currentColor");
  1102.  
  1103. $(this).attr("style", "color:#8590A6");
  1104. });
  1105.  
  1106. $(".Zi--Heart").parent().parent().each(function () {
  1107. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue == "取消喜欢")
  1108. $(this).prop('lastChild').nodeValue = "已喜欢";
  1109. if ($(this).prop('lastChild').nodeValue != null && $(this).prop('lastChild').nodeValue == "已喜欢") {
  1110. $(this).find(".Zi--Heart").attr("fill", "red");
  1111. $(this).attr("style", "color:red");
  1112. }
  1113. });
  1114.  
  1115. $(".Zi--Report").parent().parent().hover(function () {
  1116. $(this).find(".Zi--Report").attr("fill", "brown");
  1117.  
  1118. if ($(this).closest(".QuestionHeaderActions").length > 0)
  1119. $(this).attr("style", "color:brown;margin: 0px 0px 0px 9px;");
  1120. else
  1121. $(this).attr("style", "color:brown");
  1122.  
  1123. }, function () {
  1124. $(this).find(".Zi--Report").attr("fill", "currentColor");
  1125.  
  1126. if ($(this).closest(".QuestionHeaderActions").length > 0)
  1127. $(this).attr("style", "color:#8590A6;margin: 0px 0px 0px 9px;");
  1128. else
  1129. $(this).attr("style", "color:#8590A6");
  1130. });
  1131.  
  1132. /*
  1133. $(".Zi--Bell").parent().parent().hover(function () {
  1134. $(this).find(".Zi--Bell path").attr("fill", "#FACB62");
  1135. }, function () {
  1136. if ($(".PushNotifications-content").length == 0) //没有通知框,恢复原色
  1137. {
  1138. if ($("html").attr("data-theme") == "light") //日间模式
  1139. {
  1140. $(this).find(".Zi--Bell path").attr("fill", "rgb(68,68,68)");
  1141. }
  1142. else //夜间模式
  1143. {
  1144. $(this).find(".Zi--Bell path").attr("fill", "#8590A6");
  1145. }
  1146. }
  1147. else //有通知框,持续变色
  1148. {
  1149. $(this).find(".Zi--Bell path").attr("fill", "#FACB62");
  1150. }
  1151. });
  1152.  
  1153. $(".Zi--Bell").parent().parent().on("click", function () {
  1154. if ($(".PushNotifications-content").length == 0) {
  1155. $(this).find(".Zi--Bell path").attr("fill", "#FACB62");
  1156. }
  1157. else {
  1158. $(this).find(".Zi--Bell path").attr("fill", "currentColor");
  1159. }
  1160. });
  1161. */
  1162.  
  1163. $(".Zi--Heart.PushNotifications-tabIcon").parent().parent().hover(function () {
  1164. $(this).find(".Zi--Heart").attr("fill", "#0084FF");
  1165. }, function () {
  1166. $(this).find(".Zi--Heart").attr("fill", "currentColor");
  1167. });
  1168.  
  1169. $(".Zi--Users").parent().parent().hover(function () {
  1170. $(this).find(".Zi--Users").attr("fill", "#0084FF");
  1171. }, function () {
  1172. $(this).find(".Zi--Users").attr("fill", "currentColor");
  1173. });
  1174.  
  1175. $(".Zi--Anonymous").parent().parent().hover(function () {
  1176. if ($("html").attr("data-theme") == "dark") {
  1177. $(this).find(".Zi--Anonymous").attr("fill", "#d3d3d3");
  1178. $(this).attr("style", "color:#d3d3d3;margin: 0px 0px 0px 9px;");
  1179. }
  1180. else {
  1181. $(this).find(".Zi--Anonymous").attr("fill", "black");
  1182. $(this).attr("style", "color:black;margin: 0px 0px 0px 9px;");
  1183. }
  1184. }, function () {
  1185. $(this).find(".Zi--Anonymous").attr("fill", "currentColor");
  1186. $(this).attr("style", "color:#8590A6;margin: 0px 0px 0px 9px;");
  1187. });
  1188.  
  1189. $(".Zi--Log").parent().parent().hover(function () {
  1190. $(this).find(".Zi--Log").attr("fill", "purple");
  1191. $(this).parent().attr("style", "color:purple;margin: 0px 0px 0px 9px;");
  1192. }, function () {
  1193. $(this).find(".Zi--Log").attr("fill", "currentColor");
  1194. $(this).parent().attr("style", "color:#8590A6;margin: 0px 0px 0px 9px;");
  1195. });
  1196.  
  1197. $(".Zi--ShortCut").parent().parent().hover(function () {
  1198. $(this).find(".Zi--ShortCut").attr("fill", "#44B8A1");
  1199. $(this).attr("style", "color:#44B8A1;margin: 0px 0px 0px 9px;");
  1200. }, function () {
  1201. $(this).find(".Zi--ShortCut").attr("fill", "currentColor");
  1202. $(this).attr("style", "color:#8590A6;margin: 0px 0px 0px 9px;");
  1203. });
  1204.  
  1205. $(".Zi--Invite").parent().parent().hover(function () {
  1206. if ($("html").attr("data-theme") == "light") {
  1207. $(this).find(".Zi--Invite").attr("fill", "black");
  1208. $(this).attr("style", "color:black;margin: 0px 8px 0px 0px;");
  1209. }
  1210. else {
  1211. $(this).find(".Zi--Invite").attr("fill", "white");
  1212. $(this).attr("style", "color:white;margin: 0px 8px 0px 0px;");
  1213. }
  1214. }, function () {
  1215. $(this).find(".Zi--Invite").attr("fill", "currentColor");
  1216. $(this).attr("style", "color:#8590A6;margin: 0px 8px 0px 0px;");
  1217. });
  1218.  
  1219. $(".Zi--Trash").parent().parent().hover(function () {
  1220. $(this).find(".Zi--Trash").attr("fill", "#C70000");
  1221. $(this).attr("style", "color:#C70000");
  1222. }, function () {
  1223. $(this).find(".Zi--Trash").attr("fill", "currentColor");
  1224. $(this).attr("style", "color:#8590A6");
  1225. });
  1226.  
  1227. $(".SelfCollectionItem-actions .Zi--EditSurround").parent().parent().hover(function () {
  1228. $(this).find(".Zi--EditSurround").attr("fill", "orange");
  1229. $(this).attr("style", "color:orange");
  1230. }, function () {
  1231. $(this).find(".Zi--EditSurround").attr("fill", "currentColor");
  1232. $(this).attr("style", "color:#8590A6");
  1233. });
  1234.  
  1235. $(".CollectionDetailPageHeader-actions .Zi--EditSurround").parent().parent().hover(function () {
  1236. $(this).find(".Zi--EditSurround").attr("fill", "orange");
  1237. $(this).attr("style", "color:orange");
  1238. }, function () {
  1239. $(this).find(".Zi--EditSurround").attr("fill", "currentColor");
  1240. $(this).attr("style", "color:#8590A6");
  1241. });
  1242.  
  1243. $(".Zi--Emotion").parent().parent().hover(function () {
  1244. $(this).find(".Zi--Emotion").find("path").attr("fill", "#0084FF");
  1245. }, function () {
  1246. $(this).find(".Zi--Emotion").find("path").removeAttr("fill");
  1247. });
  1248.  
  1249. $(".Zi--AddImage").parent().parent().hover(function () {
  1250. $(this).find(".Zi--AddImage").find("path").attr("fill", "#0084FF");
  1251. }, function () {
  1252. $(this).find(".Zi--AddImage").find("path").removeAttr("fill");
  1253. });
  1254.  
  1255. $(".Zi--InsertImage").find("path").attr("fill", "blue");
  1256. $(".Zi--Image").find("path").attr("fill", "blue");
  1257.  
  1258. $(".Zi--InsertVideo, .Zi--FormatClear").find("path").attr("fill", "red");
  1259.  
  1260. $(".Zi--InsertFormula").find("path").attr("fill", "rgb(115,216,244)");
  1261.  
  1262. $(".Zi--InsertLink").find("path").attr("fill", "#0084FF");
  1263.  
  1264. $(".Zi--Folder").find("path").attr("fill", "#FF8C00");
  1265.  
  1266. $(".Zi--EditCircle").find("path").attr("fill", "#82480E");
  1267.  
  1268. $(".Zi--Juror").find("path").attr("fill", "brown");
  1269.  
  1270. $(".Zi--Marked").find("path").attr("fill", "blue");
  1271.  
  1272. if($("html").attr("data-theme") == "light")
  1273. {
  1274. $(".MathToolbar-button svg").attr("fill", "black");
  1275. $(".MathToolbar-paletteIcon").css("color", "black");
  1276. }
  1277. else
  1278. {
  1279. $(".MathToolbar-button svg").attr("fill", "#d3d3d3");
  1280. $(".MathToolbar-paletteIcon").css("color", "#d3d3d3");
  1281. }
  1282.  
  1283. $(".AnswerAdd-topicBiosButton").attr("style", "color:#0084FF");
  1284. $(".AnswerAdd-topicBiosButton .Zi--Edit").attr("fill", "#0084FF");
  1285.  
  1286. $(".Zi--Document").parent().hover(function () {
  1287. $(this).find(".Zi--Document").find("path").attr("fill", "#FF8C00");
  1288. $(this).attr("style", "color:#FF8C00");
  1289. }, function () {
  1290. $(this).find(".Zi--Document").find("path").removeAttr("fill");
  1291. $(this).attr("style", "color:#8590A6");
  1292. });
  1293.  
  1294. $(".Zi--Time").parent().hover(function () {
  1295. if ($("html").attr("data-theme") == "light") {
  1296. $(this).find(".Zi--Time").find("path").attr("fill", "black");
  1297. $(this).attr("style", "color:black");
  1298. }
  1299. else {
  1300. $(this).find(".Zi--Time").find("path").attr("fill", "white");
  1301. $(this).attr("style", "color:white");
  1302. }
  1303. }, function () {
  1304. $(this).find(".Zi--Time").find("path").removeAttr("fill");
  1305. $(this).attr("style", "color:#8590A6");
  1306. });
  1307.  
  1308. $(".Zi--Deliver").parent().parent().hover(function () {
  1309. $(this).find(".Zi--Deliver").find("path").attr("fill", "#02E6B8");
  1310. $(this).attr("style", "color:#02E6B8");
  1311. }, function () {
  1312. $(this).find(".Zi--Deliver").find("path").removeAttr("fill");
  1313. $(this).attr("style", "color:#8590A6");
  1314. });
  1315.  
  1316. $(".Zi--FullscreenEnter").parent().hover(function () {
  1317. $(this).find(".Zi--FullscreenEnter").find("path").attr("fill", "#0084FF");
  1318. $(this).attr("style", "color:#0084FF");
  1319. }, function () {
  1320. $(this).find(".Zi--FullscreenEnter").find("path").removeAttr("fill");
  1321. $(this).attr("style", "color:#8590A6");
  1322. });
  1323.  
  1324. $(".AnswerForm-exitFullscreenButton").hover(function () {
  1325. $(this).find(".AnswerForm-exitFullscreenButton").find("path").attr("fill", "#0084FF");
  1326. $(this).attr("style", "color:#0084FF");
  1327. }, function () {
  1328. $(this).find(".AnswerForm-exitFullscreenButton").find("path").removeAttr("fill");
  1329. $(this).attr("style", "color:#8590A6");
  1330. });
  1331.  
  1332. $(".Notifications-footer .Zi--Settings").parent().parent().hover(function () {
  1333. $(this).find(".Zi--Settings").attr("fill", "purple");
  1334. $(this).attr("style", "color:purple");
  1335. }, function () {
  1336. $(this).find(".Zi--Settings").attr("fill", "currentColor");
  1337. $(this).attr("style", "color:#8590A6");
  1338. });
  1339.  
  1340. $(".Post-ActionMenuButton .Zi--Settings").parent().parent().hover(function () {
  1341. $(this).find(".Zi--Settings").attr("fill", "purple");
  1342. $(this).attr("style", "color:purple");
  1343. }, function () {
  1344. $(this).find(".Zi--Settings").attr("fill", "currentColor");
  1345. $(this).attr("style", "color:#8590A6");
  1346. });
  1347.  
  1348. $(".TopicActions .Zi--Settings").parent().parent().hover(function () {
  1349. $(this).find(".Zi--Settings").attr("fill", "purple");
  1350. $(this).attr("style", "color:purple");
  1351. }, function () {
  1352. $(this).find(".Zi--Settings").attr("fill", "currentColor");
  1353. $(this).attr("style", "color:#8590A6");
  1354. });
  1355.  
  1356. $(".ContentItem-action .Zi--Settings, .AnswerForm-footerRight .Zi--Settings").parent().parent().hover(function () {
  1357. $(this).find(".Zi--Settings").attr("fill", "purple");
  1358. $(this).attr("style", "color:purple");
  1359. }, function () {
  1360. $(this).find(".Zi--Settings").attr("fill", "currentColor");
  1361. $(this).attr("style", "color:#8590A6");
  1362. });
  1363.  
  1364. $(".AppHeaderProfileMenu .Zi--Settings").parent().hover(function () {
  1365. $(this).find(".Zi--Settings").attr("fill", "purple");
  1366. $(this).attr("style", "color:purple");
  1367. }, function () {
  1368. if ($("html").attr("data-theme") == "light") {
  1369. $(this).find(".Zi--Settings").attr("fill", "black");
  1370. $(this).attr("style", "color:black");
  1371. }
  1372. else {
  1373. $(this).find(".Zi--Settings").attr("fill", "#d3d3d3");
  1374. $(this).attr("style", "color:#d3d3d3");
  1375. }
  1376. });
  1377.  
  1378. $(".AppHeaderProfileMenu .Zi--Logout").parent().hover(function () {
  1379. $(this).find(".Zi--Logout").attr("fill", "red");
  1380. $(this).attr("style", "color:red");
  1381. }, function () {
  1382. if ($("html").attr("data-theme") == "light") {
  1383. $(this).find(".Zi--Logout").attr("fill", "black");
  1384. $(this).attr("style", "color:black");
  1385. }
  1386. else {
  1387. $(this).find(".Zi--Logout").attr("fill", "#d3d3d3");
  1388. $(this).attr("style", "color:#d3d3d3");
  1389. }
  1390. });
  1391.  
  1392. $(".AppHeaderProfileMenu .Zi--Profile").parent().hover(function () {
  1393. $(this).find(".Zi--Profile").attr("fill", "rgb(5,107,0)");
  1394. $(this).attr("style", "color:rgb(5,107,0)");
  1395. }, function () {
  1396. if ($("html").attr("data-theme") == "light") {
  1397. $(this).find(".Zi--Profile").attr("fill", "black");
  1398. $(this).attr("style", "color:black");
  1399. }
  1400. else {
  1401. $(this).find(".Zi--Profile").attr("fill", "#d3d3d3");
  1402. $(this).attr("style", "color:#d3d3d3");
  1403. }
  1404. });
  1405.  
  1406. $(".AppHeaderProfileMenu .Zi--Creator").parent().hover(function () {
  1407. $(this).find(".Zi--Creator").attr("fill", "#0084FF");
  1408. $(this).attr("style", "color:#0084FF");
  1409. }, function () {
  1410. if ($("html").attr("data-theme") == "light") {
  1411. $(this).find(".Zi--Creator").attr("fill", "black");
  1412. $(this).attr("style", "color:black");
  1413. }
  1414. else {
  1415. $(this).find(".Zi--Creator").attr("fill", "#d3d3d3");
  1416. $(this).attr("style", "color:#d3d3d3");
  1417. }
  1418. });
  1419.  
  1420. $(".CommentMoreReplyButton .Button").hover(function () {
  1421. $(this).attr("style", "color:#00FF7F");
  1422. }, function () {
  1423. $(this).attr("style", "color:#8590A6");
  1424. });
  1425.  
  1426. $(".CommentCollapseButton").hover(function () {
  1427. $(this).find("Zi--ArrowUp").attr("fill", "#0084FF");
  1428. $(this).css({ "color": "#0084FF" });
  1429.  
  1430. }, function () {
  1431. $(this).find("Zi--ArrowUp").attr("fill", "currentColor");
  1432. $(this).css({ "color": "#8590A6" });
  1433.  
  1434. });
  1435.  
  1436. //点击评论列表右下角出现的"收起评论"时,将评论按钮恢复灰色
  1437. $(".CommentCollapseButton").on("click", function () {
  1438. let $t = $(this).closest(".Comments-container").prev().find(".Zi--Comment").parent().parent();
  1439. $t.find(".Zi--Comment").attr("fill", "currentColor");
  1440. $t.attr("style", "color:#8590A6");
  1441. });
  1442.  
  1443. $(".ContentItem-time").each(function () {
  1444. $(this).find("a").attr("style", "border-bottom: 1px solid rgba(133,144,166,.72)");
  1445. });
  1446.  
  1447. $(".Button.ContentItem-action.ContentItem-rightButton.Button--plain").attr("style", "color:#175199");
  1448. $(".QuestionRichText-more").attr("style", "color:#0084FF");
  1449. $(".QuestionHeader-actions .Button").attr("style", "color:#0084FF");
  1450.  
  1451. $(".Zi--Switch").attr("fill", "#0084FF");
  1452. $(".Zi--Switch").parent().parent().css("color", "#0084FF");
  1453.  
  1454. $(".Zi--Select").attr("fill", "#0084FF");
  1455. $(".Zi--Select").parent().css("color", "#0084FF");
  1456.  
  1457. $(".Zi--Dots").hover(function () {
  1458. $(this).find("path").attr("fill", "#0084FF");
  1459. }, function () {
  1460. $(this).find("path").attr("fill", "#8590A6");
  1461. });
  1462.  
  1463. $(".Zi--FormatCode").find("path").attr("fill", "#0084FF");
  1464.  
  1465. $(".List-headerText").css("top", "-5px");
  1466.  
  1467. $(".Post-ActionMenu .Button.Menu-item.Button--plain .Zi--Check").each(function(){
  1468. $(this).parent().parent().parent().addClass('is-active');
  1469. });
  1470.  
  1471.  
  1472. $(".AnswerItem-selectMenuItem .Zi--Check, .CommentPermission-item .Zi--Check").each(function(){
  1473. $(this).parent().parent().parent().addClass('is-active');
  1474. });
  1475.  
  1476. /*
  1477. $(".AnswerItem-selectMenuItem").hover(function () {
  1478. if ($("html").attr("data-theme") == "dark")
  1479. $(this).attr("style", "color:#d3d3d3");
  1480. else
  1481. $(this).attr("style", "color:black");
  1482. }, function () {
  1483. if ($(this).find(".Zi--Check").length == 0)
  1484. $(this).attr("style", "color:#8590A6");
  1485. });
  1486.  
  1487. $(".CommentPermission-item").hover(function () {
  1488. if ($("html").attr("data-theme") == "dark")
  1489. $(this).attr("style", "color:#d3d3d3");
  1490. else
  1491. $(this).attr("style", "color:black");
  1492. }, function () {
  1493. if ($(this).find(".Zi--Check").length == 0)
  1494. $(this).attr("style", "color:#8590A6");
  1495. });
  1496. */
  1497.  
  1498. $(".AnswerAdd-toggleAnonymous").hover(function () {
  1499. $(this).attr("style", "color:#0084FF");
  1500. }, function () {
  1501. $(this).attr("style", "color:#8590A6");
  1502. });
  1503.  
  1504. $(".DisclaimerEntry").hover(function () {
  1505. if ($("html").attr("data-theme") == "dark") {
  1506. $(this).find("path").attr("fill", "#d3d3d3");
  1507. $(this).find("button").attr("style", "color:#d3d3d3");
  1508. }
  1509. else {
  1510. $(this).find("path").attr("fill", "black");
  1511. $(this).find("button").attr("style", "color:black");
  1512. }
  1513. }, function () {
  1514. $(this).find("path").attr("fill", "currentColor");
  1515. $(this).find("button").attr("style", "color:#8590A6");
  1516. });
  1517.  
  1518. $(".ImageView.CommentRichText-ImageView.is-active").css({ "z-index": "1000" });
  1519.  
  1520. if ($(".css-70qvj9 .Zi--CheckboxOn").length > 0)
  1521. $(".css-70qvj9 .css-1d83bu8").attr("style", "color:#0084FF");
  1522. if ($(".css-70qvj9 .Zi--CheckboxOff").length > 0)
  1523. $(".css-70qvj9 .css-1d83bu8").attr("style", "color:#8590A6");
  1524.  
  1525. if ($.cookie('nightmode') == undefined)
  1526. $.cookie('nightmode', 0, { expires: 365, path: "/", domain: "zhihu.com" });
  1527.  
  1528. var $nightmode = $('<div><button id=\"nightmode\" style=\"margin-left:15px; margin-top:6px; user-select:none; -webkit-user-select:none; width:100px\">' +
  1529. '<img style=\"vertical-align:middle; width:18px; height:18px; user-select:none; -webkit-user-select:none; \" src=\"' + dark + '\">' +
  1530. '<span style=\"vertical-align:middle; user-select:none; -webkit-user-select:none; \" > 夜间模式</span></button></div>');
  1531.  
  1532.  
  1533. $nightmode.click(function () {
  1534. if ($("html").attr("data-theme") == "light") {
  1535. $("html").attr("data-theme", "dark");
  1536. $(this).find("img").attr("src", light).attr("style", "vertical-align:middle; width:20px; height:20px;");
  1537. $(this).find("span").text(" 日间模式");
  1538. $.cookie('nightmode', 1, { expires: 365, path: "/", domain: "zhihu.com" });
  1539. }
  1540. else {
  1541. $("html").attr("data-theme", "light");
  1542. $(this).find("img").attr("src", dark).attr("style", "vertical-align:middle; width:18px; height:18px;");
  1543. $(this).find("span").text(" 夜间模式");
  1544. $.cookie('nightmode', 0, { expires: 365, path: "/", domain: "zhihu.com" });
  1545. }
  1546. });
  1547.  
  1548. if ($("#nightmode").length == 0) {
  1549. $(".SearchBar").after($nightmode);
  1550.  
  1551. var $nightmode_question_log = $nightmode.clone(true);
  1552. $nightmode_question_log.find('button').attr("style","background:transparent; user-select: none; border:none; margin-top:11px; color:#eee; cursor:pointer; width:80px");
  1553. $nightmode_question_log.hover(function(){
  1554. $(this).find('span').css('color','white');
  1555. },function(){
  1556. $(this).find('span').css('color','#eee');
  1557. });
  1558. //$('#zh-top-search-form').width(100);
  1559. //$("#zu-top-add-question").before($nightmode_question_log); //问题日志
  1560.  
  1561. var $nightmode_zhuanlan = $nightmode.clone(true);
  1562. $nightmode_zhuanlan.find('button').css({"margin":"0px 50px 0px 0px"});
  1563.  
  1564. $(".ColumnPageHeader-WriteButton").before($nightmode_zhuanlan); //专栏文章
  1565. $(".PublishPanel-wrapper").before($nightmode_zhuanlan); //写文章
  1566. }
  1567.  
  1568. if ($.cookie('nightmode') == 1) {
  1569. $("html").attr("data-theme", "dark");
  1570. $("#nightmode").find("img").attr("src", light).attr("style", "vertical-align:middle; width:20px; height:20px;");
  1571. if ($("#nightmode").find("span").text() != " 日间模式")
  1572. $("#nightmode").find("span").text(" 日间模式");
  1573. }
  1574. else {
  1575. $("html").attr("data-theme", "light");
  1576. $("#nightmode").find("img").attr("src", dark).attr("style", "vertical-align:middle; width:18px; height:18px;");
  1577. if ($("#nightmode").find("span").text() != " 夜间模式")
  1578. $("#nightmode").find("span").text(" 夜间模式");
  1579. }
  1580.  
  1581. $(".css-6f4i93").hide();
  1582.  
  1583. if(upload_video_main_flag==0 && window.location.href.indexOf('upload-video')>0 )
  1584. {
  1585. $('head').append('<style>'+'html[data-theme=dark] main{background:rgb(18,18,18)}'+'</style>');
  1586. upload_video_main_flag=1;
  1587. }
  1588. }
  1589.  
  1590. function index () {
  1591.  
  1592. $(".Zi--Hot").find("path").css({ "fill": "red" });
  1593.  
  1594.  
  1595. $(".Zi--Share").closest(".Button").hover(function () {
  1596. $(this).find("path").css({ "fill": "blue" });
  1597. $(this).css({ "color": "blue" });
  1598. }, function () {
  1599. $(this).find("path").css({ "fill": "#8590A6" });
  1600. $(this).css({ "color": "#8590A6" });
  1601. });
  1602.  
  1603. $(".TopstoryItem").each(function () {
  1604. if (!($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length > 0 && $(this).find(".ContentItem-time").find("span").text() != null) {
  1605. if ($(this).find(".ContentItem-time").text().indexOf("发布于") == -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip
  1606. {
  1607. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  1608. var oldtext = $(this).find(".ContentItem-time").find("span").text();
  1609. $(this).find(".ContentItem-time").find("span").text(data_tooltip + "\xa0\xa0,\xa0\xa0" + oldtext);
  1610. $(this).find(".ContentItem-time").addClass("full");
  1611. }
  1612. else if ($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip
  1613. {
  1614. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  1615. $(this).find(".ContentItem-time").find("span").text(data_tooltip);
  1616. $(this).find(".ContentItem-time").addClass("full");
  1617. }
  1618.  
  1619. //发布时间置顶
  1620. if (publishTop == 1) {
  1621. if (!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) {
  1622. let temp_time = $(this).find(".ContentItem-time").clone();
  1623. $(this).find(".RichContent .ContentItem-time").hide();
  1624. $(this).find(".ContentItem-meta").append(temp_time);
  1625. }
  1626.  
  1627. }
  1628. }
  1629.  
  1630. });
  1631.  
  1632. $(".Card.GlobalSideBar-category>a").hide();
  1633.  
  1634. $('.LoadingBar').removeClass('is-active');
  1635.  
  1636. $(".Zi--Disinterested").parent().parent().hover(function () {
  1637. $(this).find(".Zi--Disinterested").attr("fill", "rgb(252,96,123)");
  1638. $(this).attr("style", "color:rgb(252,96,123)");
  1639. }, function () {
  1640. $(this).find(".Zi--Disinterested").attr("fill", "currentColor");
  1641. $(this).attr("style", "color:#8590A6");
  1642. });
  1643.  
  1644. //首页隐藏侧边栏
  1645. if (hideIndexSidebar == 1) //隐藏侧边栏并拉宽内容
  1646. {
  1647. $(".GlobalSideBar").hide();
  1648. $(".GlobalLeftSideBar").hide();
  1649. //$(".Topstory-mainColumn").width($(".Topstory-container").width());
  1650. $(".Topstory-mainColumn").width("1000px");
  1651. }
  1652. else if (hideIndexSidebar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  1653. {
  1654. $(".GlobalSideBar").hide();
  1655. $(".GlobalLeftSideBar").hide();
  1656. $(".Topstory-container").attr("style", "display:flex;justify-content:center;");
  1657. }
  1658.  
  1659. //首页回答举报按钮、不感兴趣按钮
  1660. $(".ContentItem-actions").each(function () {
  1661.  
  1662. if ($(this).find(".Zi--Report").length == 0 && $(this).find(".Zi--Settings").length == 0) //未添加举报 且 不是自己的回答
  1663. {
  1664. let $question_dot = $(this).find(".Zi--Dots").closest(".ContentItem-action");
  1665. $question_dot.hide();
  1666. var button_text = '<button type=\"button\" class=\"Button ContentItem-action Button--plain Button--withIcon Button--withLabel\"><span style=\"display: inline-flex; align-items: center;\"><svg class=\"Zi Zi--Report\" fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z\" fill-rule=\"evenodd\"></path></svg></span> 举报</button>';
  1667. var $report = $(button_text);
  1668. $report.bind("click", function () {
  1669. $question_dot.find("button").click();
  1670. $(".Menu.AnswerItem-selfMenu").find("button").each(function () {
  1671. if ($(this).text().indexOf("举报") > -1)
  1672. $(this).click();
  1673. });
  1674. });
  1675. $question_dot.after($report);
  1676. }
  1677. else
  1678. {
  1679. $(this).find(".Zi--Dots").closest(".ContentItem-action").hide();
  1680. }
  1681.  
  1682. if($(this).find(".Zi--Disinterested").length == 0 && $(this).find(".Zi--Settings").length == 0 && $(this).closest('.TopstoryItem').find('.ZVideoItem').length==0 ) //未添加不感兴趣 且 不是自己的回答
  1683. {
  1684. let $question_dot = $(this).find(".Zi--Dots").closest(".ContentItem-action");
  1685. $question_dot.hide();
  1686. let button_text = '<button type=\"button\" class=\"Button ContentItem-action Button--plain Button--withIcon Button--withLabel\"><span style=\"display: inline-flex; align-items: center;\"><svg class=\"Zi Zi--Disinterested\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3931\" width=\"14\" height=\"14\"><path d=\"M512 32C251.4285715625 32 32 251.4285715625 32 512s219.4285715625 480 480 480 480-219.4285715625 480-480-219.4285715625-480-480-480z m205.7142853125 617.142856875c20.5714284375 20.5714284375 20.5714284375 48 0 61.714286249999994-20.5714284375 20.5714284375-48 20.5714284375-61.714285312499996 0l-137.142856875-137.1428578125L374.857143125 717.7142853125c-20.5714284375 20.5714284375-48 20.5714284375-68.5714284375 0s-20.5714284375-54.857143125 0-68.5714284375l144-144-137.1428578125-137.142856875c-20.5714284375-13.714285312500001-20.5714284375-41.142856875 0-61.714285312499996 20.5714284375-20.5714284375 48-20.5714284375 61.714286249999994 0l137.142856875 137.142856875 144-144c20.5714284375-20.5714284375 48-20.5714284375 68.5714284375 0 20.5714284375 20.5714284375 20.5714284375 48 0 68.5714284375L580.5714284375 512l137.142856875 137.142856875z\" p-id=\"3932\"></path></svg></span> 不感兴趣</button>';
  1687. let $disinterested = $(button_text);
  1688. $disinterested.bind("click", function () {
  1689. $question_dot.find("button").click();
  1690. $(".Menu.AnswerItem-selfMenu").find("button").each(function () { //回答
  1691. if ($(this).text().indexOf("不感兴趣") > -1)
  1692. {
  1693. $(this).click();
  1694. }
  1695. });
  1696. $(".Menu.ItemOptions-selfMenu").find("button").each(function () { //专栏
  1697. if ($(this).text().indexOf("不感兴趣") > -1)
  1698. {
  1699. $(this).click();
  1700. }
  1701. });
  1702. });
  1703. $question_dot.after($disinterested);
  1704. }
  1705. else
  1706. {
  1707. $(this).find(".Zi--Dots").closest(".ContentItem-action").hide();
  1708. }
  1709.  
  1710. });
  1711.  
  1712. }
  1713.  
  1714. var view_details = 0; //详细资料是否被点击的标志
  1715.  
  1716. //用户主页
  1717. function people () {
  1718. //自动点击"查看详细资料"按钮
  1719. if ($(".ProfileHeader-expandButton").text().indexOf("查看详细资料") > -1 && view_details == 0) {
  1720. $(".ProfileHeader-expandButton").click();
  1721. view_details = 1;
  1722. }
  1723.  
  1724. if (hideProfileSidebar == 1) //隐藏侧边栏并拉宽内容
  1725. {
  1726. $(".Profile-sideColumn").hide();
  1727. $(".Profile-mainColumn").width($(".Profile-main").width());
  1728. }
  1729. else if (hideProfileSidebar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  1730. {
  1731. $(".Profile-sideColumn").hide();
  1732. $(".Profile-main").attr("style", "display:flex;justify-content:center;");
  1733. }
  1734.  
  1735. $(".ContentItem.AnswerItem").each(function () {
  1736. if (!($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length > 0 && $(this).find(".ContentItem-time").find("span").text() != null) {
  1737. if ($(this).find(".ContentItem-time").text().indexOf("发布于") == -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip
  1738. {
  1739. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  1740. var oldtext = $(this).find(".ContentItem-time").find("span").text();
  1741. $(this).find(".ContentItem-time").find("span").text(data_tooltip + "\xa0\xa0,\xa0\xa0" + oldtext);
  1742. $(this).find(".ContentItem-time").addClass("full");
  1743. }
  1744. else if ($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip
  1745. {
  1746. let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip");
  1747. $(this).find(".ContentItem-time").find("span").text(data_tooltip);
  1748. $(this).find(".ContentItem-time").addClass("full");
  1749. }
  1750.  
  1751. //发布时间置顶
  1752. if (publishTop == 1) {
  1753. if (!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) {
  1754. let temp_time = $(this).find(".ContentItem-time").clone();
  1755. $(this).find(".RichContent .ContentItem-time").hide();
  1756. $(this).find(".ContentItem-meta").append(temp_time);
  1757. }
  1758. }
  1759. }
  1760.  
  1761. });
  1762. }
  1763.  
  1764. //图片调整到最高清晰度
  1765. function originalPic () {
  1766. if(blockingPictureVideo == 1) //隐藏图片/视频
  1767. {
  1768. $('img').each(function(){
  1769. if($(this).closest('.RichContent-cover').length>0 && !$(this).closest('.RichContent-cover').hasClass('hide')) //未隐藏
  1770. {
  1771. $(this).closest('.RichContent-cover').hide(); //隐藏首页回答封面
  1772. $(this).closest('.RichContent-cover').addClass('hide');
  1773. }
  1774.  
  1775. if($(this).parent().attr('id') != 'nightmode' && !$(this).hasClass('Avatar')) //非夜间模式按钮,非头像
  1776. {
  1777. if(!$(this).hasClass('hide')) //未隐藏
  1778. {
  1779. $(this).hide();
  1780. $(this).addClass('hide');
  1781. }
  1782. }
  1783. });
  1784.  
  1785. $('.ContentItem.ZVideoItem').closest('.TopstoryItem').hide(); //隐藏视频信息流
  1786. }
  1787. else
  1788. {
  1789. $("img").each(function () {
  1790. if ($(this).attr("data-original") != undefined && !$(this).hasClass("comment_sticker")) {
  1791. if ($(this).attr("src") != $(this).attr("data-original"))
  1792. $(this).attr("src", $(this).attr("data-original"));
  1793. }
  1794. });
  1795. }
  1796. }
  1797.  
  1798. //知乎视频下载功能来自脚本https://gf.qytechs.cn/zh-CN/scripts/39206-%E4%B8%8B%E8%BD%BD%E7%9F%A5%E4%B9%8E%E8%A7%86%E9%A2%91
  1799.  
  1800. function downloadVideo () {
  1801. (async () => {
  1802. if (window.location.host == 'www.zhihu.com') return;
  1803.  
  1804. const playlistBaseUrl = 'https://lens.zhihu.com/api/videos/';
  1805. //const videoBaseUrl = 'https://video.zhihu.com/video/';
  1806. const videoId = window.location.pathname.split('/').pop(); // 视频id
  1807. const menuStyle = 'transform:none !important; left:auto !important; right:-0.5em !important;';
  1808. const playerId = 'player';
  1809. const coverSelector = '#' + playerId + ' > div:first-child > div:first-child > div:nth-of-type(2)';
  1810. const controlBarSelector = '#' + playerId + ' > div:first-child > div:first-child > div:last-child > div:last-child > div:first-child';
  1811. const svgDownload = '<path d="M9.5,4 H14.5 V10 H17.8 L12,15.8 L6.2,10 H9.5 Z M6.2,18 H17.8 V20 H6.2 Z"></path>';
  1812. let player = document.getElementById(playerId);
  1813. let resolutionMap = { '标清': 'sd', '高清': 'ld', '超清': 'hd' };
  1814. let videos = []; // 存储各分辨率的视频信息
  1815. let downloading = false;
  1816.  
  1817. function getBrowerInfo () {
  1818. let browser = (function (window) {
  1819. let document = window.document;
  1820. let navigator = window.navigator;
  1821. let agent = navigator.userAgent.toLowerCase();
  1822. // IE8+支持.返回浏览器渲染当前文档所用的模式
  1823. // IE6,IE7:undefined.IE8:8(兼容模式返回7).IE9:9(兼容模式返回7||8)
  1824. // IE10:10(兼容模式7||8||9)
  1825. let IEMode = document.documentMode;
  1826. let chrome = window.chrome || false;
  1827. let system = {
  1828. // user-agent
  1829. agent: agent,
  1830. // 是否为IE
  1831. isIE: /trident/.test(agent),
  1832. // Gecko内核
  1833. isGecko: agent.indexOf('gecko') > 0 && agent.indexOf('like gecko') < 0,
  1834. // webkit内核
  1835. isWebkit: agent.indexOf('webkit') > 0,
  1836. // 是否为标准模式
  1837. isStrict: document.compatMode === 'CSS1Compat',
  1838. // 是否支持subtitle
  1839. supportSubTitle: function () {
  1840. return 'track' in document.createElement('track');
  1841. },
  1842. // 是否支持scoped
  1843. supportScope: function () {
  1844. return 'scoped' in document.createElement('style');
  1845. },
  1846.  
  1847. // 获取IE的版本号
  1848. ieVersion: function () {
  1849. let rMsie = /(msie\s|trident.*rv:)([\w.]+)/;
  1850. let match = rMsie.exec(agent);
  1851. try {
  1852. return match[2];
  1853. } catch (e) {
  1854. return IEMode;
  1855. }
  1856. },
  1857. // Opera版本号
  1858. operaVersion: function () {
  1859. try {
  1860. if (window.opera) {
  1861. return agent.match(/opera.([\d.]+)/)[1];
  1862. }
  1863. else if (agent.indexOf('opr') > 0) {
  1864. return agent.match(/opr\/([\d.]+)/)[1];
  1865. }
  1866. } catch (e) {
  1867. return 0;
  1868. }
  1869. }
  1870. };
  1871.  
  1872. try {
  1873. // 浏览器类型(IE、Opera、Chrome、Safari、Firefox)
  1874. system.type = system.isIE ? 'IE' :
  1875. window.opera || (agent.indexOf('opr') > 0) ? 'Opera' :
  1876. (agent.indexOf('chrome') > 0) ? 'Chrome' :
  1877. //safari也提供了专门的判定方式
  1878. window.openDatabase ? 'Safari' :
  1879. (agent.indexOf('firefox') > 0) ? 'Firefox' :
  1880. 'unknow';
  1881.  
  1882. // 版本号
  1883. system.version = (system.type === 'IE') ? system.ieVersion() :
  1884. (system.type === 'Firefox') ? agent.match(/firefox\/([\d.]+)/)[1] :
  1885. (system.type === 'Chrome') ? agent.match(/chrome\/([\d.]+)/)[1] :
  1886. (system.type === 'Opera') ? system.operaVersion() :
  1887. (system.type === 'Safari') ? agent.match(/version\/([\d.]+)/)[1] :
  1888. '0';
  1889.  
  1890. // 浏览器外壳
  1891. system.shell = function () {
  1892. if (agent.indexOf('edge') > 0) {
  1893. system.version = agent.match(/edge\/([\d.]+)/)[1] || system.version;
  1894. return 'Edge';
  1895. }
  1896. // 遨游浏览器
  1897. if (agent.indexOf('maxthon') > 0) {
  1898. system.version = agent.match(/maxthon\/([\d.]+)/)[1] || system.version;
  1899. return 'Maxthon';
  1900. }
  1901. // QQ浏览器
  1902. if (agent.indexOf('qqbrowser') > 0) {
  1903. system.version = agent.match(/qqbrowser\/([\d.]+)/)[1] || system.version;
  1904. return 'QQBrowser';
  1905. }
  1906. // 搜狗浏览器
  1907. if (agent.indexOf('se 2.x') > 0) {
  1908. return '搜狗浏览器';
  1909. }
  1910.  
  1911. // Chrome:也可以使用window.chrome && window.chrome.webstore判断
  1912. if (chrome && system.type !== 'Opera') {
  1913. let external = window.external;
  1914. let clientInfo = window.clientInformation;
  1915. // 客户端语言:zh-cn,zh.360下面会返回undefined
  1916. let clientLanguage = clientInfo.languages;
  1917.  
  1918. // 猎豹浏览器:或者agent.indexOf("lbbrowser")>0
  1919. if (external && 'LiebaoGetVersion' in external) {
  1920. return 'LBBrowser';
  1921. }
  1922. // 百度浏览器
  1923. if (agent.indexOf('bidubrowser') > 0) {
  1924. system.version = agent.match(/bidubrowser\/([\d.]+)/)[1] ||
  1925. agent.match(/chrome\/([\d.]+)/)[1];
  1926. return 'BaiDuBrowser';
  1927. }
  1928. // 360极速浏览器和360安全浏览器
  1929. if (system.supportSubTitle() && typeof clientLanguage === 'undefined') {
  1930. let storeKeyLen = Object.keys(chrome.webstore).length;
  1931. let v8Locale = 'v8Locale' in window;
  1932. return storeKeyLen > 1 ? '360极速浏览器' : '360安全浏览器';
  1933. }
  1934. return 'Chrome';
  1935. }
  1936. return system.type;
  1937. };
  1938.  
  1939. // 浏览器名称(如果是壳浏览器,则返回壳名称)
  1940. system.name = system.shell();
  1941. // 对版本号进行过滤过处理
  1942. // System.version = System.versionFilter(System.version);
  1943.  
  1944. } catch (e) {
  1945. // console.log(e.message);
  1946. }
  1947.  
  1948. return system;
  1949.  
  1950. })(window);
  1951.  
  1952. if (browser.name == undefined || browser.name == '') {
  1953. browser.name = 'Unknown';
  1954. browser.version = 'Unknown';
  1955. }
  1956. else if (browser.version == undefined) {
  1957. browser.version = 'Unknown';
  1958. }
  1959. return browser;
  1960. }
  1961.  
  1962. function fetchRetry (url, options = {}, times = 1, delay = 1000, checkStatus = true) {
  1963. return new Promise((resolve, reject) => {
  1964. // fetch 成功处理函数
  1965. function success (res) {
  1966. if (checkStatus && !res.ok) {
  1967. failure(res);
  1968. }
  1969. else {
  1970. resolve(res);
  1971. }
  1972. }
  1973.  
  1974. // 单次失败处理函数
  1975. function failure (error) {
  1976. times--;
  1977.  
  1978. if (times) {
  1979. setTimeout(fetchUrl, delay);
  1980. }
  1981. else {
  1982. reject(error);
  1983. }
  1984. }
  1985.  
  1986. // 总体失败处理函数
  1987. function finalHandler (error) {
  1988. throw error;
  1989. }
  1990.  
  1991. function fetchUrl () {
  1992. return fetch(url, options)
  1993. .then(success)
  1994. .catch(failure)
  1995. .catch(finalHandler);
  1996. }
  1997.  
  1998. fetchUrl();
  1999. });
  2000. }
  2001.  
  2002. // 下载指定url的资源
  2003. async function downloadUrl (url, name = (new Date()).valueOf() + '.mp4') {
  2004. let browser = getBrowerInfo();
  2005.  
  2006. // Greasemonkey 需要把 url 转为 blobUrl
  2007. if (GM_info.scriptHandler == 'Greasemonkey') {
  2008. let res = await fetchRetry(url);
  2009. let blob = await res.blob();
  2010. url = URL.createObjectURL(blob);
  2011. }
  2012.  
  2013. // Chrome 可以使用 Tampermonkey 的 GM_download 函数绕过 CSP(Content Security Policy) 的限制
  2014. if (window.GM_download) {
  2015. GM_download({ url, name });
  2016. }
  2017. else {
  2018. // firefox 需要禁用 CSP, about:config -> security.csp.enable => false
  2019. let a = document.createElement('a');
  2020. a.href = url;
  2021. a.download = name;
  2022. // a.target = '_blank';
  2023. document.body.appendChild(a);
  2024. a.click();
  2025. document.body.removeChild(a);
  2026.  
  2027. setTimeout(function () {
  2028. URL.revokeObjectURL(url);
  2029. }, 100);
  2030. }
  2031. }
  2032.  
  2033. function humanSize (size) {
  2034. let n = Math.log(size) / Math.log(1024) | 0;
  2035. return (size / Math.pow(1024, n)).toFixed(0) + ' ' + (n ? 'KMGTPEZY'[--n] + 'B' : 'Bytes');
  2036. }
  2037.  
  2038. if (!player) return;
  2039.  
  2040. // 获取视频信息
  2041. const res = await fetchRetry(playlistBaseUrl + videoId, {
  2042. headers: {
  2043. 'referer': 'refererBaseUrl + videoId',
  2044. 'authorization': 'oauth c3cef7c66a1843f8b3a9e6a1e3160e20' // in zplayer.min.js of zhihu
  2045. }
  2046. }, 3);
  2047. const videoInfo = await res.json();
  2048.  
  2049. // 获取不同分辨率视频的信息
  2050. for (let [key, video] of Object.entries(videoInfo.playlist)) {
  2051. video.name = key;
  2052.  
  2053. if (!videos.find(v => v.width == video.width)) {
  2054. videos.push(video);
  2055. }
  2056. }
  2057.  
  2058. // 按分辨率大小排序
  2059. videos = videos.sort(function (v1, v2) {
  2060. return v1.width == v2.width ? 0 : (v1.width > v2.width ? 1 : -1);
  2061. }).reverse();
  2062.  
  2063. document.addEventListener('DOMNodeInserted', (evt) => {
  2064. let domControlBar = evt.relatedNode.querySelector(':scope > div:last-child > div:first-child');
  2065. if (!domControlBar || domControlBar.querySelector('.download')) return;
  2066.  
  2067. let domFullScreenBtn = domControlBar.querySelector(':scope > div:nth-last-of-type(1)');
  2068. let domResolutionBtn = domControlBar.querySelector(':scope > div:nth-last-of-type(3)');
  2069. let domDownloadBtn, defaultResolution, buttons;
  2070. if (!domFullScreenBtn || !domFullScreenBtn.querySelector('button')) return;
  2071.  
  2072. // 克隆分辨率菜单或全屏按钮为下载按钮
  2073. domDownloadBtn = (domResolutionBtn && (domResolutionBtn.className == domFullScreenBtn.className)) ? domResolutionBtn.cloneNode(true)
  2074. : domFullScreenBtn.cloneNode(true);
  2075.  
  2076. defaultResolution = domDownloadBtn.querySelector('button').innerText;
  2077.  
  2078. // 生成下载按钮图标
  2079. domDownloadBtn.querySelector('button:first-child').outerHTML = domFullScreenBtn.cloneNode(true).querySelector('button').outerHTML;
  2080. domDownloadBtn.querySelector('svg').innerHTML = svgDownload;
  2081. domDownloadBtn.className = domDownloadBtn.className + ' download';
  2082.  
  2083. buttons = domDownloadBtn.querySelectorAll('button');
  2084.  
  2085. // button 元素添加对应的下载地址
  2086. buttons.forEach(dom => {
  2087. let video = videos.find(v => v.name == resolutionMap[dom.innerText || defaultResolution]);
  2088. video = video || videos[0];
  2089. dom.dataset.video = video.play_url;
  2090. if (dom.innerText) {
  2091. (dom.innerText = `${dom.innerText} (${humanSize(video.size)})`);
  2092. }
  2093. else if (buttons.length == 1) {
  2094. dom.nextSibling.querySelector('div').innerText = humanSize(video.size);
  2095. }
  2096. });
  2097.  
  2098. // 鼠标事件 - 显示菜单
  2099. domDownloadBtn.addEventListener('pointerenter', () => {
  2100. let domMenu = domDownloadBtn.querySelector('div:nth-of-type(1)');
  2101. if (domMenu) {
  2102. domMenu.style.cssText = menuStyle + 'opacity:1 !important; visibility:visible !important';
  2103. }
  2104. });
  2105.  
  2106. // 鼠标事件 - 隐藏菜单
  2107. domDownloadBtn.addEventListener('pointerleave', () => {
  2108. let domMenu = domDownloadBtn.querySelector('div:nth-of-type(1)');
  2109. if (domMenu) {
  2110. domMenu.style.cssText = menuStyle;
  2111. }
  2112. });
  2113.  
  2114. // 鼠标事件 - 选择菜单项
  2115. domDownloadBtn.addEventListener('pointerup', event => {
  2116. if (downloading) {
  2117. alert('当前正在执行下载任务,请等待任务完成。');
  2118. return;
  2119. }
  2120.  
  2121. let e = event.srcElement || event.target;
  2122.  
  2123. while (e.tagName != 'BUTTON') {
  2124. e = e.parentNode;
  2125. }
  2126.  
  2127. downloadUrl(e.dataset.video);
  2128. });
  2129.  
  2130. // 显示下载按钮
  2131. domControlBar.appendChild(domDownloadBtn);
  2132.  
  2133. });
  2134. })();
  2135. }
  2136.  
  2137.  
  2138. function addCSS () {
  2139. var css = 'html[data-theme=dark] .css-1qefhqu{background-color:#1A1A1A}' +
  2140. 'html[data-theme=dark] .LeftItem{color:#606A80}' +
  2141. 'html[data-theme=dark] .LeftItem:hover{background-color:#F0F2F7!important}' +
  2142. '#nightmode{color:black}' +
  2143. '#nightmode:hover{color:#0084FF}' +
  2144. 'html[data-theme=dark] #nightmode{color:hsla(0,0%,100%,.8)}' +
  2145. 'html[data-theme=dark] #nightmode:hover{color:#0084FF}' +
  2146. '.Reward{display:none!important}' +
  2147. 'html[data-hover-visible] .VoterList-content .List-item:hover {' +
  2148. ' -webkit-box-shadow: 0 0 0 2px #fff,0.6px 0.4px 0 4px rgba(0,132,255,.3) inset;' +
  2149. ' box-shadow: 0 0 0 2px #fff,0.6px 0.6px 0 4px rgba(0,132,255,.3) inset' +
  2150. '}' +
  2151. '' +
  2152. 'html[data-theme=dark][data-hover-visible] .VoterList-content .List-item:hover {' +
  2153. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0.6px 0.4px 0 4px rgba(58,118,208,.6) inset;' +
  2154. ' box-shadow: 0 0 0 2px #1a1a1a,0.6px 0.4px 0 4px rgba(58,118,208,.6) inset' +
  2155. '}' +
  2156. 'html[data-hover-visible] .QuestionInvitation .List-item:hover {' +
  2157. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset;' +
  2158. ' box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset' +
  2159. '}' +
  2160. '' +
  2161. 'html[data-theme=dark][data-hover-visible] .QuestionInvitation .List-item:hover {' +
  2162. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset;' +
  2163. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset' +
  2164. '}' +
  2165. 'html[data-hover-visible] .List-item .List-item:hover {' +
  2166. ' -webkit-box-shadow: none;' +
  2167. ' box-shadow: none' +
  2168. '}' +
  2169. '' +
  2170. 'html[data-theme=dark][data-hover-visible] .List-item .List-item:hover {' +
  2171. ' -webkit-box-shadow: none;' +
  2172. ' box-shadow: none' +
  2173. '}' +
  2174. 'html[data-hover-visible] .List-item:hover {' +
  2175. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3);' +
  2176. ' box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3)' +
  2177. '}' +
  2178. '' +
  2179. 'html[data-theme=dark][data-hover-visible] .List-item:hover {' +
  2180. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6);' +
  2181. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6)' +
  2182. '}' +
  2183. '' +
  2184. 'html[data-hover-visible] .QuestionAnswer-content:hover {' +
  2185. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3);' +
  2186. ' box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3)' +
  2187. '}' +
  2188. '' +
  2189. 'html[data-theme=dark][data-hover-visible] .QuestionAnswer-content:hover {' +
  2190. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6);' +
  2191. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6)' +
  2192. '}' +
  2193. '' +
  2194. 'html[data-hover-visible] .List-item:hover {' +
  2195. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3);' +
  2196. ' box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3)' +
  2197. '}' +
  2198. '' +
  2199. 'html[data-theme=dark][data-hover-visible] .List-item:hover {' +
  2200. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6);' +
  2201. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6)' +
  2202. '}' +
  2203. 'html[data-hover-visible] .QuestionItem.QuestionWaiting-questionItem:hover {' +
  2204. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3);' +
  2205. ' box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3)' +
  2206. '}' +
  2207. '' +
  2208. 'html[data-theme=dark][data-hover-visible] .QuestionItem.QuestionWaiting-questionItem:hover {' +
  2209. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6);' +
  2210. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6)' +
  2211. '}' +
  2212. 'html[data-hover-visible] .QuestionItem.ToolsQuestionInvited-questionItem:hover {' +
  2213. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3);' +
  2214. ' box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3)' +
  2215. '}' +
  2216. '' +
  2217. 'html[data-theme=dark][data-hover-visible] .QuestionItem.ToolsQuestionInvited-questionItem:hover {' +
  2218. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6);' +
  2219. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6)' +
  2220. '}' +
  2221. 'html[data-hover-visible] .QuestionItem.ToolsQuestionRecommend-questionItem:hover {' +
  2222. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3);' +
  2223. ' box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3)' +
  2224. '}' +
  2225. '' +
  2226. 'html[data-theme=dark][data-hover-visible] .QuestionItem.ToolsQuestionRecommend-questionItem:hover {' +
  2227. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6);' +
  2228. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6)' +
  2229. '}' +
  2230. 'html[data-hover-visible] .css-1v8e53u:hover {' +
  2231. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3);' +
  2232. ' box-shadow: 0 0 0 2px #fff,0 0 0 5px rgba(0,132,255,.3)' +
  2233. '}' +
  2234. '' +
  2235. 'html[data-theme=dark][data-hover-visible] .css-1v8e53u:hover {' +
  2236. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6);' +
  2237. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 5px rgba(58,118,208,.6)' +
  2238. '}' +
  2239. 'html[data-theme=dark][data-hover-visible] .QuestionItem.css-1ob7sqq {' +
  2240. ' border:none;'+
  2241. '}' +
  2242. 'html[data-hover-visible] .QuestionItem.css-1ob7sqq:hover {' +
  2243. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset;' +
  2244. ' box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset; ' +
  2245. '}' +
  2246. '' +
  2247. 'html[data-theme=dark][data-hover-visible] .QuestionItem.css-1ob7sqq:hover {' +
  2248. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset;' +
  2249. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset; ' +
  2250. '}' +
  2251.  
  2252. 'html[data-hover-visible] .HotItem:hover {' +
  2253. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset;' +
  2254. ' box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset ' +
  2255. '}' +
  2256. '' +
  2257. 'html[data-theme=dark][data-hover-visible] .HotItem:hover {' +
  2258. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset;' +
  2259. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset ' +
  2260. '}' +
  2261. 'html[data-hover-visible] .Card.TopstoryItem:hover {' +
  2262. ' -webkit-box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset;' +
  2263. ' box-shadow: 0 0 0 2px #fff,0 0 0 3px rgba(0,132,255,.3) inset' +
  2264. '}' +
  2265. '' +
  2266. 'html[data-theme=dark][data-hover-visible] .Card.TopstoryItem:hover {' +
  2267. ' -webkit-box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset;' +
  2268. ' box-shadow: 0 0 0 2px #1a1a1a,0 0 0 3px rgba(58,118,208,.6) inset' +
  2269. '}' +
  2270. 'html[data-hover-visible] .Card.TopstoryItem .ContentItem-actions{' +
  2271. ' margin-top: 0px;' +
  2272. ' margin-right: -17px;' +
  2273. ' margin-bottom: -10px;' +
  2274. ' margin-left: -17px;' +
  2275. ' padding-top: 10px;' +
  2276. ' padding-right: 17px;' +
  2277. ' padding-bottom: 10px;' +
  2278. ' padding-left: 17px;' +
  2279. '}' +
  2280. 'html[data-hover-visible] .Card.TopstoryItem .ContentItem-actions.is-fixed{' +
  2281. ' margin-top: 0px;' +
  2282. ' margin-right: 0px;' +
  2283. ' margin-bottom: 0px;' +
  2284. ' margin-left: 0px;' +
  2285. ' padding-right: 20px;' +
  2286. ' padding-bottom: 10px;' +
  2287. ' padding-left: 20px;' +
  2288. '}' +
  2289. '.ModalExp-content{' +
  2290. ' display:none!important;' +
  2291. '}' +
  2292. 'html .ColumnPageHeader-Menu .Menu-item{color:black}' +
  2293. 'html[data-theme=dark] .ColumnPageHeader-Menu .Menu-item{color:hsla(0,0%,100%,.8)}' +
  2294. 'html .ColumnPageHeader-Menu .Menu-item.is-active{color:#0084FF}' +
  2295. '.Tabs-link.AppHeader-TabsLink{color:#8590A6}' +
  2296. '.Tabs-link.AppHeader-TabsLink.is-active{color:#0084FF}' +
  2297. 'html[data-theme=dark] .Tabs-link.AppHeader-TabsLink.is-active{color:#0084FF}' +
  2298. '.Tabs-link.AppHeader-TabsLink:hover{color:#0084FF}' +
  2299. 'html[data-theme=dark] .Tabs-link.AppHeader-TabsLink:hover{color:#0084FF}' +
  2300. 'html[data-theme=dark] .QuestionHeader-title{color:#d3d3d3}' +
  2301. 'html[data-theme=dark] .QuestionRichText{color:#d3d3d3}' +
  2302. 'html[data-theme=dark] .RichContent-inner {color:#d3d3d3}' +
  2303. 'html[data-theme=dark] .List-headerText{color:#d3d3d3}' +
  2304. 'html[data-theme=dark] .QuestionInvitation-title{color:#d3d3d3}' +
  2305. 'html[data-theme=dark] div[itemprop=\"zhihu:question\"]{color:#d3d3d3}' +
  2306. 'html[data-theme=dark] .ContentItem-title{color:#d3d3d3}' +
  2307. 'html[data-theme=dark] .HotItem-title{color:#d3d3d3}' +
  2308. 'html[data-theme=dark] .CommentTopbar-title{color:#d3d3d3!important}' +
  2309. 'html[data-theme=dark] .UserLink-link{color:#d3d3d3}' +
  2310. 'html[data-theme=dark] .CommentItemV2-content .RichText{color:#d3d3d3}' +
  2311. 'html[data-theme=dark] .ExploreHomePage-ContentSection-header{color:#d3d3d3}' +
  2312. 'html[data-theme=dark] .ExploreSpecialCard-title{color:#d3d3d3}' +
  2313. 'html[data-theme=dark] .ExploreSpecialCard-contentTitle{color:#d3d3d3}' +
  2314. 'html[data-theme=dark] .ExploreRoundtableCard-questionTitle{color:#d3d3d3}' +
  2315. 'html[data-theme=dark] .ExploreCollectionCard-title{color:#d3d3d3}' +
  2316. 'html[data-theme=dark] .ExploreCollectionCard-contentTitle{color:#d3d3d3}' +
  2317. 'html[data-theme=dark] .ExploreColumnCard-title{color:#d3d3d3}' +
  2318. 'html[data-theme=dark] .ClubItem-name{color:#d3d3d3}' +
  2319. 'html[data-theme=dark] .ClubHeaderInfo-name{color:#d3d3d3}' +
  2320. 'html[data-theme=dark] .ClubHeaderInfo-description{color:#d3d3d3}' +
  2321. 'html[data-theme=dark] .NumberBoard-itemValue{color:#d3d3d3!important}' +
  2322. 'html[data-theme=dark] .Tabs-link.ClubTabs{color:#d3d3d3}' +
  2323. 'html[data-theme=dark] .ClubTopPosts-title{color:#d3d3d3}' +
  2324. 'html[data-theme=dark] .PostItem-headNameText{color:#d3d3d3}' +
  2325. 'html[data-theme=dark] .PostItem-titleText{color:#d3d3d3}' +
  2326. 'html[data-theme=dark] .PostItem-Title{color:#d3d3d3}' +
  2327. 'html[data-theme=dark] .PostItem-Summary{color:#d3d3d3}' +
  2328. 'html[data-theme=dark] .LinkCard-title{color:#d3d3d3}' +
  2329. 'html[data-theme=dark] .css-bb9ulb{color:#d3d3d3}' +
  2330. 'html[data-theme=dark] .CollectionDetailPageHeader-title{color:#d3d3d3}' +
  2331. 'html[data-theme=dark] .CollectionsHeader-tabsLink{color:#d3d3d3}' +
  2332. 'html[data-theme=dark] .SelfCollectionItem-title{color:#d3d3d3}' +
  2333. 'html[data-theme=dark] .Card-headerText{color:#d3d3d3}' +
  2334. 'html[data-theme=dark] .Modal-title{color:#d3d3d3}' +
  2335. 'html[data-theme=dark] .Favlists-itemNameText{color:#d3d3d3}' +
  2336. 'html[data-theme=dark] .ReportMenu-itemValue{color:#d3d3d3}' +
  2337. 'html[data-theme=dark] .ShortcutHintModal-hintTitle{color:#d3d3d3}' +
  2338. 'html[data-theme=dark] .KeyHint{color:#d3d3d3}' +
  2339. 'html[data-theme=dark] .Anonymous-confirm{color:#d3d3d3}' +
  2340. 'html[data-theme=dark] .css-sumlaa svg{fill:#d3d3d3}' +
  2341. 'html[data-theme=dark] .Post-Title{color:#d3d3d3}' +
  2342. 'html[data-theme=dark] .Post-RichTextContainer p{color:#d3d3d3}' +
  2343. 'html[data-theme=dark] body{color:#d3d3d3; background:rgb(18,18,18)}' +
  2344. '.QuestionInvitation .Topbar{cursor:pointer;}' +
  2345. 'html[data-theme=dark] .WriteIndexLayout-main.WriteIndex{border: 1px solid #222}' +
  2346. 'html[data-theme=dark] .zhi{color:#d3d3d3; background-color:rgb(18,18,18)}' +
  2347. '.Zi--FormatBold, .Zi--FormatItalic, .Zi--FormatHeader, .Zi--FormatBlockquote, .Zi--InsertOrderedList, .Zi--InsertUnorderedList, .Zi--InsertReference, .Zi--InsertDivider, .Zi--InsertCatalog {fill: black}' +
  2348. 'html[data-theme=dark] .Zi--FormatBold,html[data-theme=dark] .Zi--FormatItalic,html[data-theme=dark] .Zi--FormatHeader,html[data-theme=dark] .Zi--FormatBlockquote,html[data-theme=dark] .Zi--InsertOrderedList,html[data-theme=dark] .Zi--InsertUnorderedList,html[data-theme=dark] .Zi--InsertReference,html[data-theme=dark] .Zi--InsertDivider ,html[data-theme=dark] .Zi--InsertCatalog{fill: #d3d3d3}' +
  2349. '.Zi--Bell path{fill:rgb(68,68,68)}'+
  2350. '.Zi--Comments path{fill:rgb(68,68,68)}' +
  2351. 'html[data-theme=dark] .Zi--Bell path{fill:#8590a6}' +
  2352. 'html[data-theme=dark] .Zi--Comments path{fill:#8590a6}' +
  2353. '.Zi--Bell:hover path{fill:#FACB62}' +
  2354. '.Zi--Comments:hover path{fill:#00FF7F}' +
  2355. 'html[data-theme=dark] .Zi--Bell:hover path{fill:#FACB62}' +
  2356. 'html[data-theme=dark] .Zi--Comments:hover path{fill:#00FF7F}' +
  2357. '.CommentItemV2-talkBtn .Zi--Comments path{fill:#8590a6}'+
  2358. 'html[data-theme=dark] .CommentItemV2-talkBtn .Zi--Comments path{fill:#8590a6}'+
  2359. '.CommentItemV2-talkBtn:hover .Zi--Comments path{fill:#00FF7F}'+
  2360. 'html[data-theme=dark] .CommentItemV2-talkBtn:hover .Zi--Comments path{fill:#00FF7F}'+
  2361. 'html[data-theme=dark] .Zi--Browser{fill:#8590A6}'+
  2362. 'html[data-theme=dark] .css-w8abe7{background:rgb(18,18,18)}'+
  2363. 'html[data-theme=dark] .css-12qxk2{background:rgb(18,18,18)}'+
  2364. 'html[data-theme=dark] .css-huwkhm{background:rgb(18,18,18)}'+
  2365. 'html[data-theme=dark] .css-akuk2k{background:rgb(18,18,18); border:none}'+
  2366. 'html[data-theme=dark] .css-1v8e53u{border: none}'+
  2367. 'html[data-theme=dark] .css-k0fmhp{color:#d3d3d3}'+
  2368. 'html[data-theme=dark] .css-k0fmhp:hover{color: #6385a6}'+
  2369. 'html[data-theme=dark] .css-t3ae3e{color:#d3d3d3}'+
  2370. 'html[data-theme=dark] .css-1b3v2ql{color:#d3d3d3;}'+
  2371. 'html[data-theme=dark] .css-ke5ir5{color:rgb(133, 144, 166);}'+
  2372. 'html[data-theme=dark] .CreatorHomeDeltaCount-compare{color:#d3d3d3}'+
  2373. 'html[data-theme=dark] .CreatorHomeAnalyticsData-title{color:#d3d3d3}'+
  2374. 'html[data-theme=dark] .CreatorHomeAnalyticsDataItem-type{color:#d3d3d3}'+
  2375. 'html[data-theme=dark] .CreatorHomeUpgradeGuide-title{color:#d3d3d3}'+
  2376. 'html[data-theme=dark] .Tabs-link {color:#d3d3d3}'+
  2377. 'html[data-theme=dark] .CreatorRecruitTitle{color:#d3d3d3!important}'+
  2378. 'html[data-theme=dark] .Title-title-3QaE{color:#d3d3d3}'+
  2379. 'html[data-theme=dark] .ToolsCopyright-FieldName{color:#d3d3d3}'+
  2380. 'html[data-theme=dark] .ToolsCopyright-input{background:#d3d3d3}'+
  2381. 'html[data-theme=dark] .Title-main-1ldU{background:rgb(18,18,18)}'+
  2382. 'html[data-theme=dark] .Title-border-1vTk{background:#8590a65c}'+
  2383. 'html[data-theme=dark] .iframeLive-iframe_live-WojO{background:rgb(18,18,18)}'+
  2384. 'html[data-theme=dark] .iframeLive-certifiedWrapper-pfzZ{background:rgb(18,18,18); border: 1px solid #8590a65c}'+
  2385. 'html[data-theme=dark] .iframeLive-description-2C6O{background:rgb(18,18,18); border: 1px solid #8590a65c}'+
  2386. 'html[data-theme=dark] .iframeLive-explanation-2IxQ{color:#d3d3d3}'+
  2387. 'html[data-theme=dark] .iframeLive-what_zhihu_title-1yQe{color:#d3d3d3}'+
  2388. 'html[data-theme=dark] .iframeLive-public_number_title-3kRs{color:#d3d3d3}'+
  2389. 'html[data-theme=dark] .SettingsFAQ-pageTitle {color:#d3d3d3}'+
  2390. 'html[data-theme=dark] .VideoGallery-root-7Z1Ci{background:rgb(18,18,18)!important}'+
  2391. 'html[data-theme=dark] .css-17714ul{background:rgb(18,18,18)}'+
  2392. 'html[data-theme=dark] .css-1bwzp6r{background:rgb(18,18,18)}'+
  2393. 'html[data-theme=dark] .css-w215gm{background:rgb(18,18,18)}'+
  2394. 'html[data-theme=dark] .css-ul9l2m{background:rgb(18,18,18);}'+
  2395. 'html[data-theme=dark] .css-m1yuwo{border-left: 1px solid #8590a65c}'+
  2396. 'html[data-theme=dark] .css-9ytsk0{border-bottom: 1px solid #8590a65c}'+
  2397. 'html[data-theme=dark] .css-1pp4h0z{border-top: 1px solid #8590a65c}'+
  2398. 'html[data-theme=dark] .css-xevy9w tbody tr:nth-of-type(odd){background:rgb(18,18,18)}'+
  2399. 'html[data-theme=dark] .css-1dah1m2 .css-wdqmif{background:rgb(18,18,18); border-bottom: 1px solid #8590a65c}'+
  2400. '.RichText .lazy[data-lazy-status=ok]{animation:none;}'+
  2401. 'html[data-theme=dark] img{filter: brightness(0.6);}'+
  2402. 'html[data-theme=dark] svg:not([class*="Zi"]){filter: brightness(0.6);}'+
  2403. 'html[data-theme=dark] .ImageAlias{filter: brightness(0.6);}'+
  2404. 'html[data-theme=dark] .ExploreRoundtableCard-headerContainer{filter: brightness(0.6);}'+
  2405. 'html[data-theme=dark] .TitleImage{filter: brightness(0.6);}'+
  2406. 'html[data-theme=dark] .ecommerce-ad-arrow-img{filter: brightness(0.6);}'+
  2407. 'html[data-theme=dark] circle{fill-opacity: 0.6!important;}'+
  2408. 'html[data-theme=dark] .GifPlayer-icon{opacity: 0.6!important;}'+
  2409. 'html[data-theme=dark] .css-iue0mv{background:#d3d3d3}'+
  2410. '.AppHeaderProfileMenu .Button.Menu-item{color:black}'+
  2411. 'html[data-theme=dark] .AppHeaderProfileMenu .Button.Menu-item{color:#d3d3d3}'+
  2412. '.MemberButtonGroup.ProfileButtonGroup.ProfileHeader-buttons .Button--grey.Button--withIcon.Button--withLabel{color: rgb(68, 68, 68);}'+
  2413. '.MemberButtonGroup.ProfileButtonGroup.ProfileHeader-buttons .Button--grey.Button--withIcon.Button--withLabel:hover .Zi--Comments path{fill:#00FF7F}'+
  2414. 'html[data-theme=dark] .MemberButtonGroup.ProfileButtonGroup.ProfileHeader-buttons .Button--grey.Button--withIcon.Button--withLabel{color: #8590A6!important}'+
  2415. '.MemberButtonGroup.AnswerAuthor-buttons .Button--grey.Button--withIcon.Button--withLabel{color: rgb(68, 68, 68);}'+
  2416. '.MemberButtonGroup.AnswerAuthor-buttons .Button--grey.Button--withIcon.Button--withLabel:hover .Zi--Comments path{fill:#00FF7F}'+
  2417. 'html[data-theme=dark] .MemberButtonGroup.AnswerAuthor-buttons .Button--grey.Button--withIcon.Button--withLabel{color: #8590A6;}'+
  2418. '.ztext sup[data-draft-type=reference] {background:yellow; color:black}'+
  2419. 'html[data-theme=dark] .ztext sup[data-draft-type=reference] {background:yellow; color:black}'+
  2420. '.ReferenceList .ReferenceList-backLink{color:#0084ff;}'+
  2421. 'html[data-theme=dark] .ReferenceList .ReferenceList-backLink{color:#0084ff;}'+
  2422. '.ReferenceList li{background:white; color:black}'+
  2423. 'html[data-theme=dark] .ReferenceList li{background:rgb(18,18,18); color:#d3d3d3}'+
  2424. '.ReferenceList li.is-active{background:yellow; color:black}'+
  2425. 'html[data-theme=dark] .ReferenceList li.is-active{background:yellow; color:black}'+
  2426. '.zm-item-tag{color:#0084ff; background:#0084ff1a}'+
  2427. 'html[data-theme=dark] .zg-item-log-detail{border-left: 3px solid #d3d3d340;}'+
  2428. 'html[data-theme=dark] del{background: #0084ff1a;}'+
  2429. '.zg-item-log-detail ins, .zg-item-log-detail ins a{color:#0084ff; background:#0084ff1a}'+
  2430. '.ReportMenu-inner.ReportMenu-options{margin-bottom:20px}'+
  2431. '.ModalButtonGroup.ModalButtonGroup--horizontal{margin-top:20px}'+
  2432. '.TopstoryItem-actionButton{color:#8590A6}'+
  2433. '.TopstoryItem-actionButton:hover{color:#0084FF}'+
  2434. '.TopstoryItem-uninterestTag{color:#8590A6}'+
  2435. '.TopstoryItem-uninterestTag:hover{color:#0084FF}'+
  2436. 'html[data-theme=dark] .TopstoryItem-actionButton{color:#8590A6}'+
  2437. 'html[data-theme=dark] .TopstoryItem-actionButton:hover{color:#0084FF}'+
  2438. 'html[data-theme=dark] .TopstoryItem-uninterestTag{color:#8590A6}'+
  2439. 'html[data-theme=dark] .TopstoryItem-uninterestTag:hover{color:#0084FF}'+
  2440. '.Button.Menu-item{color:#8590A6}' +
  2441. '.Button.Menu-item.is-active{color:black}' +
  2442. 'html[data-theme=dark] .Button.Menu-item:is-active{color:#d3d3d3!important}'+
  2443. 'html[data-theme=dark] .Post-ActionMenu .Button.Menu-item.Button--plain.is-active{color:#d3d3d3!important}'+
  2444. 'html[data-theme=dark] .Post-ActionMenu .Button.Menu-item.Button--plain.is-active .css-17px4ve svg{fill:#d3d3d3!important}'+
  2445. 'html[data-theme=dark] .AnswerItem-selectMenuItem.is-active{color:#d3d3d3!important}'+
  2446. 'html[data-theme=dark] .AnswerItem-selectMenuItem.is-active .css-17px4ve svg{fill:#d3d3d3!important}'+
  2447. 'html[data-theme=dark] .CommentPermission-item.is-active{color:#d3d3d3!important}'+
  2448. 'html[data-theme=dark] .CommentPermission-item.is-active .css-17px4ve svg{fill:#d3d3d3!important}'+
  2449. '.ToolsQuestion-header--action{color:#0084FF}'+
  2450. 'html[data-theme=dark] .ToolsQuestion-header--action{color:#0084FF}'+
  2451. 'html[data-theme=dark] .Button.css-jamz70{color:white; border:none}'+
  2452. 'html[data-theme=dark] .css-l0zkw9{color:#8590A6}'+
  2453. '.SettingsNav-link[href="/settings/mcn"]{display:none!important}'+
  2454. '.SettingsNav-link{color:black}'+
  2455. 'html[data-theme=dark] .SettingsNav-link{color:#d3d3d3}'+
  2456. 'html[data-theme=dark] .SettingsNav-link .Zi--Bell path{fill:#d3d3d3}'+
  2457. '.SettingsNav-link.is-active{color:#0084ff}'+
  2458. '.SettingsNav-link.is-active svg{fill:#0084ff}'+
  2459. '.SettingsNav-link.is-active .Zi--Bell path{fill:#0084ff}'+
  2460. 'html[data-theme=dark] .SettingsNav-link.is-active{color:#0084ff}'+
  2461. 'html[data-theme=dark] .SettingsNav-link.is-active svg{fill:#0084ff}'+
  2462. 'html[data-theme=dark] .SettingsNav-link.is-active .Zi--Bell path{fill:#0084ff}'+
  2463. '.SettingsNav-link:hover {color:#0084ff}'+
  2464. '.SettingsNav-link:hover svg {fill:#0084ff}'+
  2465. '.SettingsNav-link:hover .Zi--Bell path{fill:#0084ff}'+
  2466. 'html[data-theme=dark] .SettingsNav-link:hover{color:#0084ff}'+
  2467. 'html[data-theme=dark] .SettingsNav-link:hover svg{fill:#0084ff}'+
  2468. 'html[data-theme=dark] .SettingsNav-link:hover .Zi--Bell path{fill:#0084ff}'+
  2469. '.Zi--InsertTable{fill:#0084ff}'+
  2470. '.Zi--TableRowNum{fill:#0084ff}'+
  2471. '.Zi--TableColumnNum{fill:#0084ff}'+
  2472. '.ReportMenu-item:hover { background: #8080801c;}'+
  2473. '.ReportInfringement-item:hover { background: #0084ff26;}'+
  2474. '.css-520aav{display:none!important;}'+
  2475. '#nightmode img{filter: brightness(1);!important}'+
  2476. 'html[data-theme=dark] .QuestionTopicReviewCardExtraInfo-cardTitle{color:#d3d3d3}'+
  2477. 'html[data-theme=dark] .MCNLinkCard-title{color:#d3d3d3}'+
  2478. 'html[data-theme=dark] .label-input-label{background-color: #e1eaf2;}'+
  2479. 'div.ModalButtonGroup.ModalButtonGroup--horizontal > button:nth-child(1):not([class="ReportMenu-button"]):hover{background: #8080801c;}'+
  2480. '.Modal:not([class*="BaiduFileSelector"]) .Modal-inner{overflow-y:hidden}'+
  2481. '.Modal-content{overflow-y:hidden}'+
  2482. '.BaiduFileSelector-content{overflow-y:none}'+
  2483. 'html[data-theme=dark] .TopTabNavBar-isLight-bYRj{background:rgb(18,18,18)!important}'+
  2484. 'html[data-theme=dark] .Card-card-2K6v{background:rgb(18,18,18); }'+
  2485. 'html[data-theme=dark] .LiveItem-title-2qes{color:#d3d3d3}'+
  2486. 'html[data-theme=dark] .GlobalSidebar-introItem-24PB h3{color:#d3d3d3}'+
  2487. 'html[data-theme=dark] .Tooltip-tooltip-2Cut.Tooltip-light-3TwZ .Tooltip-tooltipInner-B448{background:rgb(18,18,18)}'+
  2488. 'html[data-theme=dark] .UserLivesPage-page-GSje{background:rgb(18,18,18)}'+
  2489. 'html[data-theme=dark] .Menu-menuInner-2eRf{background:rgb(18,18,18)}'+
  2490. '.Menu-menuItem-1oId:hover{background:#8080801c}'+
  2491. 'html[data-theme=dark] .Menu-menuItem-1oId:hover{background:#8080801c}'+
  2492. 'html[data-theme=dark] .EditorAttachment{background:rgb(18,18,18)}'+
  2493. 'html[data-theme=dark] .css-ovbogu{background:rgb(18,18,18)}'+
  2494. 'html[data-theme=dark] .AppHeader{background:rgb(18,18,18)}'+
  2495. 'html[data-theme=dark] .PubIndex-CategoriesHeader{background:rgb(26,26,26);border:none}'+
  2496. 'html[data-theme=dark] .BottomBar-wrapper-kXb19{background:rgb(18,18,18)!important}'+
  2497. 'html[data-theme=dark] .css-1cs7y3i{color:#d3d3d3}'+
  2498. 'html[data-theme=dark] .TabNavBarItem-tab-MS9i{color:#d3d3d3}'+
  2499. 'html[data-theme=dark] .TabNavBarItem-tab-MS9i.TabNavBarItem-isActive-1iXL{color: rgb(17, 133, 254);}'+
  2500. '.ToolsQuestionInvited-questionList{padding: 0px 20px 20px 20px}'+
  2501. 'html[data-theme=dark] .FeedbackButton-button-3waL{background:#d3d3d3}'+
  2502. 'html[data-theme=dark] .Pub-reader-clear-body{background: #000; color:#000}'+
  2503. 'html[data-theme=dark] .Pub-reader-body{background: #000; color:#000}'+
  2504. 'html[data-theme=dark] .Pub-reader-app-header{background: rgb(18,18,18); border-bottom: 1px solid #444;}'+
  2505. 'html[data-theme=dark] .Pub-reader-app-header .reader-nav{background: rgb(18,18,18);}'+
  2506. 'html[data-theme=dark] .Pub-reader-bottom-bar{background: rgb(18,18,18);}'+
  2507. 'html[data-theme=dark] .Pub-reader-bottom-bar .reader-app-qrcode{color:#d3d3d3;}'+
  2508. 'html[data-theme=dark] .Pub-web-reader .Pub-reader-guidance.pc{background: rgb(18,18,18);}'+
  2509. 'html[data-theme=dark] .Pub-web-reader .reader-container{background: rgb(0,0,0);}'+
  2510. 'html[data-theme=dark] .Pub-web-reader .reader-chapter-content{background: rgb(33,33,35);}'+
  2511. 'html[data-theme=dark] .reader-chapter-content{background: rgb(33,33,35); color:rgb(115,118,125)}'+
  2512. 'html[data-theme=dark] .Pub-web-reader .reader-chapter-content .MPub-reader-trial-finish{color:#d3d3d3}'+
  2513. 'html[data-theme=dark] .Pub-PageHeaderWrapper .PageHeader{background: rgb(18,18,18);}'+
  2514. 'html[data-theme=dark] .Pub-BookInfo h1{color:#d3d3d3}'+
  2515. 'html[data-theme=dark] .Overview .left{color:#d3d3d3}'+
  2516. 'html[data-theme=dark] .reviewHeader div{color:#d3d3d3}'+
  2517. 'html[data-theme=dark] .ReviewCell .content{color:gray}'+
  2518. 'html[data-theme=dark] .TopNavBar-root{background: rgb(18,18,18); border:none}'+
  2519. 'html[data-theme=dark] .TopNavBar-logout{color:#d3d3d3}'+
  2520. 'html[data-theme=dark] .Main{background: rgb(18,18,18);}'+
  2521. 'html[data-theme=dark] .Pub-BookInfo .Label{color: #0084ff;background: #0084ff1a;}'+
  2522. 'html[data-theme=dark] .Labels-labelButton-ioRsP {color: #0084ff;background: #0084ff1a;}'+
  2523. 'html[data-theme=dark] .PubBook-RelativeListItem-info{color:#8590A6}'+
  2524. 'html[data-theme=dark] .PubIndex-book-main .Summary .TabContent .Description{color:#8590A6}'+
  2525. 'html[data-theme=dark] .Pub-BookAuthorItem .AuthorName{color:#d3d3d3}'+
  2526. 'html[data-theme=dark] .PubIndex-book-main .Summary .TabContent .ShortDesc{color:#d3d3d3}'+
  2527. 'html[data-theme=dark] .css-k7kepf{color:#d3d3d3}'+
  2528. 'html[data-theme=dark] .App-root-63J6a{border:1px solid #444}'+
  2529. 'html[data-theme=dark] .Pub-reader-app-header .reader-nav li:after{background: #444}'+
  2530. 'html[data-theme=dark] .Pub-reader-app-header .reader-logo span:before{background: #444}'+
  2531. 'html[data-theme=dark] .Pub-web-reader .Pub-reader-catalogue li{border-bottom:1px solid #444}'+
  2532. 'html[data-theme=dark] .Pub-web-reader .Pub-reader-catalogue:before{background: #444}'+
  2533. 'html[data-theme=dark] .css-lcfru7, html[data-theme=dark] .css-xnl4yp {border-bottom:1px solid #444}'+
  2534. 'html[data-theme=dark] .zm-topic-topbar{border-bottom:1px solid #444}'+
  2535. 'html[data-theme=dark] .SelfCollectionItem-innerContainer{border-bottom:1px solid #444}'+
  2536. 'html[data-theme=dark] .zm-item+.zm-item{border-top:1px solid #444}'+
  2537. 'html[data-theme=dark] .zh-footer .content{border-top:1px solid #444}'+
  2538. 'html[data-theme=dark] .zm-side-section+.zm-side-section>.zm-side-section-inner{border-top:1px solid #444}'+
  2539. 'html[data-theme=dark] .zg-btn-white.zu-button-more{background: rgb(18,18,18); color:#3a76d0!important; border-color:#3a76d0; box-shadow:none; text-shadow:none}'+
  2540. 'html[data-theme=dark] .css-r9mkgf{background: rgb(18,18,18);}'+
  2541. 'html[data-theme=dark] .css-jwse5c, html[data-theme=dark] .css-1zcaix, html[data-theme=dark] .css-4a3k6y, html[data-theme=dark] .css-eonief{color:#d3d3d3;}'+
  2542. 'html[data-theme=dark] .css-hd7egx{color:#d3d3d3; border-color:#444}'+
  2543. 'html[data-theme=dark] .css-1fnir59, html[data-theme=dark] .css-t3f0zn, html[data-theme=dark] .css-1cj0s4z{background: rgb(18,18,18);}'+
  2544. 'html[data-theme=dark] .Pub-BookVipEntrance{filter: brightness(0.6);}'+
  2545. 'html[data-theme=dark] div.css-1b0ypf8 > div.css-1sqjzsk > div.css-tr5tvs > img{filter: brightness(1);}'+
  2546. 'html[data-theme=dark] .ColumnHomeTop:before{background:none}'+
  2547. 'html[data-theme=dark] .ColumnHomeBottom{background:none}'+
  2548. 'html[data-theme=dark] .HybridLink.Home-topic{cursor:pointer}'+
  2549. 'html[data-theme=dark] .WikiLandingWelcome-main h2{color:#d3d3d3}'+
  2550. 'html[data-theme=dark] .WikiLandingExcellentItems-title{color:#d3d3d3}'+
  2551. 'html[data-theme=dark] .WikiLandingExcellentItems-calcWrapper .WikiLandingExcellentItems-name{color:#d3d3d3}'+
  2552. 'html[data-theme=dark] .WikiLandingItemCard-title{color:#d3d3d3}'+
  2553. 'html[data-theme=dark] .WikiLandingGuide-title{color:#d3d3d3}'+
  2554. 'html[data-theme=dark] .WikiLandingCarousel-author .UserLink-link{color:#d3d3d3}'+
  2555. 'html[data-theme=dark] .WikiLandingContributor-title{color:#d3d3d3}'+
  2556. 'html[data-theme=dark] .WikiLandingRight-title{color:#d3d3d3}'+
  2557. 'html[data-theme=dark] .WikiLandingRight-right .WikiLandingRight-name{color:#d3d3d3}'+
  2558. 'html[data-theme=dark] .WikiLandingEditBoard-title{color:#d3d3d3}'+
  2559. 'html[data-theme=dark] .WikiLandingNavSelector-navItem{color:#d3d3d3}'+
  2560. 'html[data-theme=dark] .BalanceDashboard-Currency-Number{color:#d3d3d3}'+
  2561. 'html[data-theme=dark] .BalanceDashboard h1{color:#d3d3d3}'+
  2562. 'html[data-theme=dark] .BalanceDashboard-Currency-Label{color:#d3d3d3}'+
  2563. 'html[data-theme=dark] .ClubSliderList-name{color:#d3d3d3}'+
  2564. 'html[data-theme=dark] .BalanceTransactionList-Item:nth-child(2n) {background-color: hsla(0, 0%, 97%, 0.03);}'+
  2565. '.WikiLandingNavSelector-navItem--active, html[data-theme=dark] .WikiLandingNavSelector-navItem--active{color: #5868d1;}'+
  2566. 'html[data-theme=dark] .WikiLandingGuide-wiki .WikiLandingGuide-image{filter: brightness(0.6);}'+
  2567. 'html[data-theme=dark] .WikiLandingGuide-abstract .WikiLandingGuide-image{filter: brightness(0.6);}'+
  2568. 'html[data-theme=dark] ._Coupon_intro_1kIo{filter: brightness(0.6);}'+
  2569. 'html[data-theme=dark] ._Coupon_item_34n9{filter: brightness(0.6);}'+
  2570. 'html[data-theme=dark] .Community-ContentLayout{background:black}'+
  2571. 'html[data-theme=dark] .css-dainun{background:rgb(18,18,18); border-bottom:1px solid #444}'+
  2572. 'html[data-theme=dark] .css-1t8cvcr{border-right:1px solid #444}'+
  2573. 'html[data-theme=dark] .css-104x2kz{ border-bottom:1px solid #444;}'+
  2574. 'html[data-theme=dark] .css-16kxzh3{ border-bottom:1px solid #444; border-left:1px solid #444}'+
  2575. 'html[data-theme=dark] .css-18xitnw{ border-top:1px solid #444;}'+
  2576. 'html[data-theme=dark] .css-11v4451{background:rgb(18,18,18)}'+
  2577. 'html[data-theme=dark] .css-m9gn5f{background:rgb(18,18,18)}'+
  2578. 'html[data-theme=dark] .css-cmuys0{color:#d3d3d3}'+
  2579. 'html[data-theme=dark] .css-14chytt{color:#d3d3d3}'+
  2580. 'html[data-theme=dark] .css-1hhi6j5{color:#d3d3d3}'+
  2581. 'html[data-theme=dark] .css-1d7g4vp{color:#d3d3d3}'+
  2582. 'html[data-theme=dark] .css-1c4skpi{color:#d3d3d3; border-bottom:1px solid #444;}'+
  2583. 'html[data-theme=dark] .css-yu9w3k{color:#d3d3d3; border-bottom:1px solid #444;}'+
  2584. 'html[data-theme=dark] .css-1117lk0:hover .css-yu9w3k{color: rgb(68, 68, 68); border:none}'+
  2585. 'html[data-theme=dark] .css-m9gn5f:hover{background-color: rgb(246, 246, 246);}'+
  2586. 'html[data-theme=dark] .css-m9gn5f:hover .css-yu9w3k{background-color: rgb(246, 246, 246);color: rgb(68, 68, 68); border:none}'+
  2587. 'html[data-theme=dark] .AbstractCard-header:after,html[data-theme=dark] .AbstractCard-header:before{opacity: 0.1}'+
  2588. 'html[data-theme=dark] .css-gvm7n2::before { background-image: linear-gradient(to right, #0084ff00, #0084ffd4);}'+
  2589. 'html[data-theme=dark] .css-gvm7n2{color: #f6f6f6;background: #0084ffd4;}'+
  2590. 'html[data-theme=dark] .css-1dz0u0s{background: #d3d3d3;}'+
  2591. 'html[data-theme=dark] .community-copyright-form input,html[data-theme=dark] .community-copyright-form textarea{background: #ddd;}'+
  2592. 'html[data-theme=dark] ._Slogan_sloganWrapper_2E5y{background: #d3d3d3;}'+
  2593. 'html[data-theme=dark] .CopyrightSettings h2{color: #d3d3d3;}'+
  2594. 'html[data-theme=dark] .CopyrightSettings-setall-tip{color: #d3d3d3;}'+
  2595. 'html[data-theme=dark] .community-copyright-form .copies-item-add-button .text{color: #d3d3d3;}'+
  2596. 'html[data-theme=dark] .sprite-community-copyright,html[data-theme=dark] [class*=sprite-community-copyright-]{border:none; border-radius:16px;}'+
  2597. 'html[data-theme=dark] .tab-navs{border-bottom: 1px solid #444}'+
  2598. 'html[data-theme=dark] .community-copyright-faq dt:first-child{border-top: 1px solid #444}'+
  2599. 'html[data-theme=dark] .community-copyright-faq dt{border-bottom: 1px solid #444}'+
  2600. 'html[data-theme=dark] .css-19mtex{border-top: 1px solid #444}'+
  2601. '.AdblockBanner{display:none!important}'+
  2602. '._7akbfp{color:white!important}'+
  2603. 'html[data-theme=dark] #player{filter: brightness(0.6);}'+
  2604. 'html[data-theme=dark] .PubIndex-book-main .BasicInfo .Actions{border-top: 1px solid #444;}'+
  2605. 'html[data-theme=dark] .PubIndex-book-main .Summary .TabContent .ToggleCollapse{border-top: 1px solid #444;}'+
  2606. 'html[data-theme=dark] .ReviewCell{border-top: 1px solid #444;}'+
  2607. 'html[data-theme=dark] .PubIndex-book-aside .ToggleCollapse{border-top: 1px solid #444;}'+
  2608. 'html[data-theme=dark] .PubIndex-book-main .Summary .TabContent .ExtInfo{border-top: 1px solid #444;}'+
  2609. 'html[data-theme=dark] .PubIndex-book-main .Summary .MPub-reader-chapter li{border-bottom-color:#444}'+
  2610. 'html[data-theme=dark] .PubIndex-book-main .Summary .MPub-reader-chapter li:hover span{color:#404040}'+
  2611. 'html[data-theme=dark] .PubIndex-book-main .Summary .MPub-reader-chapter li.level-1:before{background:#d3d3d3}'+
  2612. 'html[data-theme=dark] .PubIndex-book-main .Summary .MPub-reader-chapter li.level-1:hover:before{background:#404040}'+
  2613. 'html[data-theme=dark] .PubIndex-book-aside .ToBePublisher .Link{color:#404040}'+
  2614. 'html[data-theme=dark] .PubAsideNavs .NavItem:after{background:rgb(26,26,26)}'+
  2615. 'html[data-theme=dark] .Pub-web-reader .Pub-reader-guidance h3 span.title{color:#bfbfbf}'+
  2616. 'html[data-theme=dark] .Pub-web-reader .Pub-reader-guidance .operation-names{color:#bfbfbf}'+
  2617. 'html[data-theme=dark] .CornerButton{background: #1a1a1a;}'+
  2618. '.CornerButton .Zi--BackToTop{fill:#8590A6;}'+
  2619. '.CornerButton:hover .Zi--BackToTop{fill:#0084FF;}'+
  2620. '.CornerButton:hover .Zi--BackToTop:hover{fill:#0084FF;}'+
  2621. 'html[data-theme=dark] .CornerButton .Zi--BackToTop{fill:#8590A6;}'+
  2622. 'html[data-theme=dark] .CornerButton:hover .Zi--BackToTop{fill:#0084FF;}'+
  2623. 'html[data-theme=dark] .CornerButton:hover .Zi--BackToTop:hover{fill:#0084FF;}'+
  2624. 'html[data-theme=dark] .Main header{border-bottom: 1px solid #444;}'+
  2625. 'html[data-theme=dark] .Main .params section{border-bottom: 1px solid #444;}'+
  2626. 'html[data-theme=dark] .App-root-fNRdG{border: 1px solid #444;}'+
  2627. 'html[data-theme=dark] .Popover-content-fGkPm.Bubble-content-fdv1v{border: none!important;}'+
  2628. 'html[data-theme=dark] .SignFlowHomepage{filter:brightness(0.6);}'+
  2629. 'html[data-theme=dark] .css-zvnmar{background:rgb(18,18,18);}'+
  2630. 'html[data-theme=dark] .css-1pk3pp1{background:rgb(18,18,18);}'+
  2631. 'html[data-theme=dark] .SignFlow-captchaContainer.Captcha-chinese{background:rgb(18,18,18);}'+
  2632. 'html[data-theme=dark] .SignContainer-inner{background:rgb(18,18,18);}'+
  2633. 'html[data-theme=dark] .Login-socialLogin{background:rgb(18,18,18);}'+
  2634. 'html[data-theme=dark] .SignContainer-content input{background:rgb(18,18,18)!important; color:white!important}'+
  2635. 'html[data-theme=dark] .css-1vs8y1g{border-top: 1px solid #444;}'+
  2636. 'html[data-theme=dark] .ZVideoLinkCard-title{color:#d3d3d3}'+
  2637. 'html[data-theme=dark] .ZVideo-title{color:#d3d3d3}'+
  2638. 'html[data-theme=dark] .LinkCard-title{color:#d3d3d3}'+
  2639. 'html[data-theme=dark] .ecommerce-ad-arrow-main-content-des span{color:#d3d3d3!important}'+
  2640. 'html[data-theme=dark] .ArticleLinkCard-title{color:#d3d3d3}'+
  2641. 'html[data-theme=dark] .ProfileHeader-detail{color:#d3d3d3}'+
  2642. 'html[data-theme=dark] .BlockTitle{color:#d3d3d3}'+
  2643. 'html[data-theme=dark] .FormulaModal-formula img{filter: invert(1);}'+
  2644. 'html[data-theme=dark] .MCNLinkCard-price{color:#ff7955cc}'+
  2645. 'html[data-theme=dark] .MCNLinkCard-button{color:#ff7955cc}'+
  2646. 'html[data-theme=dark] .css-10rt8mt{background: #D3D3D3} '+
  2647. 'html[data-theme=dark] .css-j3ksul{color: #D3D3D3} '+
  2648. 'html[data-theme=dark] .css-13ry121{color: #D3D3D3} '+
  2649. 'html[data-theme=dark] .css-17sk48h{background: #D3D3D3} '+
  2650. 'html[data-theme=dark] .css-6pi7dw{background: #D3D3D3} '+
  2651. 'html[data-theme=dark] .css-1djl0i{color: #D3D3D3} '+
  2652. 'html[data-theme=dark] .css-ya4ahl{color: #D3D3D3} '+
  2653. 'html[data-theme=dark] .css-rpq3do{background: #D3D3D3} '+
  2654. 'html[data-theme=dark] .css-1fod326{background: #D3D3D3} '+
  2655. 'html[data-theme=dark] .css-1lywtmg{color: #D3D3D3} '+
  2656. 'html[data-theme=dark] .css-1sxqbyv{color: #D3D3D3} '+
  2657. 'html[data-theme=dark] .css-noi2nm{background: #f6f6f699} '+
  2658. 'html[data-theme=dark] .OpenInAppButton{display:none!important}'+
  2659. 'html[data-theme=dark] .css-1rmxt0r{background:rgb(18,18,18)}'+
  2660. 'html[data-theme=dark] .css-17cflso{background:rgb(18,18,18)}'+
  2661. 'html[data-theme=dark] .css-148dlpw{background:rgb(18,18,18)}'+
  2662. 'html[data-theme=dark] .css-pxupqe{background:rgb(18,18,18)}'+
  2663. 'html[data-theme=dark] .css-u6lvao{background:rgb(18,18,18)}'+
  2664. 'html[data-theme=dark] .css-u6lvao:before{background:rgb(18,18,18)}'+
  2665. 'html[data-theme=dark] .css-u6lvao:after{background:rgb(18,18,18)}'+
  2666. 'html[data-theme=dark] .css-i6cwu4{background:rgb(18,18,18)}'+
  2667. 'html[data-theme=dark] .Section-title-6pXgn{color: #D3D3D3} '+
  2668. 'html[data-theme=dark] .NewVipJointCard-info-kVD8s{color: #D3D3D3;} '+
  2669. 'html[data-theme=dark] .SectionTitle-title-hm9BX{color: #D3D3D3} '+
  2670. 'html[data-theme=dark] .OtherPrivileges-vipPrivilegeItem-2wWQh .OtherPrivileges-title-5TbKp{color: #D3D3D3} '+
  2671. 'html[data-theme=dark] .App-vipCard-smjUr{filter: brightness(0.6);}'+
  2672. 'html[data-theme=dark] .App-rightsTitle-mSEk4{color: #D3D3D3} '+
  2673. 'html[data-theme=dark] .App-vipBookItem-cdBqb{color: #D3D3D3} '+
  2674. 'html[data-theme=dark] .App-contentRightsItem-8pbnH{color: #D3D3D3} '+
  2675. 'html[data-theme=dark] .App-activityItem-9ttFQ{color: #D3D3D3} '+
  2676. 'html[data-theme=dark] .AlbumColumnMagazineWebPage-title-wN4vV{color: #D3D3D3} '+
  2677. 'html[data-theme=dark] .Tabs-tab-rmJ5e.Tabs-active-modB7{color: #D3D3D3} '+
  2678. 'html[data-theme=dark] .Section-title-pJASK{color: #D3D3D3} '+
  2679. 'html[data-theme=dark] .Contents-chapterCommonTitle-ss2nC{color: #D3D3D3} '+
  2680. 'html[data-theme=dark] .ChapterCard-title-wFeeZ{color: #D3D3D3} '+
  2681. 'html[data-theme=dark] .SkuCell-title-bHvuZ{color: #D3D3D3} '+
  2682. 'html[data-theme=dark] .css-14mfnik{background: rgb(27, 27, 27)} '+
  2683. 'html[data-theme=dark] .GifPlayer.isPlaying .GifPlayer-icon{opacity: 0!important}'+
  2684. 'html[data-theme=dark] .GifPlayer.isPlaying .GifPlayer-gif2mp4{filter:brightness(0.6)}'+
  2685. 'html[data-theme=dark] .GifPlayer.isPlaying .GifPlayer-gif2mp4+img{opacity: 0!important}'+
  2686. 'html[data-theme=dark] .css-1sry9ao{background:rgb(18,18,18)}'+
  2687. 'html[data-theme=dark] .css-b1npk4{color: #D3D3D3} '+
  2688. 'html[data-theme=dark] .css-1stnbni:hover .css-b1npk4{color: black}'+
  2689. 'html[data-theme=dark] .VersatileModuleRenderer-module-kEzfc .VersatileModuleRenderer-skuTitle-mDcPo{color: #D3D3D3} '+
  2690. 'html[data-theme=dark] .CreatorRecruitHeader-title{color: #D3D3D3!important} '+
  2691. 'html[data-theme=dark] .css-1b1irul{filter:brightness(0.6)}'+
  2692. 'html[data-theme=dark] .css-125jmqu{filter:brightness(0.6)}'+
  2693. 'html[data-theme=dark] .css-1y2wwyj{filter:brightness(0.6)}'+
  2694. 'html[data-theme=dark] .css-1xxg9xm{color: #0084FF} '+
  2695. 'html[data-theme=dark] .css-uq88u1{color: #d3d3d3} '+
  2696. 'html[data-theme=dark] .css-dh57eh{color: #d3d3d3} '+
  2697. 'html[data-theme=dark] .css-1j6wofp{color: #d3d3d3} '+
  2698. 'html[data-theme=dark] .css-jwu58x{color: #d3d3d3} '+
  2699. 'html[data-theme=dark] .css-1851dda{color: #d3d3d3} '+
  2700. 'html[data-theme=dark] .css-1yhwbu2{color: #d3d3d3} '+
  2701. 'html[data-theme=dark] .css-1xg9zz8{color: #d3d3d3} '+
  2702. 'html[data-theme=dark] .css-147d5r2{color: #d3d3d3} '+
  2703. 'html[data-theme=dark] .css-103ktxc{color: #d3d3d3} '+
  2704. 'html[data-theme=dark] .css-sfliv9{color: rgb(153, 153, 153);} '+
  2705. 'html[data-theme=dark] .css-jt1vdv{border-bottom: 1px solid #d3d3d3; border-color:#d3d3d3} '+
  2706. 'html[data-theme=dark] .css-1da4iq8{background:rgb(18,18,18); border:1px solid #2e2e2e}'+
  2707. 'html[data-theme=dark] .css-oqge09{background:rgb(18,18,18); border:1px solid #2e2e2e}'+
  2708. 'html[data-theme=dark] .css-1s46lii{background:rgb(18,18,18);}'+
  2709. 'html[data-theme=dark] .KfeCollection-GoodsCardV2-detail-title{color:#d3d3d3}'+
  2710. 'html[data-theme=dark] .KfeCollection-GoodsCardV2-cover-label{color:black}'+
  2711. 'html[data-theme=dark] .ColumnMagazineWeb-newBottomBar-idP5i{background:rgb(18,18,18); border-top:1px solid #2e2e2e}'+
  2712. 'html[data-theme=dark] svg.NewBottomBar-defaultColor-3FMr6:not([class*="NewBottomBar-active-hvaTK"]){filter:invert(1) brightness(0.6)}'+
  2713. 'html[data-theme=dark] .HeaderInfo-root-gnEfo{filter: brightness(0.6)}'+
  2714. 'html[data-theme=dark] .AuthorsSection-headerTitle-xjzpp{color:#d3d3d3}'+
  2715. 'html[data-theme=dark] .CatalogModule-title-sggN4{color:#d3d3d3}'+
  2716. 'html[data-theme=dark] a.UserCell-link-hyWMo{color:#d3d3d3}'+
  2717. 'html[data-theme=dark] .MyShelf-title-qA1gu{color:#d3d3d3}'+
  2718. 'html[data-theme=dark] .RecommendFeed-title-x2nEt{color:#d3d3d3}'+
  2719. 'html[data-theme=dark] .RecommendFeed-skuTitle-otRGK{color:#d3d3d3!important}'+
  2720. 'html[data-theme=dark] .MemberInfoPanel-userName-boKER{color:#d3d3d3!important}'+
  2721. 'html[data-theme=dark] .TopNavBar-inner-baxks .TopNavBar-tab-hBAaU a{color:#d3d3d3}'+
  2722. '.TopNavBar-logoContainer-vDhU2 .TopNavBar-zhihuLogo-jzM1f{color:#0084ff}'+
  2723. 'html[data-theme=dark] .TopNavBar-logoContainer-vDhU2 .TopNavBar-zhihuLogo-jzM1f{color:#0084ff}'+
  2724. 'html[data-theme=dark] .RankingList-header-eSGqm .RankingList-tabList-usmMt .RankingList-tabItem-pTnCd{color:#d3d3d3}'+
  2725. 'html[data-theme=dark] .RankingList-header-eSGqm .RankingList-tabList-usmMt .RankingList-tabItem-pTnCd.RankingList-active-mh1YB{color:#ce994f}'+
  2726. 'html[data-theme=dark] .RankingList-header-eSGqm .RankingList-tabList-usmMt .RankingList-title-nDS4G{color:#d3d3d3}'+
  2727. 'html[data-theme=dark] .RankingList-skuItem-hpJpz .RankingList-title-nDS4G{color:#d3d3d3}'+
  2728. 'html[data-theme=dark] .RankingList-skuItem-hpJpz .RankingList-author-fH328{color:#d3d3d3}'+
  2729. 'html[data-theme=dark] .SaltItem-title-th5Li{color:#d3d3d3}'+
  2730. 'html[data-theme=dark] .ShelfCell-title-bztZM{color:#d3d3d3}'+
  2731. '.TopNavBar-root-hektz .TopNavBar-userInfo-kfSJK .TopNavBar-icon-9TVP7 .Zi--Bell path{fill:#d3d3d3}'+
  2732. '.TopNavBar-root-hektz .TopNavBar-userInfo-kfSJK .TopNavBar-icon-9TVP7 .Zi--Comments path{fill:#d3d3d3}'+
  2733. '.TopNavBar-root-hektz.TopNavBar-fixMode-29iHi .TopNavBar-userInfo-kfSJK .TopNavBar-icon-9TVP7 .Zi--Bell path{fill:black}'+
  2734. '.TopNavBar-root-hektz.TopNavBar-fixMode-29iHi .TopNavBar-userInfo-kfSJK .TopNavBar-icon-9TVP7 .Zi--Comments path{fill:black}'+
  2735. 'html[data-theme=dark] .TopNavBar-root-hektz.TopNavBar-fixMode-29iHi .TopNavBar-userInfo-kfSJK .TopNavBar-icon-9TVP7 .Zi--Bell path{fill:#8590A6}'+
  2736. 'html[data-theme=dark] .TopNavBar-root-hektz.TopNavBar-fixMode-29iHi .TopNavBar-userInfo-kfSJK .TopNavBar-icon-9TVP7 .Zi--Comments path{fill:#8590A6}'+
  2737. 'html[data-theme=dark] .RankingList-root-ontG8{background:rgb(18,18,18)}'+
  2738. 'html[data-theme=dark] .ProductCell-title-ar7kK{color:#d3d3d3}'+
  2739. 'html[data-theme=dark] .ProductItemVertical-title-7SkbW{color:#d3d3d3}'+
  2740. 'html[data-theme=dark] .LiveAppointmentItem-title-djRgc{color:#d3d3d3}'+
  2741. 'html[data-theme=dark] .CoverStory-bigTitle-r5fk8{color:#d3d3d3}'+
  2742. 'html[data-theme=dark] .CarouselBanner-leftTurnPageBtn-jxet9, html[data-theme=dark] .CarouselBanner-rightTurnPageBtn-gFDYQ{color:#d3d3d3}'+
  2743. 'html[data-theme=dark] .css-1v0m2e8{color:#d3d3d3}'+
  2744. 'html[data-theme=dark] .MyShelf-bookCell-d1F4t .MyShelf-bookInfo-rXqus .MyShelf-bookTitle-sYXGP{color:#d3d3d3}'+
  2745. 'html[data-theme=dark] .SuperStarList-title-iem6E{color:#d3d3d3}'+
  2746. 'html[data-theme=dark] .SuperStarList-starCell-b5kon.SuperStarList-active-fqY4e .SuperStarList-name-fXz2f{color:#d3d3d3}'+
  2747. 'html[data-theme=dark] .SuperStarList-starCell-b5kon .SuperStarList-name-fXz2f:hover{color:#d3d3d3}'+
  2748. 'html[data-theme=dark] .MenuBar-root-v61Qh{border-bottom:10px solid rgb(18,18,18)}'+
  2749. '.Card.css-8z7gkt{display:none!important;}'+
  2750. 'html[data-theme=dark] .ManuscriptTitle-root-vhZzG{color:#d3d3d3}'+
  2751. 'html[data-theme=dark] .ProductCardNew-title-7X4Ff{color:#d3d3d3}'+
  2752. 'html[data-theme=dark] .TopNavBar-inner-baxks .TopNavBar-searchBar-wM9EY .TopNavBar-searchBtn-n4UgZ{filter:brightness(0.9)}'+
  2753. 'html[data-theme=dark] .MemberInfoPanel-info-fqJU8 .MemberInfoPanel-memberBtn-9B2nK{filter:brightness(0.9)}'+
  2754. '.Tabs-link.AppHeader-TabsLink{color:black}'+
  2755. 'html[data-theme=dark] .css-1pwpt4d{color:#d3d3d3}'+
  2756. 'html[data-theme=dark] .css-piu9of{color:#d3d3d3}'+
  2757. 'html[data-theme=dark] .css-rk0pq{color:#d3d3d3}'+
  2758. 'html[data-theme=dark] .css-p8hfce{color:#d3d3d3}'+
  2759. 'html[data-theme=dark] .css-kwnxmp{color:#d3d3d3}'+
  2760. 'html[data-theme=dark] .css-bc6idi{color:#d3d3d3}'+
  2761. 'html[data-theme=dark] .css-8u7moq{color:#d3d3d3}'+
  2762. 'html[data-theme=dark] .css-c0lyvn{color:#d3d3d3}'+
  2763. 'html[data-theme=dark] .css-1204lgo{color:#d3d3d3}'+
  2764. 'html[data-theme=dark] .css-17t0kok{color:#8590a6}'+
  2765. 'html[data-theme=dark] .css-1xegbra{background-color:#d3d3d3}'+
  2766. 'html[data-theme=dark] .css-80i0x3{background-color:#d3d3d3}'+
  2767. 'html[data-theme=dark] .css-1akafz2{background-color:#d3d3d3}'+
  2768. 'html[data-theme=dark] .css-16zrry9{background-color:rgb(18,18,18)}'+
  2769. 'html[data-theme=dark] .css-ygii7h{background-color:rgb(18,18,18)}'+
  2770. 'html[data-theme=dark] .css-1f47p0s{border-bottom:1px solid #444}'+
  2771. 'html[data-theme=dark] .css-19rbssv{border-bottom:1px solid #444}'+
  2772. 'html[data-theme=dark] .css-wooxo5 + .CreationManage-CreationCard{border-top:1px solid #444}'+
  2773. 'html[data-theme=dark] .css-90w7z{border-color: #444}'+
  2774. 'html[data-theme=dark] .SkuTitle-skuTitleText-iVc91{color:#d3d3d3!important}'+
  2775. 'html[data-theme=dark] .GalleryCell-title-38fBA{color:#d3d3d3!important}'+
  2776. 'html[data-theme=dark] .GalleryCell-footer-h9wzn{color:#d3d3d3!important}'+
  2777. 'html[data-theme=dark] .VideoMask-duration-2dQ3k{color:#d3d3d3!important}'+
  2778. '.MemberButtonGroup.ProfileButtonGroup.HoverCard-buttons .Button--grey:hover .Zi--Comments path{fill:rgb(0,255,127)}'+
  2779. '.MemberButtonGroup.ProfileButtonGroup.ProfileMain-buttons .Button--grey:hover .Zi--Comments path{fill:rgb(0,255,127)!important}'+
  2780. 'html[data-theme=dark] .MemberButtonGroup.ProfileButtonGroup.ProfileHeader-buttons .Button--grey.Button--withIcon.Button--withLabel:hover{color:rgb(0,255,127)!important}'+
  2781. 'html[data-theme=dark] .PushNotifications-item{color:#d3d3d3!important}'+
  2782. 'html[data-theme=dark] .Messages-item{color:#d3d3d3}'+
  2783. 'html[data-theme=dark] .Messages-myMessageTab{color:#d3d3d3}'+
  2784. 'html[data-theme=dark] .Messages-myMessageTab:hover{color:#d3d3d3}'+
  2785. 'html[data-theme=dark] .ChatBoxModal-closeIcon{fill:#d3d3d3}'+
  2786. '.Notifications-footer > a:nth-child(2):hover{color:#0084ff}'+
  2787. 'html[data-theme=dark] .Notifications-Main>header h1{color:#d3d3d3}'+
  2788. 'html[data-theme="dark"] .Notifications-Section-header h2{color:#d3d3d3}'+
  2789. 'html[data-theme=dark] .NotificationList-Item-content{color:#d3d3d3}'+
  2790. '.Messages-footer .Button:hover{color:#0084ff!important}'+
  2791. 'html[data-theme=dark] .TopSearch-itemLink{color:#d3d3d3}'+
  2792. 'html[data-theme=dark] .RelatedCommodities-subject{color:#d3d3d3}'+
  2793. 'html[data-theme=dark] .SearchTopicHeader-IntroductionWrapper{color:#d3d3d3}'+
  2794. 'html[data-theme=dark] .RichContent-cover-duration{color:#d3d3d3}'+
  2795. 'html[data-theme=dark] .WriteIndex-pageTitle{color:#d3d3d3}'+
  2796. 'html[data-theme=dark] .Club-Search-Name{color:#d3d3d3}'+
  2797. 'html[data-theme=dark] .Club-Search-WebContent .Club-Search-Desc{color:#d3d3d3}'+
  2798. 'html[data-theme=dark] .Search-container .SearchItem-meta{color:#d3d3d3}'+
  2799. 'html[data-theme=dark] .ContentItem-title a:hover .Highlight em{color:#6385a6}'+
  2800. 'html[data-theme=dark] .Club-Search-Name:hover{color:#6385a6}'+
  2801. 'html[data-theme=dark] .Club-Search-Name:hover em{color:#6385a6}'+
  2802. 'html[data-theme=dark] .SearchClubCard-avatar{filter: brightness(0.6);}'+
  2803. 'html[data-theme=dark] .ClubSideTitle-title{color:#d3d3d3}'+
  2804. 'html[data-theme=dark] .ClubInfoCard-title{color:#d3d3d3}'+
  2805. 'html[data-theme=dark] .ClubInfoCard-admins .ClubAdmin-name{color:#d3d3d3}'+
  2806. 'html[data-theme=dark] .Search-container{color:#d3d3d3}'+
  2807. 'html[data-theme=dark] .css-1v840mj{background:rgb(18,18,18)}'+
  2808. 'html[data-theme=dark] .css-a9sbyu{background:rgb(18,18,18)}'+
  2809. 'html[data-theme=dark] .css-1wof2n{background:rgb(18,18,18)}'+
  2810. 'html[data-theme=dark] .css-25wprl{color:#d3d3d3}'+
  2811. 'html[data-theme=dark] .css-zprod6 {'+
  2812. ' box-sizing: border-box;'+
  2813. ' margin: 0;'+
  2814. ' min-width: 0;'+
  2815. ' border-radius: 6px;'+
  2816. ' position: absolute;'+
  2817. ' width: 242px;'+
  2818. ' height: 242px;'+
  2819. ' top: 62px;'+
  2820. ' left: 174px;'+
  2821. ' box-shadow: 0 2px 10px 0 rgba(0,0,0,0.1);'+
  2822. ' background-image: linear-gradient(to bottom,rgba(0,0,0,0),rgba(0,0,0,0.5));'+
  2823. '}';
  2824.  
  2825.  
  2826.  
  2827.  
  2828. var head = document.getElementsByTagName('head')[0];
  2829. var style = document.createElement('style');
  2830.  
  2831. style.type = 'text/css';
  2832. if (style.styleSheet) {
  2833. style.styleSheet.cssText = css;
  2834. }
  2835. else {
  2836. style.appendChild(document.createTextNode(css));
  2837. }
  2838.  
  2839. head.appendChild(style);
  2840. }
  2841.  
  2842. //话题页
  2843. function topic () {
  2844. if (hideTopicSideBar == 1) //隐藏侧边栏并拉宽内容
  2845. {
  2846. $(".ContentLayout-sideColumn").hide();
  2847. $(".ContentLayout-mainColumn").width($(".ContentLayout").width());
  2848. }
  2849. else if (hideTopicSideBar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  2850. {
  2851. $(".ContentLayout-sideColumn").hide();
  2852. $(".ContentLayout").attr("style", "display:flex;justify-content:center;");
  2853. }
  2854. }
  2855.  
  2856. //草稿页
  2857. function draft(){
  2858. if (hideDraftSideBar == 1) //隐藏侧边栏并拉宽内容
  2859. {
  2860. $('.GlobalSideBar').hide();
  2861. $(".DraftList-mainColumn").width($(".DraftList").width());
  2862. }
  2863. else if (hideDraftSideBar == 2) //隐藏侧边栏,仅水平居中内容,不拉宽
  2864. {
  2865. $('.GlobalSideBar').hide();
  2866. $(".DraftList").attr("style", "display:flex;justify-content:center;");
  2867. }
  2868. }
  2869.  
  2870. //知乎圆桌页
  2871. function roundtable(){
  2872. //增加遮罩层
  2873. if($('html[data-theme=dark] .css-zprod6').length==0)
  2874. {
  2875. $('html[data-theme=dark] div.css-1b0ypf8 > div.css-1sqjzsk > div.css-tr5tvs > img').after('<div class=\"css-zprod6\"></div>');
  2876. }
  2877. }
  2878.  
  2879. //GIF自动播放
  2880. function gifPlaying () {
  2881. if (GIFAutoPlay == 1) {
  2882. $(".GifPlayer .ztext-gif").each(function () {
  2883. if($(this).hasClass('GifPlayer-gif2mp4'))
  2884. {
  2885. if($(this).get(0).paused)
  2886. {
  2887. $(this).get(0).play();
  2888. $(this).addClass('play');
  2889. }
  2890. }
  2891. else
  2892. {
  2893. $(this).parent().addClass("isPlaying");
  2894. if ($(this).attr("src").indexOf("webp") == -1) {
  2895. $(this).attr("src", $(this).attr("src").replace("jpg", "webp"));
  2896. //$(this).wrap("<a target=\'_blank\' href=\'" + $(this).attr("src") + "\'></a>");
  2897. }
  2898. }
  2899. });
  2900.  
  2901. }
  2902.  
  2903. }
  2904.  
  2905. function printValue()
  2906. {
  2907. console.log('\n');
  2908. console.log('hideIndexSidebar='+hideIndexSidebar);
  2909. console.log('hideQuestionSidebar='+hideQuestionSidebar);
  2910. console.log('hideSearchSideBar='+hideSearchSideBar);
  2911. console.log('hideTopicSideBar='+hideTopicSideBar);
  2912. console.log('hideCollectionSideBar='+hideCollectionSideBar);
  2913. console.log('hideClubSideBar='+ hideClubSideBar);
  2914. console.log('hideDraftSideBar='+ hideDraftSideBar);
  2915. console.log('hideLaterSideBar='+ hideLaterSideBar);
  2916. console.log('hideProfileSidebar='+ hideProfileSidebar);
  2917. console.log('hideRecommendedReading='+ hideRecommendedReading);
  2918. console.log('publishTop='+ publishTop);
  2919. console.log('GIFAutoPlay='+ GIFAutoPlay);
  2920. console.log('hoverShadow='+ hoverShadow);
  2921. console.log('blockingPictureVideo='+ blockingPictureVideo);
  2922. console.log('\n');
  2923. }
  2924.  
  2925. //设置框样式参考https://gf.qytechs.cn/zh-CN/scripts/37988
  2926.  
  2927. function settings()
  2928. {
  2929. $('body').append('<div id="settingLayerMask" style="display: flex;">'+
  2930. ' <div id="settingLayer">'+
  2931. ' <div id="itemlist">'+
  2932. ' <section class="switch"><span>隐藏首页侧边栏</span>'+
  2933. ' <select name="hideIndexSidebar" id="hideIndexSidebar">'+
  2934. ' <option value="0">不隐藏</option>'+
  2935. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2936. ' <option value="2">隐藏,居中显示内容</option>'+
  2937. ' </select>'+
  2938. ' </section>'+
  2939. ' <section class="switch"><span>隐藏回答侧边栏</span>'+
  2940. ' <select name="hideQuestionSidebar" id="hideQuestionSidebar">'+
  2941. ' <option value="0">不隐藏</option>'+
  2942. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2943. ' <option value="2">隐藏,居中显示内容</option>'+
  2944. ' </select>'+
  2945. ' </section>'+
  2946. ' <section class="switch"><span>隐藏搜索侧边栏</span>'+
  2947. ' <select name="hideSearchSideBar" id="hideSearchSideBar">'+
  2948. ' <<option value="0">不隐藏</option>'+
  2949. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2950. ' <option value="2">隐藏,居中显示内容</option>'+
  2951. ' </select>'+
  2952. ' </section>'+
  2953. ' <section class="switch"><span>隐藏话题侧边栏</span>'+
  2954. ' <select name="hideTopicSideBar" id="hideTopicSideBar">'+
  2955. ' <option value="0">不隐藏</option>'+
  2956. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2957. ' <option value="2">隐藏,居中显示内容</option>'+
  2958. ' </select>'+
  2959. ' </section>'+
  2960. ' <section class="switch"><span>隐藏收藏侧边栏</span>'+
  2961. ' <select name="hideCollectionSideBar" id="hideCollectionSideBar">'+
  2962. ' <option value="0">不隐藏</option>'+
  2963. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2964. ' <option value="2">隐藏,居中显示内容</option>'+
  2965. ' </select>'+
  2966. ' </section>'+
  2967. ' <section class="switch"><span>隐藏圈子侧边栏</span>'+
  2968. ' <select name="hideClubSideBar" id="hideClubSideBar">'+
  2969. ' <option value="0">不隐藏</option>'+
  2970. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2971. ' <option value="2">隐藏,居中显示内容</option>'+
  2972. ' </select>'+
  2973. ' </section>'+
  2974. ' <section class="switch"><span>隐藏草稿侧边栏</span>'+
  2975. ' <select name="hideDraftSideBar" id="hideDraftSideBar">'+
  2976. ' <option value="0">不隐藏</option>'+
  2977. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2978. ' <option value="2">隐藏,居中显示内容</option>'+
  2979. ' </select>'+
  2980. ' </section>'+
  2981. ' <section class="switch"><span>隐藏稍后答侧边栏</span>'+
  2982. ' <select name="hideLaterSideBar" id="hideLaterSideBar">'+
  2983. ' <option value="0">不隐藏</option>'+
  2984. ' <option value="1" selected="selected">隐藏,拉宽显示内容</option>'+
  2985. ' <option value="2">隐藏,居中显示内容</option>'+
  2986. ' </select>'+
  2987. ' </section>'+
  2988. ' <section class="switch"><span>隐藏用户主页侧边栏</span>'+
  2989. ' <select name="hideProfileSidebar" id="hideProfileSidebar">'+
  2990. ' <option value="0" selected="selected">不隐藏</option>'+
  2991. ' <option value="1">隐藏,拉宽显示内容</option>'+
  2992. ' <option value="2">隐藏,居中显示内容</option>'+
  2993. ' </select>'+
  2994. ' </section>'+
  2995. ' <section class="switch"><span>隐藏专栏推荐</span>'+
  2996. ' <div class="checkbox on"><input type="checkbox" name="hideRecommendedReading" id="hideRecommendedReading" value="1"><label class="switchLabel"></label></div>'+
  2997. ' </section>'+
  2998. ' <section class="switch"><span>置顶回答时间</span>'+
  2999. ' <div class="checkbox on"><input type="checkbox" name="publishTop" id="publishTop" value="1"><label class="switchLabel"></label></div>'+
  3000. ' </section>'+
  3001. ' <section class="switch"><span>GIF自动播放</span>'+
  3002. ' <div class="checkbox"><input type="checkbox" name="GIFAutoPlay" id="GIFAutoPlay" value="0"><label class="switchLabel"></label></div>'+
  3003. ' </section>'+
  3004. ' <section class="switch"><span>悬停时显示浅蓝色边框</span>'+
  3005. ' <div class="checkbox on"><input type="checkbox" name="hoverShadow" id="hoverShadow" value="1"><label class="switchLabel"></label></div>'+
  3006. ' </section>'+
  3007. ' <section class="switch"><span>隐藏图片/视频</span>'+
  3008. ' <div class="checkbox on"><input type="checkbox" name="blockingPictureVideo" id="blockingPictureVideo" value="0"><label class="switchLabel"></label></div>'+
  3009. ' </section>'+
  3010. ' <section class="switch" style="visibility:hidden"><span>none1</span>'+
  3011. ' <div class="checkbox on"><input type="checkbox" name="none1" id="none1" value="1"><label class="switchLabel"></label></div>'+
  3012. ' </section>'+
  3013. ' </div>'+
  3014. ' <div id="btnEle">'+
  3015. ' <div class="btnEleLayer">'+
  3016. ' <span id="settings-save" title="save &amp; fresh">保存并刷新</span>'+
  3017. ' </div>'+
  3018. ' </div><span id="settings-close" title="close 关闭"></span></div>'+
  3019. '</div>');
  3020.  
  3021. GM_addStyle('#settingLayer #itemlist {'+
  3022. ' display: flex;'+
  3023. ' display: -webkit-flex;'+
  3024. ' align-content: center;'+
  3025. ' align-items: center;'+
  3026. ' justify-content: center;'+
  3027. ' flex-flow: row wrap;'+
  3028. '}'+
  3029. ''+
  3030. '#settingLayer section {'+
  3031. ' display: grid;'+
  3032. ' float: left;'+
  3033. ' width: 200px;'+
  3034. ' padding: 10px 20px;'+
  3035. ' border-right: 1px solid #0084ff;'+
  3036. '}'+
  3037. ''+
  3038. '#settingLayer section:nth-of-type(3n) {'+
  3039. ' border-right: none;'+
  3040. '}'+
  3041. ''+
  3042. '#settingLayer .switch span {'+
  3043. ' height: 30px;'+
  3044. ' line-height: 30px;'+
  3045. ' font-size: 20px;'+
  3046. ' vertical-align: top;'+
  3047. '}'+
  3048. ''+
  3049. '#settingLayer .switch .checkbox {'+
  3050. ' float: right;'+
  3051. '}'+
  3052. ''+
  3053. '#settingLayer .checkbox {'+
  3054. ' position: relative;'+
  3055. ' display: inline-block;'+
  3056. '}'+
  3057. ''+
  3058. '#settingLayer .checkbox:after,'+
  3059. '#settingLayer .checkbox:before {'+
  3060. ' -webkit-font-feature-settings: normal;'+
  3061. ' -moz-font-feature-settings: normal;'+
  3062. ' font-feature-settings: normal;'+
  3063. ' -webkit-font-kerning: auto;'+
  3064. ' font-kerning: auto;'+
  3065. ' -moz-font-language-override: normal;'+
  3066. ' font-language-override: normal;'+
  3067. ' font-stretch: normal;'+
  3068. ' font-style: normal;'+
  3069. ' font-synthesis: weight style;'+
  3070. ' font-variant: normal;'+
  3071. ' font-weight: normal;'+
  3072. ' text-rendering: auto;'+
  3073. '}'+
  3074. ''+
  3075. '#settingLayer .checkbox label {'+
  3076. ' width: 80px;'+
  3077. ' height: 30px;'+
  3078. ' background: #ccc;'+
  3079. ' position: relative;'+
  3080. ' display: inline-block;'+
  3081. ' border-radius: 46px;'+
  3082. ' -webkit-transition: 0.4s;'+
  3083. ' transition: 0.4s;'+
  3084. ' cursor: pointer;'+
  3085. '}'+
  3086. ''+
  3087. '#settingLayer .checkbox label:after {'+
  3088. ' content: "";'+
  3089. ' position: absolute;'+
  3090. ' width: 50px;'+
  3091. ' height: 50px;'+
  3092. ' border-radius: 100%;'+
  3093. ' left: 0;'+
  3094. ' top: -5px;'+
  3095. ' z-index: 2;'+
  3096. ' background: #fff;'+
  3097. ' box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);'+
  3098. ' -webkit-transition: 0.4s;'+
  3099. ' transition: 0.4s;'+
  3100. ' cursor: pointer;'+
  3101. '}'+
  3102. ''+
  3103. '#settingLayer .checkbox input {'+
  3104. ' display: none;'+
  3105. '}'+
  3106. ''+
  3107. '#settingLayer .checkbox.on label:after {'+
  3108. ' left: 40px;'+
  3109. '}'+
  3110. ''+
  3111. '#settingLayer .checkbox.on label {'+
  3112. ' background: #4BD865;'+
  3113. '}'+
  3114. ''+
  3115. '#settingLayer .switch .checkbox label {'+
  3116. ' width: 70px;'+
  3117. '}'+
  3118. ''+
  3119. '#settingLayer .switch .checkbox label:after {'+
  3120. ' top: 0;'+
  3121. ' width: 30px;'+
  3122. ' height: 30px;'+
  3123. '}'+
  3124. ''+
  3125. ''+
  3126. '/* 弹出层 */'+
  3127. ''+
  3128. '#settingLayerMask {'+
  3129. ' display: none;'+
  3130. ' justify-content: center;'+
  3131. ' align-items: center;'+
  3132. ' position: fixed;'+
  3133. ' top: 0;'+
  3134. ' right: 0;'+
  3135. ' bottom: 0;'+
  3136. ' left: 0;'+
  3137. ' background-color: rgba(0, 0, 0, .5);'+
  3138. ' z-index: 200000000;'+
  3139. ' overflow: auto;'+
  3140. ' font-family: arial, sans-serif;'+
  3141. ' min-height: 100%;'+
  3142. ' font-size: 16px;'+
  3143. ' transition: 0.5s;'+
  3144. ' opacity: 1;'+
  3145. ' user-select: none;'+
  3146. ' -moz-user-select: none;'+
  3147. ' padding-bottom: 80px;'+
  3148. ' box-sizing: border-box;'+
  3149. '}'+
  3150. ''+
  3151. '#settingLayer {'+
  3152. ' display: flex;'+
  3153. ' flex-wrap: wrap;'+
  3154. ' padding: 20px;'+
  3155. ' margin: 0px 25px 50px 5px;'+
  3156. ' background-color: #fff;'+
  3157. ' border-radius: 4px;'+
  3158. ' position: absolute;'+
  3159. ' width: 60%;'+
  3160. ' transition: 0.5s;'+
  3161. '}'+
  3162. ''+
  3163. '#settingLayer #btnEle {'+
  3164. ' position: absolute;'+
  3165. ' width: 100%;'+
  3166. ' bottom: 4px;'+
  3167. ' right: 0;'+
  3168. ' background: #fff;'+
  3169. ' border-radius: 4px;'+
  3170. '}'+
  3171. ''+
  3172. '#settingLayer #btnEle span {'+
  3173. ' display: inline-block;'+
  3174. ' background: #EFF4F8;'+
  3175. ' border: 1px solid #3abdc1;'+
  3176. ' margin: 12px auto 10px;'+
  3177. ' color: #3abdc1;'+
  3178. ' padding: 5px 10px;'+
  3179. ' border-radius: 4px;'+
  3180. ' cursor: pointer;'+
  3181. ' outline: none;'+
  3182. ' transition: 0.3s;'+
  3183. '}'+
  3184. ''+
  3185. '#settingLayer #btnEle a {'+
  3186. ' color: #999;'+
  3187. ' text-decoration: none;'+
  3188. '}'+
  3189. ''+
  3190. '#settingLayer #btnEle a:hover {'+
  3191. ' text-decoration: underline;'+
  3192. ' color: #ef8957;'+
  3193. '}'+
  3194. ''+
  3195. '#settingLayer #btnEle span.feedback:hover {'+
  3196. ' border-color: #ef8957;'+
  3197. '}'+
  3198. ''+
  3199. '#settingLayer #btnEle span:not(.feedback):hover {'+
  3200. ' background: #3ACBDD;'+
  3201. ' color: #fff;'+
  3202. '}'+
  3203. ''+
  3204. '#settingLayer #btnEle .feedback {'+
  3205. ' border-color: #aaa;'+
  3206. '}'+
  3207. ''+
  3208. '#settingLayer #btnEle>div {'+
  3209. ' width: 100%;'+
  3210. ' margin-bottom: -100%;'+
  3211. ' display: flex;'+
  3212. ' justify-content: space-around;'+
  3213. ' background: #EFF4F8;'+
  3214. ' border-radius: 4px;'+
  3215. '}'+
  3216. ''+
  3217. ''+
  3218. '/*close button*/'+
  3219. ''+
  3220. '#settingLayer #settings-close {'+
  3221. ' background: white;'+
  3222. ' color: #3ABDC1;'+
  3223. ' line-height: 20px;'+
  3224. ' text-align: center;'+
  3225. ' height: 20px;'+
  3226. ' width: 20px;'+
  3227. ' font-size: 20px;'+
  3228. ' padding: 10px;'+
  3229. ' border: 3px solid #3ABDC1;'+
  3230. ' border-radius: 50%;'+
  3231. ' transition: .5s;'+
  3232. ' top: -20px;'+
  3233. ' right: -20px;'+
  3234. ' position: absolute;'+
  3235. ' cursor: pointer;'+
  3236. '}'+
  3237. ''+
  3238. '#settingLayer #settings-close::before {'+
  3239. ' content: "\\2716";'+
  3240. '}'+
  3241. ''+
  3242. '#settingLayer #settings-close:hover {'+
  3243. ' background: indianred;'+
  3244. ' border-color: indianred;'+
  3245. ' color: #fff;'+
  3246. '}'+
  3247. ''+
  3248. '#settingLayer select {'+
  3249. ' height: 30px;'+
  3250. ' width: 180px;'+
  3251. ' color: #0084FF;'+
  3252. ' font-size: 16px;'+
  3253. ' position: relative;'+
  3254. ' display: inline-block;'+
  3255. ' border-radius: 46px;'+
  3256. ' -webkit-transition: 0.4s;'+
  3257. ' transition: 0.4s;'+
  3258. ' cursor: pointer;'+
  3259. '}'+
  3260. 'html[data-theme=dark] #settingLayer{'+
  3261. ' background: #191c25;'+
  3262. '}'+
  3263. 'html[data-theme=dark] #settingLayer #btnEle>div{'+
  3264. ' background: #25282f;'+
  3265. '}'+
  3266. 'html[data-theme=dark] #settingLayer #settings-save, html[data-theme=dark] #settingLayer select, html[data-theme=dark] #settingLayer option{'+
  3267. ' background: #8080801c;'+
  3268. '}'+
  3269. 'html[data-theme=dark] #settingLayer #settings-close{'+
  3270. ' background: #25282f;'+
  3271. '}'
  3272. );
  3273.  
  3274. //默认隐藏
  3275. $('#settingLayerMask').hide();
  3276.  
  3277. //读取值
  3278. hideIndexSidebar = GM_getValue('hideIndexSidebar');
  3279. hideQuestionSidebar = GM_getValue('hideQuestionSidebar');
  3280. hideSearchSideBar = GM_getValue('hideSearchSideBar');
  3281. hideTopicSideBar = GM_getValue('hideTopicSideBar');
  3282. hideCollectionSideBar = GM_getValue('hideCollectionSideBar');
  3283. hideClubSideBar = GM_getValue('hideClubSideBar');
  3284. hideDraftSideBar = GM_getValue('hideDraftSideBar');
  3285. hideLaterSideBar = GM_getValue('hideLaterSideBar');
  3286. hideProfileSidebar = GM_getValue('hideProfileSidebar');
  3287. hideRecommendedReading = GM_getValue('hideRecommendedReading');
  3288. publishTop = GM_getValue('publishTop');
  3289. GIFAutoPlay = GM_getValue('GIFAutoPlay');
  3290. hoverShadow = GM_getValue('hoverShadow');
  3291. blockingPictureVideo = GM_getValue('blockingPictureVideo');
  3292.  
  3293.  
  3294. printValue();//输出所有设置值
  3295.  
  3296. //在设置界面设置相应值
  3297. $('select option').removeAttr('selected');
  3298.  
  3299. $('#hideIndexSidebar').val(hideIndexSidebar);
  3300. $('#hideQuestionSidebar').val(hideQuestionSidebar);
  3301. $('#hideSearchSideBar').val(hideSearchSideBar);
  3302. $('#hideTopicSideBar').val(hideTopicSideBar);
  3303. $('#hideCollectionSideBar').val(hideCollectionSideBar);
  3304. $('#hideClubSideBar').val(hideClubSideBar);
  3305. $('#hideDraftSideBar').val(hideDraftSideBar);
  3306. $('#hideLaterSideBar').val(hideLaterSideBar);
  3307. $('#hideProfileSidebar').val(hideProfileSidebar);
  3308. $('#hideRecommendedReading').val(hideRecommendedReading);
  3309. $('#publishTop').val(publishTop);
  3310. $('#GIFAutoPlay').val(GIFAutoPlay);
  3311. $('#hoverShadow').val(hoverShadow);
  3312. $('#blockingPictureVideo').val(blockingPictureVideo);
  3313.  
  3314.  
  3315. $('.checkbox').each(function(){
  3316. if($(this).find('input').val()==1)
  3317. $(this).addClass('on');
  3318. else
  3319. $(this).removeClass('on');
  3320. });
  3321.  
  3322.  
  3323.  
  3324.  
  3325. //点击关闭按钮隐藏
  3326. $('#settings-close').click(function(){
  3327. $('#settingLayerMask').hide();
  3328. });
  3329.  
  3330. //按ESC键隐藏
  3331. $(document).keyup(function (e) {
  3332. if (e.key === "Escape") {
  3333. $('#settingLayerMask').hide();
  3334. }
  3335. });
  3336.  
  3337. //开关按钮
  3338. $('.checkbox').click(function(){
  3339. if($(this).hasClass('on'))
  3340. {
  3341. $(this).find('input').val('0');
  3342. }
  3343. else
  3344. {
  3345. $(this).find('input').val('1');
  3346. }
  3347. $(this).toggleClass('on');
  3348. })
  3349.  
  3350. //保存设置
  3351. $('#settings-save').click(function(){
  3352. hideIndexSidebar = $('#hideIndexSidebar').val();
  3353. hideQuestionSidebar = $('#hideQuestionSidebar').val();
  3354. hideSearchSideBar = $('#hideSearchSideBar').val();
  3355. hideTopicSideBar = $('#hideTopicSideBar').val();
  3356. hideCollectionSideBar = $('#hideCollectionSideBar').val();
  3357. hideClubSideBar = $('#hideClubSideBar').val();
  3358. hideDraftSideBar = $('#hideDraftSideBar').val();
  3359. hideLaterSideBar = $('#hideLaterSideBar').val();
  3360. hideProfileSidebar = $('#hideProfileSidebar').val();
  3361. hideRecommendedReading = $('#hideRecommendedReading').val();
  3362. publishTop = $('#publishTop').val();
  3363. GIFAutoPlay = $('#GIFAutoPlay').val();
  3364. hoverShadow = $('#hoverShadow').val();
  3365. blockingPictureVideo = $('#blockingPictureVideo').val();
  3366.  
  3367.  
  3368. GM_setValue('hideIndexSidebar',hideIndexSidebar);
  3369. GM_setValue('hideQuestionSidebar',hideQuestionSidebar);
  3370. GM_setValue('hideSearchSideBar',hideSearchSideBar);
  3371. GM_setValue('hideTopicSideBar',hideTopicSideBar);
  3372. GM_setValue('hideCollectionSideBar',hideCollectionSideBar);
  3373. GM_setValue('hideClubSideBar',hideClubSideBar);
  3374. GM_setValue('hideDraftSideBar',hideDraftSideBar);
  3375. GM_setValue('hideLaterSideBar',hideLaterSideBar);
  3376. GM_setValue('hideProfileSidebar',hideProfileSidebar);
  3377. GM_setValue('hideRecommendedReading',hideRecommendedReading);
  3378. GM_setValue('publishTop',publishTop);
  3379. GM_setValue('GIFAutoPlay',GIFAutoPlay);
  3380. GM_setValue('hoverShadow',hoverShadow);
  3381. GM_setValue('blockingPictureVideo',blockingPictureVideo);
  3382.  
  3383.  
  3384. $('#settingLayerMask').hide(); //隐藏设置
  3385. window.location.reload();//刷新当前页面.
  3386. });
  3387.  
  3388. }
  3389.  
  3390.  
  3391. function clearValue()
  3392. {
  3393. GM_deleteValue('hideIndexSidebar');
  3394. GM_deleteValue('hideQuestionSidebar');
  3395. GM_deleteValue('hideSearchSideBar');
  3396. GM_deleteValue('hideTopicSideBar');
  3397. GM_deleteValue('hideCollectionSideBar');
  3398. GM_deleteValue('hideClubSideBar');
  3399. GM_deleteValue('hideDraftSideBar');
  3400. GM_deleteValue('hideLaterSideBar');
  3401. GM_deleteValue('hideProfileSidebar');
  3402. GM_deleteValue('hideRecommendedReading');
  3403. GM_deleteValue('publishTop');
  3404. GM_deleteValue('GIFAutoPlay');
  3405. GM_deleteValue('hoverShadow');
  3406. GM_deleteValue('blockingPictureVideo');
  3407.  
  3408. }
  3409.  
  3410.  
  3411. (function () {
  3412. 'use strict';
  3413.  
  3414. //根据当前cookie,判断是否设置夜间模式
  3415. if ($.cookie('nightmode') != undefined) {
  3416. if ($.cookie('nightmode') == 1) {
  3417. $("html").attr("data-theme", "dark");
  3418. $("#nightmode").find("img").attr("src", light).attr("style", "vertical-align:middle; width:20px; height:20px;");
  3419. $("#nightmode").find("span").text(" 日间模式");
  3420. }
  3421. else {
  3422. $("html").attr("data-theme", "light");
  3423. $("#nightmode").find("img").attr("src", dark).attr("style", "vertical-align:middle; width:18px; height:18px;");
  3424. $("#nightmode").find("span").text(" 夜间模式");
  3425. }
  3426. }
  3427.  
  3428. $('head').append(`<meta http-equiv="Content-Security-Policy" content="script-src * 'unsafe-eval'">`);
  3429.  
  3430. //clearValue(); //清空所有设置值
  3431.  
  3432. //设置默认值
  3433. if(GM_getValue('hideIndexSidebar')==undefined)
  3434. {
  3435. GM_setValue('hideIndexSidebar','1');
  3436. }
  3437.  
  3438. if(GM_getValue('hideQuestionSidebar')==undefined)
  3439. {
  3440. GM_setValue('hideQuestionSidebar','1');
  3441. }
  3442.  
  3443. if(GM_getValue('hideSearchSideBar')==undefined)
  3444. {
  3445. GM_setValue('hideSearchSideBar','1');
  3446. }
  3447.  
  3448. if(GM_getValue('hideTopicSideBar')==undefined)
  3449. {
  3450. GM_setValue('hideTopicSideBar','1');
  3451. }
  3452.  
  3453. if(GM_getValue('hideCollectionSideBar')==undefined)
  3454. {
  3455. GM_setValue('hideCollectionSideBar','1');
  3456. }
  3457.  
  3458. if(GM_getValue('hideClubSideBar')==undefined)
  3459. {
  3460. GM_setValue('hideClubSideBar','1');
  3461. }
  3462.  
  3463. if(GM_getValue('hideDraftSideBar')==undefined)
  3464. {
  3465. GM_setValue('hideDraftSideBar','1');
  3466. }
  3467.  
  3468. if(GM_getValue('hideLaterSideBar')==undefined)
  3469. {
  3470. GM_setValue('hideLaterSideBar','1');
  3471. }
  3472.  
  3473. if(GM_getValue('hideProfileSidebar')==undefined)
  3474. {
  3475. GM_setValue('hideProfileSidebar','0');
  3476. }
  3477.  
  3478. if(GM_getValue('hideRecommendedReading')==undefined)
  3479. {
  3480. GM_setValue('hideRecommendedReading','1');
  3481. }
  3482.  
  3483. if(GM_getValue('publishTop')==undefined)
  3484. {
  3485. GM_setValue('publishTop','1');
  3486. }
  3487.  
  3488. if(GM_getValue('GIFAutoPlay')==undefined)
  3489. {
  3490. GM_setValue('GIFAutoPlay','0');
  3491. }
  3492.  
  3493. if(GM_getValue('hoverShadow')==undefined)
  3494. {
  3495. GM_setValue('hoverShadow','1');
  3496. }
  3497.  
  3498. if(GM_getValue('blockingPictureVideo')==undefined)
  3499. {
  3500. GM_setValue('blockingPictureVideo','0');
  3501. }
  3502.  
  3503.  
  3504.  
  3505.  
  3506. //设置界面
  3507. settings();
  3508.  
  3509. //注册(不可用)设置按钮
  3510. GM_registerMenuCommand("知乎 美化 设置", function(){ $('#settingLayerMask').show(); });
  3511.  
  3512. //添加自定义CSS
  3513. addCSS();
  3514.  
  3515. //全局功能函数
  3516. setInterval(directLink, 100);
  3517. setInterval(iconColor, 100);
  3518. setInterval(originalPic, 100);
  3519. setInterval(downloadVideo, 100);
  3520. setInterval(gifPlaying, 100);
  3521.  
  3522. //清空搜索框占位符
  3523. setInterval(function () {
  3524. $(".SearchBar-input input").attr("placeholder", "");
  3525. }, 100);
  3526.  
  3527. //折叠谢邀
  3528. let timer = setInterval(function () {
  3529. if ($(".QuestionInvitation-content").text().indexOf("更多推荐结果") > -1) {
  3530. clearInterval(timer);
  3531. $(".QuestionInvitation-content").addClass("hide");
  3532. $(".QuestionInvitation-content").hide();
  3533.  
  3534. $(".QuestionInvitation-title").html($(".QuestionInvitation-title").text() + '<span style=\"color:#8590A6;\">(点击此处展开/折叠)</span>');
  3535.  
  3536. $(".Topbar").click(function () {
  3537.  
  3538. if (($(".QuestionInvitation-content").hasClass("hide"))) {
  3539. $(".QuestionInvitation-content").removeClass("hide").addClass("show");
  3540. $(".QuestionInvitation-content").show();
  3541. }
  3542. else {
  3543. $(".QuestionInvitation-content").removeClass("show").addClass("hide");
  3544. $(".QuestionInvitation-content").hide();
  3545. }
  3546. });
  3547. }
  3548. }, 100);
  3549.  
  3550. //每个页面对应的功能函数
  3551. if (window.location.href.indexOf("question") > -1) //回答页
  3552. setInterval(question, 300);
  3553. else if (window.location.href.indexOf("zvideo") > -1) //知乎视频页
  3554. setInterval(zvideo, 300);
  3555. else if (window.location.href.indexOf("club") > -1) //知乎圈子页
  3556. setInterval(club, 300);
  3557. else if (window.location.href.indexOf("search") > -1) //搜索结果页
  3558. setInterval(search, 300);
  3559. else if (window.location.href.indexOf("lives") > -1) //知乎讲座页
  3560. setInterval(lives, 300);
  3561. else if (window.location.href.indexOf("collection") > -1) //收藏夹
  3562. setInterval(collection, 300);
  3563. else if (window.location.href.indexOf("zhuanlan") > -1) //专栏
  3564. setInterval(zhuanlan, 300);
  3565. else if (window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1) //用户主页
  3566. setInterval(people, 300);
  3567. else if (window.location.href.indexOf("topic") > -1) //话题页
  3568. setInterval(topic, 300);
  3569. else if (window.location.href.indexOf("draft") > -1) //草稿页
  3570. setInterval(draft, 300);
  3571. else if (window.location.href.indexOf("roundtable") > -1) //知乎圆桌页
  3572. setInterval(roundtable, 300);
  3573. else
  3574. setInterval(index, 300); //首页
  3575.  
  3576. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址