知乎手机网页版改进

使手机网页版可以加载更多答案

  1. // ==UserScript==
  2. // @name 知乎手机网页版改进
  3. // @namespace https://www.zhihu.com/
  4. // @match https://www.zhihu.com/
  5. // @match https://www.zhihu.com/?*
  6. // @match https://www.zhihu.com/question/*
  7. // @match https://www.zhihu.com/zvideo/*
  8. // @match https://zhuanlan.zhihu.com/p/*
  9. // @grant none
  10. // @version 1.6.0
  11. // @author nameldk
  12. // @description 使手机网页版可以加载更多答案
  13. // @note 2024.01.01 v1.6.0 显示剩余评论数量
  14. // @note 2023.05.27 v1.5.3 修复评论接口验证问题
  15. // @note 2023.05.04 v1.5.2 评论中的链接去除中间页直接打开;评论中的图片可预览、图片表情可显示。
  16. // @note 2023.05.02 v1.5.1 调整回复样式;自动隐藏回复收起按钮。
  17. // @note 2023.05.01 v1.5.0 评论使用新接口;加载子回复。修复点击图片导致评论按钮消失的问题。
  18. // @note 2023.04.30 v1.4.3 修复加载状态条不显示的问题。
  19. // @note 2023.03.31 v1.4.2 修改展开、收起图标。隐藏专栏悬浮按钮。
  20. // @note 2022.10.30 v1.4.1 避免页面切换时直接替换页面内容时绑定的事件消息,所以点击标题链接时重新加载页面(简单粗暴)。
  21. // @note 2022.09.29 v1.4.0 获取回答使用新接口。
  22. // @note 2022.09.20 v1.3.8 隐藏VIP推荐。
  23. // @note 2022.08.05 v1.3.7 处理页面回答折叠未显示的问题。
  24. // @note 2022.07.17 v1.3.6 处理LinkCard点击无效的问题。添加IP信息。显示评论表情。
  25. // @note 2022.07.13 v1.3.5 处理部分答案重复显示的问题。
  26. // @note 2022.06.26 v1.3.4 隐藏推荐;修复链接打开失败的问题。
  27. // @note 2022.06.25 v1.3.3 隐藏底部按钮
  28. // @note 2022.03.30 v1.3.2 添加评论数量
  29. // @note 2022.03.19 v1.3.1 处理回答加载不出来的问题,处理查看所有回答点击错误
  30. // @note 2022.01.29 v1.3.0 处理回答加载不出来的问题
  31. // @note 2021.06.24 v1.2.9 处理评论样式
  32. // @note 2021.06.10 v1.2.8 处理视频被误删除问题
  33. // @note 2020.12.30 v1.2.7 处理首页和视频页面
  34. // @note 2020.12.22 v1.2.6 修复链接无法打开的问题,外部链接直接打开
  35. // @note 2020.10.13 v1.2.5 修复蒙层偶尔不消失的问题
  36. // @note 2020.09.14 v1.2.4 修复评论超出的问题
  37. // @note 2020.08.14 v1.2.3 适配新版页面
  38. // @note 2020.08.13 v1.2.2 修复已加载完的评论切换排序不显示的问题
  39. // @note 2020.08.03 v1.2.1 处理评论加载不完全,评论作者标识,收起按钮颜色区分,一些样式调整
  40. // @note 2020.08.02 v1.2 处理gif,视频,收起后的定位,发布时间,页面被清空的问题
  41. // ==/UserScript==
  42.  
  43. const questionNumber = (location.href.match(/\/question\/(\d+)/)||[])[1];
  44. const inDetailPage = location.href.match(/\/question\/\d+\/answer\/\d+/);
  45. const inHomePage = location.pathname === '/';
  46. const inZvideo = location.pathname.indexOf('/zvideo/') > -1;
  47. const inZhuanlan = location.href.match(/zhuanlan\.zhihu\.com\/p\/\d+/)
  48. const fromMobile = navigator.userAgent.match(/Android|iPhone|iPod|Opera Mini|IEMobile/i);
  49.  
  50. var is_end = 0;
  51. var is_loading_answer = 0;
  52. var is_loading_comment = 0;
  53. var load_answer_id_map = {};
  54. var EMOJI_URL_MAP = null;
  55. var elList = null;
  56. var elLoading = null;
  57. var viewportElCheckList = [];
  58. var debug = 0;
  59. var init_done = 0;
  60. var answer_next_url = null;
  61. var _log_counter = 0;
  62. var log = debug ? function () {
  63. return console.log.apply(console, ['mylog', ++_log_counter, new Date().toLocaleTimeString().substring(0,8)
  64. ].concat([].slice.call(arguments)));
  65. } : function(){};
  66.  
  67.  
  68. function forEachArray(arrayLike, cb) {
  69. if (arrayLike) {
  70. Array.prototype.forEach.call(arrayLike, el => cb(el));
  71. }
  72. }
  73.  
  74. function forEachBySelector(s, cb) {
  75. Array.prototype.forEach.call(document.querySelectorAll(s), el => cb(el));
  76. }
  77.  
  78. function removeBySelector(s) {
  79. forEachBySelector(s, ele => ele.remove());
  80. }
  81.  
  82. function hideBySelector(s) {
  83. forEachBySelector(s, ele => ele.style.display = "none");
  84. }
  85.  
  86. function hideByAddCss(s) {
  87. addStyle(`<style>${s}{display:none;}</style>`)
  88. }
  89.  
  90. function getElementHeight(el) {
  91. if (el) {
  92. // el.offsetHeight
  93. return parseFloat(window.getComputedStyle(el, null).height.replace("px", ""));
  94. }
  95. return 0;
  96. }
  97.  
  98. function isElementInViewport (el) {
  99. // https://stackoverflow.com/questions/123999/how-can-i-tell-if-a-dom-element-is-visible-in-the-current-viewport
  100. if (!el)
  101. return false;
  102.  
  103. var rect = el.getBoundingClientRect();
  104. if (rect.top >= 0) { // ↓
  105. return rect.top < window.innerHeight;
  106. } else {
  107. return rect.top + rect.height > 0;
  108. }
  109. }
  110.  
  111.  
  112. function formatNumber(num) {
  113. if (num > 10000) {
  114. return (num / 10000).toFixed(2) + '万';
  115. } else {
  116. return num;
  117. }
  118. }
  119.  
  120.  
  121. function formatUrl(url, formatStr) {
  122. if (!formatStr)
  123. formatStr = 'xs';
  124. // s,xs,m, r
  125. return url.replace('{size}', formatStr);
  126. }
  127.  
  128. function formatDate(e, t) {
  129. if(e.toString().length === 10) { // 秒
  130. e = e*1000;
  131. }
  132. e = new Date(e);
  133. // yyyy-MM-dd hh:mm:ss
  134. var n = {
  135. "M+": e.getMonth() + 1,
  136. "d+": e.getDate(),
  137. "h+": e.getHours(),
  138. "m+": e.getMinutes(),
  139. "s+": e.getSeconds(),
  140. "q+": Math.floor((e.getMonth() + 3) / 3),
  141. S: e.getMilliseconds()
  142. };
  143. /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
  144. for (var r in n)
  145. new RegExp("(" + r + ")").test(t) && (t = t.replace(RegExp.$1, 1 === RegExp.$1.length ? n[r] : ("00" + n[r]).substr(("" + n[r]).length)));
  146. return t
  147. }
  148.  
  149. function getDate(timestamp) {
  150. return formatDate(timestamp, 'yyyy-MM-dd');
  151. }
  152.  
  153. function addStyle(styleStr) {
  154. if (styleStr) {
  155. document.body.insertAdjacentHTML('beforeend', styleStr);
  156. }
  157. }
  158.  
  159. function stopPropagation(el) {
  160. if (el) {
  161. el.addEventListener('click', function (e) {
  162. e.stopPropagation();
  163. });
  164. }
  165. }
  166.  
  167. function observerAddNodes(targetNode, cb) {
  168. if (!targetNode || !cb)
  169. return;
  170. const config = { childList:true, subtree: true };
  171. const callback = function(mutationsList) {
  172. for(const mutation of mutationsList) {
  173. if (mutation.addedNodes.length) {
  174. log('got_addNode', mutation.addedNodes.length, mutation.addedNodes);
  175. forEachArray(mutation.addedNodes, el => cb(el));
  176. }
  177. }
  178. };
  179.  
  180. const observer = new MutationObserver(callback);
  181. observer.observe(targetNode, config);
  182. }
  183.  
  184. function getEmojiImg(e) {
  185. if (!EMOJI_URL_MAP) {
  186. makeEmojiMap();
  187. }
  188. var t = EMOJI_URL_MAP[e];
  189. return t ? '<img data-zhihu-emoticon="'.concat(e, '" src="').concat(t, '" alt="').concat(e, '" />') : e;
  190. }
  191.  
  192. function makeEmojiMap() {
  193. const EMOTICON_EMOJI = [{"static_image_url":"https://pic2.zhimg.com/v2-6fe2283baa639ae1d7c024487f1d68c7.png","title":"谢邀","placeholder":"[谢邀]"},{"static_image_url":"https://pic2.zhimg.com/v2-419a1a3ed02b7cfadc20af558aabc897.png","title":"赞同","placeholder":"[赞同]"},{"static_image_url":"https://pic4.zhimg.com/v2-66e5de3da039ac969d3b9d4dc5ef3536.png","title":"蹲","placeholder":"[蹲]"},{"static_image_url":"https://pic1.zhimg.com/v2-0942128ebfe78f000e84339fbb745611.png","title":"爱","placeholder":"[爱]"},{"static_image_url":"https://pic4.zhimg.com/v2-52f8c87376792e927b6cf0896b726f06.png","title":"害羞","placeholder":"[害羞]"},{"static_image_url":"https://pic2.zhimg.com/v2-72b9696632f66e05faaca12f1f1e614b.png","title":"好奇","placeholder":"[好奇]"},{"static_image_url":"https://pic4.zhimg.com/v2-bffb2bf11422c5ef7d8949788114c2ab.png","title":"思考","placeholder":"[思考]"},{"static_image_url":"https://pic4.zhimg.com/v2-c96dd18b15beb196b2daba95d26d9b1c.png","title":"酷","placeholder":"[酷]"},{"static_image_url":"https://pic1.zhimg.com/v2-3ac403672728e5e91f5b2d3c095e415a.png","title":"大笑","placeholder":"[大笑]"},{"static_image_url":"https://pic1.zhimg.com/v2-3700cc07f14a49c6db94a82e989d4548.png","title":"微笑","placeholder":"[微笑]"},{"static_image_url":"https://pic1.zhimg.com/v2-b62e608e405aeb33cd52830218f561ea.png","title":"捂脸","placeholder":"[捂脸]"},{"static_image_url":"https://pic4.zhimg.com/v2-0e26b4bbbd86a0b74543d7898fab9f6a.png","title":"捂嘴","placeholder":"[捂嘴]"},{"static_image_url":"https://pic4.zhimg.com/v2-3bb879be3497db9051c1953cdf98def6.png","title":"飙泪笑","placeholder":"[飙泪笑]"},{"static_image_url":"https://pic2.zhimg.com/v2-f3b3b8756af8b42bd3cb534cbfdbe741.png","title":"耶","placeholder":"[耶]"},{"static_image_url":"https://pic1.zhimg.com/v2-aa15ce4a2bfe1ca54c8bb6cc3ea6627b.png","title":"可怜","placeholder":"[可怜]"},{"static_image_url":"https://pic2.zhimg.com/v2-3846906ea3ded1fabbf1a98c891527fb.png","title":"惊喜","placeholder":"[惊喜]"},{"static_image_url":"https://pic4.zhimg.com/v2-dd613c7c81599bcc3085fc855c752950.png","title":"流泪","placeholder":"[流泪]"},{"static_image_url":"https://pic1.zhimg.com/v2-41f74f3795489083630fa29fde6c1c4d.png","title":"大哭","placeholder":"[大哭]"},{"static_image_url":"https://pic4.zhimg.com/v2-6a976b21fd50b9535ab3e5b17c17adc7.png","title":"生气","placeholder":"[生气]"},{"static_image_url":"https://pic4.zhimg.com/v2-0d9811a7961c96d84ee6946692a37469.png","title":"惊讶","placeholder":"[惊讶]"},{"static_image_url":"https://pic1.zhimg.com/v2-76c864a7fd5ddc110965657078812811.png","title":"调皮","placeholder":"[调皮]"},{"static_image_url":"https://pic1.zhimg.com/v2-d6d4d1689c2ce59e710aa40ab81c8f10.png","title":"衰","placeholder":"[衰]"},{"static_image_url":"https://pic2.zhimg.com/v2-7f09d05d34f03eab99e820014c393070.png","title":"发呆","placeholder":"[发呆]"},{"static_image_url":"https://pic1.zhimg.com/v2-4e025a75f219cf79f6d1fda7726e297f.png","title":"机智","placeholder":"[机智]"},{"static_image_url":"https://pic4.zhimg.com/v2-f80e1dc872d68d4f0b9ac76e8525d402.png","title":"嘘","placeholder":"[嘘]"},{"static_image_url":"https://pic3.zhimg.com/v2-b779f7eb3eac05cce39cc33e12774890.png","title":"尴尬","placeholder":"[尴尬]"},{"static_image_url":"https://pic1.zhimg.com/v2-c65aaaa25730c59f5097aca04e606d88.png","title":"小情绪","placeholder":"[小情绪]"},{"static_image_url":"https://pic1.zhimg.com/v2-132ab52908934f6c3cd9166e51b99f47.png","title":"为难","placeholder":"[为难]"},{"static_image_url":"https://pic4.zhimg.com/v2-74ecc4b114fce67b6b42b7f602c3b1d6.png","title":"吃瓜","placeholder":"[吃瓜]"},{"static_image_url":"https://pic2.zhimg.com/v2-58e3ec448b58054fde642914ebb850f9.png","title":"语塞","placeholder":"[语塞]"},{"static_image_url":"https://pic3.zhimg.com/v2-4e4870fc6e57bb76e7e5924375cb20b6.png","title":"看看你","placeholder":"[看看你]"},{"static_image_url":"https://pic2.zhimg.com/v2-1043b00a7b5776e2e6e1b0af2ab7445d.png","title":"撇嘴","placeholder":"[撇嘴]"},{"static_image_url":"https://pic2.zhimg.com/v2-e6270881e74c90fc01994e8cd072bd3a.png","title":"魔性笑","placeholder":"[魔性笑]"},{"static_image_url":"https://pic1.zhimg.com/v2-99bb6a605b136b95e442f5b69efa2ccc.png","title":"潜水","placeholder":"[潜水]"},{"static_image_url":"https://pic4.zhimg.com/v2-6551348276afd1eaf836551b93a94636.png","title":"口罩","placeholder":"[口罩]"},{"static_image_url":"https://pic2.zhimg.com/v2-c99cdc3629ff004f83ff44a952e5b716.png","title":"开心","placeholder":"[开心]"},{"static_image_url":"https://pic4.zhimg.com/v2-8a8f1403a93ddd0a458bed730bebe19b.png","title":"滑稽","placeholder":"[滑稽]","id":"1114211774655778817"},{"static_image_url":"https://pic4.zhimg.com/v2-ca0015e8ed8462cfce839fba518df585.png","title":"笑哭","placeholder":"[笑哭]"},{"static_image_url":"https://pic2.zhimg.com/v2-d4f78d92922632516769d3f2ce055324.png","title":"白眼","placeholder":"[白眼]"},{"static_image_url":"https://pic2.zhimg.com/v2-9ab384e3947547851cb45765e6fc1ea8.png","title":"红心","placeholder":"[红心]"},{"static_image_url":"https://pic4.zhimg.com/v2-a8f46a21217d58d2b4cdabc4568fde15.png","title":"柠檬","placeholder":"[柠檬]"},{"static_image_url":"https://pic2.zhimg.com/v2-3e36d546a9454c8964fbc218f0db1ff8.png","title":"拜托","placeholder":"[拜托]"},{"static_image_url":"https://pic2.zhimg.com/v2-f5aa165e86b5c9ed3b7bee821da59365.png","title":"握手","placeholder":"[握手]"},{"static_image_url":"https://pic1.zhimg.com/v2-c71427010ca7866f9b08c37ec20672e0.png","title":"赞","placeholder":"[赞]"},{"static_image_url":"https://pic1.zhimg.com/v2-d5c0ed511a09bf5ceb633387178e0d30.png","title":"发火","placeholder":"[发火]"},{"static_image_url":"https://pic4.zhimg.com/v2-395d272d5635143119b1dbc0b51e05e4.png","title":"不抬杠","placeholder":"[不抬杠]"},{"static_image_url":"https://pic2.zhimg.com/v2-cb191a92f1296e33308b2aa16f61bfb9.png","title":"种草","placeholder":"[种草]"},{"static_image_url":"https://pic2.zhimg.com/v2-b2e3fa9e0b6f431bd18d4a9d5d3c6596.png","title":"抱抱","placeholder":"[抱抱]"},{"static_image_url":"https://pic4.zhimg.com/v2-501ff2e1fb7cf3f9326ec5348dc8d84f.png","title":"doge","placeholder":"[doge]"},{"static_image_url":"https://pic3.zhimg.com/v2-35808905e85664eda2125a334fc7dff8.png","title":"666","placeholder":"[666]"},{"static_image_url":"https://pic1.zhimg.com/v2-1b6c8a81fe19f2ceda77241733aadf8b.png","title":"闭嘴","placeholder":"[闭嘴]"},{"static_image_url":"https://pic1.zhimg.com/v2-36ee7432e619319d858b202015a80d3f.png","title":"吃瓜中","placeholder":"[吃瓜中]"},{"static_image_url":"https://pic4.zhimg.com/v2-bb0c68fefe47605ebc91c55b7f0a167d.png","title":"打脸","placeholder":"[打脸]"},{"static_image_url":"https://pic1.zhimg.com/v2-4779ff07dfe6b722cacfcf3c5185357d.png","title":"蹲","placeholder":"[蹲]"},{"static_image_url":"https://pic1.zhimg.com/v2-e39d5eebfef8b0ac6065ad156cb05e66.png","title":"感谢","placeholder":"[感谢]"},{"static_image_url":"https://pic1.zhimg.com/v2-ffb16dd9ff04470d4efc37130ec82542.png","title":"哈士奇","placeholder":"[哈士奇]"},{"static_image_url":"https://pic1.zhimg.com/v2-13d3fcb823a2d323704cd74e48260627.png","title":"加油","placeholder":"[加油]"},{"static_image_url":"https://pic1.zhimg.com/v2-57502a494dceb07009c68de3f98f7c73.png","title":"纠结","placeholder":"[纠结]"},{"static_image_url":"https://pic2.zhimg.com/v2-5507bf46889ec156eb781f60859ae415.png","title":"哭","placeholder":"[哭]"},{"static_image_url":"https://pic2.zhimg.com/v2-43496a438dbde374d53c3e09dafde6c8.png","title":"流口水","placeholder":"[流口水]"},{"static_image_url":"https://pic2.zhimg.com/v2-43496a438dbde374d53c3e09dafde6c8.png","title":"社会人","placeholder":"[社会人]"},{"static_image_url":"https://pic2.zhimg.com/v2-76230e3ed1edcc8d3cb7047a5b78ba0e.png","title":"生气了","placeholder":"[生气了]"},{"static_image_url":"https://pic1.zhimg.com/v2-9de57d1821502441814913e963f502c7.png","title":"思考中","placeholder":"[思考中]"},{"static_image_url":"https://pic1.zhimg.com/v2-d53a13cbc6dac54eb406b47652fc66b8.png","title":"酸了","placeholder":"[酸了]"},{"static_image_url":"https://pic1.zhimg.com/v2-a31cd513ddc2b487587805d17629d570.png","title":"偷看","placeholder":"[偷看]"},{"static_image_url":"https://pic2.zhimg.com/v2-0e52bbdc84106d8a64edd043b53e8775.png","title":"头秃","placeholder":"[头秃]"},{"static_image_url":"https://pic1.zhimg.com/v2-e9df774ecb65c03f359eadff6872ce02.png","title":"吐血","placeholder":"[吐血]"},{"static_image_url":"https://pic1.zhimg.com/v2-70c38b608df613d862ee0140dcb26465.png","title":"哇","placeholder":"[哇]"},{"static_image_url":"https://pic4.zhimg.com/v2-56873671e39c80904f745a895d93d0b8.png","title":"旺柴","placeholder":"[旺柴]"},{"static_image_url":"https://pic4.zhimg.com/v2-0b0cabfad4695a46347ea494034b2c9c.png","title":"学到了","placeholder":"[学到了]"},{"static_image_url":"https://pic4.zhimg.com/v2-57d961f9da6b0601c0f48686cbc848aa.png","title":"疑问","placeholder":"[疑问]"},{"static_image_url":"https://pic4.zhimg.com/v2-34af8e9abc783c171bb47496a7773e89.png","title":"晕","placeholder":"[晕]"},{"static_image_url":"https://pic1.zhimg.com/v2-5533319c4f5740bd45897429c1ad3553.png","title":"裂开","placeholder":"[裂开]"}];
  194.  
  195. EMOJI_URL_MAP = {};
  196. EMOTICON_EMOJI.forEach(e => {
  197. EMOJI_URL_MAP[e.placeholder] = e.static_image_url;
  198. });
  199. }
  200.  
  201. function debounce(fn, delay) {
  202. let timer
  203. return function () {
  204. const context = this;
  205. const args = arguments;
  206. if (timer) {
  207. clearTimeout(timer)
  208. }
  209. timer = setTimeout(function () {
  210. fn.apply(context, args)
  211. }, delay);
  212. };
  213. }
  214.  
  215. function md5(s) {
  216. function f1(t, e, n) {
  217. var r;
  218. !function (o) {
  219. "use strict";
  220.  
  221. function i(t, e) {
  222. var n = (65535 & t) + (65535 & e);
  223. return (t >> 16) + (e >> 16) + (n >> 16) << 16 | 65535 & n
  224. }
  225.  
  226. function a(t, e, n, r, o, a) {
  227. return i((u = i(i(e, t), i(r, a))) << (c = o) | u >>> 32 - c, n);
  228. var u, c
  229. }
  230.  
  231. function u(t, e, n, r, o, i, u) {
  232. return a(e & n | ~e & r, t, e, o, i, u)
  233. }
  234.  
  235. function c(t, e, n, r, o, i, u) {
  236. return a(e & r | n & ~r, t, e, o, i, u)
  237. }
  238.  
  239. function s(t, e, n, r, o, i, u) {
  240. return a(e ^ n ^ r, t, e, o, i, u)
  241. }
  242.  
  243. function l(t, e, n, r, o, i, u) {
  244. return a(n ^ (e | ~r), t, e, o, i, u)
  245. }
  246.  
  247. function f(t, e) {
  248. var n, r, o, a, f;
  249. t[e >> 5] |= 128 << e % 32,
  250. t[14 + (e + 64 >>> 9 << 4)] = e;
  251. var d = 1732584193
  252. , p = -271733879
  253. , h = -1732584194
  254. , v = 271733878;
  255. for (n = 0; n < t.length; n += 16)
  256. r = d,
  257. o = p,
  258. a = h,
  259. f = v,
  260. d = u(d, p, h, v, t[n], 7, -680876936),
  261. v = u(v, d, p, h, t[n + 1], 12, -389564586),
  262. h = u(h, v, d, p, t[n + 2], 17, 606105819),
  263. p = u(p, h, v, d, t[n + 3], 22, -1044525330),
  264. d = u(d, p, h, v, t[n + 4], 7, -176418897),
  265. v = u(v, d, p, h, t[n + 5], 12, 1200080426),
  266. h = u(h, v, d, p, t[n + 6], 17, -1473231341),
  267. p = u(p, h, v, d, t[n + 7], 22, -45705983),
  268. d = u(d, p, h, v, t[n + 8], 7, 1770035416),
  269. v = u(v, d, p, h, t[n + 9], 12, -1958414417),
  270. h = u(h, v, d, p, t[n + 10], 17, -42063),
  271. p = u(p, h, v, d, t[n + 11], 22, -1990404162),
  272. d = u(d, p, h, v, t[n + 12], 7, 1804603682),
  273. v = u(v, d, p, h, t[n + 13], 12, -40341101),
  274. h = u(h, v, d, p, t[n + 14], 17, -1502002290),
  275. d = c(d, p = u(p, h, v, d, t[n + 15], 22, 1236535329), h, v, t[n + 1], 5, -165796510),
  276. v = c(v, d, p, h, t[n + 6], 9, -1069501632),
  277. h = c(h, v, d, p, t[n + 11], 14, 643717713),
  278. p = c(p, h, v, d, t[n], 20, -373897302),
  279. d = c(d, p, h, v, t[n + 5], 5, -701558691),
  280. v = c(v, d, p, h, t[n + 10], 9, 38016083),
  281. h = c(h, v, d, p, t[n + 15], 14, -660478335),
  282. p = c(p, h, v, d, t[n + 4], 20, -405537848),
  283. d = c(d, p, h, v, t[n + 9], 5, 568446438),
  284. v = c(v, d, p, h, t[n + 14], 9, -1019803690),
  285. h = c(h, v, d, p, t[n + 3], 14, -187363961),
  286. p = c(p, h, v, d, t[n + 8], 20, 1163531501),
  287. d = c(d, p, h, v, t[n + 13], 5, -1444681467),
  288. v = c(v, d, p, h, t[n + 2], 9, -51403784),
  289. h = c(h, v, d, p, t[n + 7], 14, 1735328473),
  290. d = s(d, p = c(p, h, v, d, t[n + 12], 20, -1926607734), h, v, t[n + 5], 4, -378558),
  291. v = s(v, d, p, h, t[n + 8], 11, -2022574463),
  292. h = s(h, v, d, p, t[n + 11], 16, 1839030562),
  293. p = s(p, h, v, d, t[n + 14], 23, -35309556),
  294. d = s(d, p, h, v, t[n + 1], 4, -1530992060),
  295. v = s(v, d, p, h, t[n + 4], 11, 1272893353),
  296. h = s(h, v, d, p, t[n + 7], 16, -155497632),
  297. p = s(p, h, v, d, t[n + 10], 23, -1094730640),
  298. d = s(d, p, h, v, t[n + 13], 4, 681279174),
  299. v = s(v, d, p, h, t[n], 11, -358537222),
  300. h = s(h, v, d, p, t[n + 3], 16, -722521979),
  301. p = s(p, h, v, d, t[n + 6], 23, 76029189),
  302. d = s(d, p, h, v, t[n + 9], 4, -640364487),
  303. v = s(v, d, p, h, t[n + 12], 11, -421815835),
  304. h = s(h, v, d, p, t[n + 15], 16, 530742520),
  305. d = l(d, p = s(p, h, v, d, t[n + 2], 23, -995338651), h, v, t[n], 6, -198630844),
  306. v = l(v, d, p, h, t[n + 7], 10, 1126891415),
  307. h = l(h, v, d, p, t[n + 14], 15, -1416354905),
  308. p = l(p, h, v, d, t[n + 5], 21, -57434055),
  309. d = l(d, p, h, v, t[n + 12], 6, 1700485571),
  310. v = l(v, d, p, h, t[n + 3], 10, -1894986606),
  311. h = l(h, v, d, p, t[n + 10], 15, -1051523),
  312. p = l(p, h, v, d, t[n + 1], 21, -2054922799),
  313. d = l(d, p, h, v, t[n + 8], 6, 1873313359),
  314. v = l(v, d, p, h, t[n + 15], 10, -30611744),
  315. h = l(h, v, d, p, t[n + 6], 15, -1560198380),
  316. p = l(p, h, v, d, t[n + 13], 21, 1309151649),
  317. d = l(d, p, h, v, t[n + 4], 6, -145523070),
  318. v = l(v, d, p, h, t[n + 11], 10, -1120210379),
  319. h = l(h, v, d, p, t[n + 2], 15, 718787259),
  320. p = l(p, h, v, d, t[n + 9], 21, -343485551),
  321. d = i(d, r),
  322. p = i(p, o),
  323. h = i(h, a),
  324. v = i(v, f);
  325. return [d, p, h, v]
  326. }
  327.  
  328. function d(t) {
  329. var e, n = "", r = 32 * t.length;
  330. for (e = 0; e < r; e += 8)
  331. n += String.fromCharCode(t[e >> 5] >>> e % 32 & 255);
  332. return n
  333. }
  334.  
  335. function p(t) {
  336. var e, n = [];
  337. for (n[(t.length >> 2) - 1] = void 0,
  338. e = 0; e < n.length; e += 1)
  339. n[e] = 0;
  340. var r = 8 * t.length;
  341. for (e = 0; e < r; e += 8)
  342. n[e >> 5] |= (255 & t.charCodeAt(e / 8)) << e % 32;
  343. return n
  344. }
  345.  
  346. function h(t) {
  347. var e, n, r = "0123456789abcdef", o = "";
  348. for (n = 0; n < t.length; n += 1)
  349. e = t.charCodeAt(n),
  350. o += r.charAt(e >>> 4 & 15) + r.charAt(15 & e);
  351. return o
  352. }
  353.  
  354. function v(t) {
  355. return unescape(encodeURIComponent(t))
  356. }
  357.  
  358. function A(t) {
  359. return function (t) {
  360. return d(f(p(t), 8 * t.length))
  361. }(v(t))
  362. }
  363.  
  364. function m(t, e) {
  365. return function (t, e) {
  366. var n, r, o = p(t), i = [], a = [];
  367. for (i[15] = a[15] = void 0,
  368. o.length > 16 && (o = f(o, 8 * t.length)),
  369. n = 0; n < 16; n += 1)
  370. i[n] = 909522486 ^ o[n],
  371. a[n] = 1549556828 ^ o[n];
  372. return r = f(i.concat(p(e)), 512 + 8 * e.length),
  373. d(f(a.concat(r), 640))
  374. }(v(t), v(e))
  375. }
  376.  
  377. function g(t, e, n) {
  378. return e ? n ? m(e, t) : h(m(e, t)) : n ? A(t) : h(A(t))
  379. }
  380.  
  381. void 0 === (r = function () {
  382. return g
  383. }
  384. .call(e, n, e, t)) || (t.exports = r)
  385. }()
  386. }
  387. var o = {}
  388. f1(o);
  389. return o.exports(s)
  390. }
  391. function zhihu_enc(s) {
  392. function f1(__unused_webpack_module, exports) {
  393. "use strict";
  394. var __webpack_unused_export__;
  395.  
  396. function o(t) {
  397. return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.A ? function (t) {
  398. return typeof t
  399. }
  400. : function (t) {
  401. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  402. }
  403. )(t)
  404. }
  405.  
  406. function x(e) {
  407. return C(e) || s(e) || t()
  408. }
  409.  
  410. function C(t) {
  411. if (Array.isArray(t)) {
  412. for (var e = 0, n = new Array(t.length); e < t.length; e++)
  413. n[e] = t[e];
  414. return n
  415. }
  416. }
  417.  
  418. function s(t) {
  419. if (Symbol.A in Object(t) || "[object Arguments]" === Object.prototype.toString.call(t))
  420. return Array.from(t)
  421. }
  422.  
  423. function t() {
  424. throw new TypeError("Invalid attempt to spread non-iterable instance")
  425. }
  426.  
  427. __webpack_unused_export__ = {
  428. value: !0
  429. };
  430. var A = "3.0", S = "undefined" != typeof window ? window : {}, h;
  431.  
  432. function i(t, e, n) {
  433. e[n] = 255 & t >>> 24,
  434. e[n + 1] = 255 & t >>> 16,
  435. e[n + 2] = 255 & t >>> 8,
  436. e[n + 3] = 255 & t
  437. }
  438.  
  439. function B(t, e) {
  440. return (255 & t[e]) << 24 | (255 & t[e + 1]) << 16 | (255 & t[e + 2]) << 8 | 255 & t[e + 3]
  441. }
  442.  
  443. function Q(t, e) {
  444. return (4294967295 & t) << e | t >>> 32 - e
  445. }
  446.  
  447. function G(t) {
  448. var e = new Array(4)
  449. , n = new Array(4);
  450. i(t, e, 0),
  451. n[0] = h.zb[255 & e[0]],
  452. n[1] = h.zb[255 & e[1]],
  453. n[2] = h.zb[255 & e[2]],
  454. n[3] = h.zb[255 & e[3]];
  455. var r = B(n, 0);
  456. return r ^ Q(r, 2) ^ Q(r, 10) ^ Q(r, 18) ^ Q(r, 24)
  457. }
  458.  
  459. var __g = {
  460. x: function (t, e) {
  461. for (var n = [], r = t.length, o = 0; 0 < r; r -= 16) {
  462. for (var i = t.slice(16 * o, 16 * (o + 1)), a = new Array(16), u = 0; u < 16; u++)
  463. a[u] = i[u] ^ e[u];
  464. e = __g.r(a),
  465. n = n.concat(e),
  466. o++
  467. }
  468. return n
  469. },
  470. r: function (t) {
  471. var e = new Array(16)
  472. , n = new Array(36);
  473. n[0] = B(t, 0),
  474. n[1] = B(t, 4),
  475. n[2] = B(t, 8),
  476. n[3] = B(t, 12);
  477. for (var r = 0; r < 32; r++) {
  478. var o = G(n[r + 1] ^ n[r + 2] ^ n[r + 3] ^ h.zk[r]);
  479. n[r + 4] = n[r] ^ o
  480. }
  481. return i(n[35], e, 0),
  482. i(n[34], e, 4),
  483. i(n[33], e, 8),
  484. i(n[32], e, 12),
  485. e
  486. }
  487. };
  488.  
  489. function l() {
  490. this.C = [0, 0, 0, 0],
  491. this.s = +[],
  492. this.t = [],
  493. this.S = [],
  494. this.h = [],
  495. this.i = [],
  496. this.B = [],
  497. this.Q = !1,
  498. this.G = [],
  499. this.D = [],
  500. this.w = 1024,
  501. this.g = null,
  502. this.a = Date.now(),
  503. this.e = +[],
  504. this.T = 255,
  505. this.V = null,
  506. this.U = Date.now,
  507. this.M = new Array(32)
  508. }
  509.  
  510. l.prototype.O = function (A, C, s) {
  511. for (var t, S, h, i, B, Q, G, D, w, g, a, e, E, T, r, V, U, M, O, c, I; this.T < this.w;)
  512. try {
  513. switch (this.T) {
  514. case 27:
  515. this.C[this.c] = this.C[this.I] >> this.C[this.F],
  516. this.M[12] = 35,
  517. this.T = this.T * (this.C.length + (this.M[13] ? 3 : 9)) + 1;
  518. break;
  519. case 34:
  520. this.C[this.c] = this.C[this.I] & this.C[this.F],
  521. this.T = this.T * (this.M[15] - 6) + 12;
  522. break;
  523. case 41:
  524. this.C[this.c] = this.C[this.I] <= this.C[this.F],
  525. this.T = 8 * this.T + 27;
  526. break;
  527. case 48:
  528. this.C[this.c] = !this.C[this.I],
  529. this.T = 7 * this.T + 16;
  530. break;
  531. case 50:
  532. this.C[this.c] = this.C[this.I] | this.C[this.F],
  533. this.T = 6 * this.T + 52;
  534. break;
  535. case 57:
  536. this.C[this.c] = this.C[this.I] >>> this.C[this.F],
  537. this.T = 7 * this.T - 47;
  538. break;
  539. case 64:
  540. this.C[this.c] = this.C[this.I] << this.C[this.F],
  541. this.T = 5 * this.T + 32;
  542. break;
  543. case 71:
  544. this.C[this.c] = this.C[this.I] ^ this.C[this.F],
  545. this.T = 6 * this.T - 74;
  546. break;
  547. case 78:
  548. this.C[this.c] = this.C[this.I] & this.C[this.F],
  549. this.T = 4 * this.T + 40;
  550. break;
  551. case 80:
  552. this.C[this.c] = this.C[this.I] < this.C[this.F],
  553. this.T = 5 * this.T - 48;
  554. break;
  555. case 87:
  556. this.C[this.c] = -this.C[this.I],
  557. this.T = 3 * this.T + 91;
  558. break;
  559. case 94:
  560. this.C[this.c] = this.C[this.I] > this.C[this.F],
  561. this.T = 4 * this.T - 24;
  562. break;
  563. case 101:
  564. this.C[this.c] = this.C[this.I] in this.C[this.F],
  565. this.T = 3 * this.T + 49;
  566. break;
  567. case 108:
  568. this.C[this.c] = o(this.C[this.I]),
  569. this.T = 2 * this.T + 136;
  570. break;
  571. case 110:
  572. this.C[this.c] = this.C[this.I] !== this.C[this.F],
  573. this.T += 242;
  574. break;
  575. case 117:
  576. this.C[this.c] = this.C[this.I] && this.C[this.F],
  577. this.T = 3 * this.T + 1;
  578. break;
  579. case 124:
  580. this.C[this.c] = this.C[this.I] || this.C[this.F],
  581. this.T += 228;
  582. break;
  583. case 131:
  584. this.C[this.c] = this.C[this.I] >= this.C[this.F],
  585. this.T = 3 * this.T - 41;
  586. break;
  587. case 138:
  588. this.C[this.c] = this.C[this.I] == this.C[this.F],
  589. this.T = 2 * this.T + 76;
  590. break;
  591. case 140:
  592. this.C[this.c] = this.C[this.I] % this.C[this.F],
  593. this.T += 212;
  594. break;
  595. case 147:
  596. this.C[this.c] = this.C[this.I] / this.C[this.F],
  597. this.T += 205;
  598. break;
  599. case 154:
  600. this.C[this.c] = this.C[this.I] * this.C[this.F],
  601. this.T += 198;
  602. break;
  603. case 161:
  604. this.C[this.c] = this.C[this.I] - this.C[this.F],
  605. this.T += 191;
  606. break;
  607. case 168:
  608. this.C[this.c] = this.C[this.I] + this.C[this.F],
  609. this.T = 2 * this.T + 16;
  610. break;
  611. case 254:
  612. this.C[this.c] = eval(i),
  613. this.T += 20 < this.M[11] ? 98 : 89;
  614. break;
  615. case 255:
  616. this.s = C || 0,
  617. this.M[26] = 52,
  618. this.T += this.M[13] ? 8 : 6;
  619. break;
  620. case 258:
  621. g = {};
  622. for (var F = 0; F < this.k; F++)
  623. e = this.i.pop(),
  624. a = this.i.pop(),
  625. g[a] = e;
  626. this.C[this.W] = g,
  627. this.T += 94;
  628. break;
  629. case 261:
  630. this.D = s || [],
  631. this.M[11] = 68,
  632. this.T += this.M[26] ? 3 : 5;
  633. break;
  634. case 264:
  635. this.M[15] = 16,
  636. this.T = "string" == typeof A ? 331 : 336;
  637. break;
  638. case 266:
  639. this.C[this.I][i] = this.i.pop(),
  640. this.T += 86;
  641. break;
  642. case 278:
  643. this.C[this.c] = this.C[this.I][i],
  644. this.T += this.M[22] ? 63 : 74;
  645. break;
  646. case 283:
  647. this.C[this.c] = eval(String.fromCharCode(this.C[this.I]));
  648. break;
  649. case 300:
  650. S = this.U(),
  651. this.M[0] = 66,
  652. this.T += this.M[11];
  653. break;
  654. case 331:
  655. D = atob(A),
  656. w = D.charCodeAt(0) << 16 | D.charCodeAt(1) << 8 | D.charCodeAt(2);
  657. for (var k = 3; k < w + 3; k += 3)
  658. this.G.push(D.charCodeAt(k) << 16 | D.charCodeAt(k + 1) << 8 | D.charCodeAt(k + 2));
  659. for (V = w + 3; V < D.length;)
  660. E = D.charCodeAt(V) << 8 | D.charCodeAt(V + 1),
  661. T = D.slice(V + 2, V + 2 + E),
  662. this.D.push(T),
  663. V += E + 2;
  664. this.M[21] = 8,
  665. this.T += 1e3 < V ? 21 : 35;
  666. break;
  667. case 336:
  668. this.G = A,
  669. this.D = s,
  670. this.M[18] = 134,
  671. this.T += this.M[15];
  672. break;
  673. case 344:
  674. this.T = 3 * this.T - 8;
  675. break;
  676. case 350:
  677. U = 66,
  678. M = [],
  679. I = this.D[this.k];
  680. for (var W = 0; W < I.length; W++)
  681. M.push(String.fromCharCode(24 ^ I.charCodeAt(W) ^ U)),
  682. U = 24 ^ I.charCodeAt(W) ^ U;
  683. r = parseInt(M.join("").split("|")[1]),
  684. this.C[this.W] = this.i.slice(this.i.length - r),
  685. this.i = this.i.slice(0, this.i.length - r),
  686. this.T += 2;
  687. break;
  688. case 352:
  689. this.e = this.G[this.s++],
  690. this.T -= this.M[26];
  691. break;
  692. case 360:
  693. this.a = S,
  694. this.T += this.M[0];
  695. break;
  696. case 368:
  697. this.T -= 500 < S - this.a ? 24 : 8;
  698. break;
  699. case 380:
  700. this.i.push(16383 & this.e),
  701. this.T -= 28;
  702. break;
  703. case 400:
  704. this.i.push(this.S[16383 & this.e]),
  705. this.T -= 48;
  706. break;
  707. case 408:
  708. this.T -= 64;
  709. break;
  710. case 413:
  711. this.C[this.e >> 15 & 7] = (this.e >> 18 & 1) == +[] ? 32767 & this.e : this.S[32767 & this.e],
  712. this.T -= 61;
  713. break;
  714. case 418:
  715. this.S[65535 & this.e] = this.C[this.e >> 16 & 7],
  716. this.T -= this.e >> 16 < 20 ? 66 : 80;
  717. break;
  718. case 423:
  719. this.c = this.e >> 16 & 7,
  720. this.I = this.e >> 13 & 7,
  721. this.F = this.e >> 10 & 7,
  722. this.J = 1023 & this.e,
  723. this.T -= 255 + 6 * this.J + this.J % 5;
  724. break;
  725. case 426:
  726. this.T += 5 * (this.e >> 19) - 18;
  727. break;
  728. case 428:
  729. this.W = this.e >> 16 & 7,
  730. this.k = 65535 & this.e,
  731. this.t.push(this.s),
  732. this.h.push(this.S),
  733. this.s = this.C[this.W],
  734. this.S = [];
  735. for (var J = 0; J < this.k; J++)
  736. this.S.unshift(this.i.pop());
  737. this.B.push(this.i),
  738. this.i = [],
  739. this.T -= 76;
  740. break;
  741. case 433:
  742. this.s = this.t.pop(),
  743. this.S = this.h.pop(),
  744. this.i = this.B.pop(),
  745. this.T -= 81;
  746. break;
  747. case 438:
  748. this.Q = this.C[this.e >> 16 & 7],
  749. this.T -= 86;
  750. break;
  751. case 440:
  752. U = 66,
  753. M = [],
  754. I = this.D[16383 & this.e];
  755. for (var b = 0; b < I.length; b++)
  756. M.push(String.fromCharCode(24 ^ I.charCodeAt(b) ^ U)),
  757. U = 24 ^ I.charCodeAt(b) ^ U;
  758. M = M.join("").split("|"),
  759. O = parseInt(M.shift()),
  760. this.i.push(O === +[] ? M.join("|") : O === +!+[] ? -1 !== M.join().indexOf(".") ? parseInt(M.join()) : parseFloat(M.join()) : O === !+[] + !+[] ? eval(M.join()) : 3 === O ? null : void 0),
  761. this.T -= 88;
  762. break;
  763. case 443:
  764. this.b = this.e >> 2 & 65535,
  765. this.J = 3 & this.e,
  766. this.J === +[] ? this.s = this.b : this.J === +!+[] ? !!this.Q && (this.s = this.b) : 2 === this.J ? !this.Q && (this.s = this.b) : this.s = this.b,
  767. this.g = null,
  768. this.T -= 91;
  769. break;
  770. case 445:
  771. this.i.push(this.C[this.e >> 14 & 7]),
  772. this.T -= 93;
  773. break;
  774. case 448:
  775. this.W = this.e >> 16 & 7,
  776. this.k = this.e >> 2 & 4095,
  777. this.J = 3 & this.e,
  778. Q = this.J === +!+[] && this.i.pop(),
  779. G = this.i.slice(this.i.length - this.k, this.i.length),
  780. this.i = this.i.slice(0, this.i.length - this.k),
  781. c = 2 < G.length ? 3 : G.length,
  782. this.T += 6 * this.J + 1 + 10 * c;
  783. break;
  784. case 449:
  785. this.C[3] = this.C[this.W](),
  786. this.T -= 97 - G.length;
  787. break;
  788. case 455:
  789. this.C[3] = this.C[this.W][Q](),
  790. this.T -= 103 + G.length;
  791. break;
  792. case 453:
  793. B = this.e >> 17 & 3,
  794. this.T = B === +[] ? 445 : B === +!+[] ? 380 : B === !+[] + !+[] ? 400 : 440;
  795. break;
  796. case 458:
  797. this.J = this.e >> 17 & 3,
  798. this.c = this.e >> 14 & 7,
  799. this.I = this.e >> 11 & 7,
  800. i = this.i.pop(),
  801. this.T -= 12 * this.J + 180;
  802. break;
  803. case 459:
  804. this.C[3] = this.C[this.W](G[+[]]),
  805. this.T -= 100 + 7 * G.length;
  806. break;
  807. case 461:
  808. this.C[3] = new this.C[this.W],
  809. this.T -= 109 - G.length;
  810. break;
  811. case 463:
  812. U = 66,
  813. M = [],
  814. I = this.D[65535 & this.e];
  815. for (var n = 0; n < I.length; n++)
  816. M.push(String.fromCharCode(24 ^ I.charCodeAt(n) ^ U)),
  817. U = 24 ^ I.charCodeAt(n) ^ U;
  818. M = M.join("").split("|"),
  819. O = parseInt(M.shift()),
  820. this.T += 10 * O + 3;
  821. break;
  822. case 465:
  823. this.C[3] = this.C[this.W][Q](G[+[]]),
  824. this.T -= 13 * G.length + 100;
  825. break;
  826. case 466:
  827. this.C[this.e >> 16 & 7] = M.join("|"),
  828. this.T -= 114 * M.length;
  829. break;
  830. case 468:
  831. this.g = 65535 & this.e,
  832. this.T -= 116;
  833. break;
  834. case 469:
  835. this.C[3] = this.C[this.W](G[+[]], G[1]),
  836. this.T -= 119 - G.length;
  837. break;
  838. case 471:
  839. this.C[3] = new this.C[this.W](G[+[]]),
  840. this.T -= 118 + G.length;
  841. break;
  842. case 473:
  843. throw this.C[this.e >> 16 & 7];
  844. case 475:
  845. this.C[3] = this.C[this.W][Q](G[+[]], G[1]),
  846. this.T -= 123;
  847. break;
  848. case 476:
  849. this.C[this.e >> 16 & 7] = -1 !== M.join().indexOf(".") ? parseInt(M.join()) : parseFloat(M.join()),
  850. this.T -= this.M[21] < 10 ? 124 : 126;
  851. break;
  852. case 478:
  853. t = [0].concat(x(this.S)),
  854. this.V = 65535 & this.e,
  855. h = this,
  856. this.C[3] = function (e) {
  857. var n = new l;
  858. return n.S = t,
  859. n.S[0] = e,
  860. n.O(h.G, h.V, h.D),
  861. n.C[3]
  862. }
  863. ,
  864. this.T -= 50 < this.M[3] ? 120 : 126;
  865. break;
  866. case 479:
  867. this.C[3] = this.C[this.W].apply(null, G),
  868. this.M[3] = 168,
  869. this.T -= this.M[9] ? 127 : 128;
  870. break;
  871. case 481:
  872. this.C[3] = new this.C[this.W](G[+[]], G[1]),
  873. this.T -= 10 * G.length + 109;
  874. break;
  875. case 483:
  876. this.J = this.e >> 15 & 15,
  877. this.W = this.e >> 12 & 7,
  878. this.k = 4095 & this.e,
  879. this.T = 0 === this.J ? 258 : 350;
  880. break;
  881. case 485:
  882. this.C[3] = this.C[this.W][Q].apply(null, G),
  883. this.T -= this.M[15] % 2 == 1 ? 143 : 133;
  884. break;
  885. case 486:
  886. this.C[this.e >> 16 & 7] = eval(M.join()),
  887. this.T -= this.M[18];
  888. break;
  889. case 491:
  890. this.C[3] = new this.C[this.W].apply(null, G),
  891. this.T -= this.M[8] / this.M[1] < 10 ? 139 : 130;
  892. break;
  893. case 496:
  894. this.C[this.e >> 16 & 7] = null,
  895. this.T -= 10 < this.M[5] - this.M[3] ? 160 : 144;
  896. break;
  897. case 506:
  898. this.C[this.e >> 16 & 7] = void 0,
  899. this.T -= this.M[18] % this.M[12] == 1 ? 154 : 145;
  900. break;
  901. default:
  902. this.T = this.w
  903. }
  904. } catch (A) {
  905. this.g && (this.s = this.g),
  906. this.T -= 114
  907. }
  908. }
  909. ,
  910. "undefined" != typeof window && (S.__ZH__ = S.__ZH__ || {},
  911. h = S.__ZH__.zse = S.__ZH__.zse || {},
  912. (new l).O("ABt7CAAUSAAACADfSAAACAD1SAAACAAHSAAACAD4SAAACAACSAAACADCSAAACADRSAAACABXSAAACAAGSAAACADjSAAACAD9SAAACADwSAAACACASAAACADeSAAACABbSAAACADtSAAACAAJSAAACAB9SAAACACdSAAACADmSAAACABdSAAACAD8SAAACADNSAAACABaSAAACABPSAAACACQSAAACADHSAAACACfSAAACADFSAAACAC6SAAACACnSAAACAAnSAAACAAlSAAACACcSAAACADGSAAACAAmSAAACAAqSAAACAArSAAACACoSAAACADZSAAACACZSAAACAAPSAAACABnSAAACABQSAAACAC9SAAACABHSAAACAC/SAAACABhSAAACABUSAAACAD3SAAACABfSAAACAAkSAAACABFSAAACAAOSAAACAAjSAAACAAMSAAACACrSAAACAAcSAAACABySAAACACySAAACACUSAAACABWSAAACAC2SAAACAAgSAAACABTSAAACACeSAAACABtSAAACAAWSAAACAD/SAAACABeSAAACADuSAAACACXSAAACABVSAAACABNSAAACAB8SAAACAD+SAAACAASSAAACAAESAAACAAaSAAACAB7SAAACACwSAAACADoSAAACADBSAAACACDSAAACACsSAAACACPSAAACACOSAAACACWSAAACAAeSAAACAAKSAAACACSSAAACACiSAAACAA+SAAACADgSAAACADaSAAACADESAAACADlSAAACAABSAAACADASAAACADVSAAACAAbSAAACABuSAAACAA4SAAACADnSAAACAC0SAAACACKSAAACABrSAAACADySAAACAC7SAAACAA2SAAACAB4SAAACAATSAAACAAsSAAACAB1SAAACADkSAAACADXSAAACADLSAAACAA1SAAACADvSAAACAD7SAAACAB/SAAACABRSAAACAALSAAACACFSAAACABgSAAACADMSAAACACESAAACAApSAAACABzSAAACABJSAAACAA3SAAACAD5SAAACACTSAAACABmSAAACAAwSAAACAB6SAAACACRSAAACABqSAAACAB2SAAACABKSAAACAC+SAAACAAdSAAACAAQSAAACACuSAAACAAFSAAACACxSAAACACBSAAACAA/SAAACABxSAAACABjSAAACAAfSAAACAChSAAACABMSAAACAD2SAAACAAiSAAACADTSAAACAANSAAACAA8SAAACABESAAACADPSAAACACgSAAACABBSAAACABvSAAACABSSAAACAClSAAACABDSAAACACpSAAACADhSAAACAA5SAAACABwSAAACAD0SAAACACbSAAACAAzSAAACADsSAAACADISAAACADpSAAACAA6SAAACAA9SAAACAAvSAAACABkSAAACACJSAAACAC5SAAACABASAAACAARSAAACABGSAAACADqSAAACACjSAAACADbSAAACABsSAAACACqSAAACACmSAAACAA7SAAACACVSAAACAA0SAAACABpSAAACAAYSAAACADUSAAACABOSAAACACtSAAACAAtSAAACAAASAAACAB0SAAACADiSAAACAB3SAAACACISAAACADOSAAACACHSAAACACvSAAACADDSAAACAAZSAAACABcSAAACAB5SAAACADQSAAACAB+SAAACACLSAAACAADSAAACABLSAAACACNSAAACAAVSAAACACCSAAACABiSAAACADxSAAACAAoSAAACACaSAAACABCSAAACAC4SAAACAAxSAAACAC1SAAACAAuSAAACADzSAAACABYSAAACABlSAAACAC3SAAACAAISAAACAAXSAAACABISAAACAC8SAAACABoSAAACACzSAAACADSSAAACACGSAAACAD6SAAACADJSAAACACkSAAACABZSAAACADYSAAACADKSAAACADcSAAACAAySAAACADdSAAACACYSAAACACMSAAACAAhSAAACADrSAAACADWSAAAeIAAEAAACAB4SAAACAAySAAACABiSAAACABlSAAACABjSAAACABiSAAACAB3SAAACABkSAAACABnSAAACABrSAAACABjSAAACAB3SAAACABhSAAACABjSAAACABuSAAACABvSAAAeIABEAABCABkSAAACAAzSAAACABkSAAACAAySAAACABlSAAACAA3SAAACAAySAAACAA2SAAACABmSAAACAA1SAAACAAwSAAACABkSAAACAA0SAAACAAxSAAACAAwSAAACAAxSAAAeIABEAACCAAgSAAATgACVAAAQAAGEwADDAADSAAADAACSAAADAAASAAACANcIAADDAADSAAASAAATgADVAAATgAEUAAATgAFUAAATgAGUgAADAAASAAASAAATgADVAAATgAEUAAATgAFUAAATgAHUgAADAABSAAASAAATgADVAAATgAEUAAATgAFUAAATgAIUgAAcAgUSMAATgAJVAAATgAKUgAAAAAADAABSAAADAAAUAAACID/GwQPCAAYG2AREwAGDAABCIABGwQASMAADAAAUAAACID/GwQPCAAQG2AREwAHDAABCIACGwQASMAADAAAUAAACID/GwQPCAAIG2AREwAIDAABCIADGwQASMAADAAAUAAACID/GwQPEwAJDYAGDAAHG2ATDAAIG2ATDAAJG2ATKAAACAD/DIAACQAYGygSGwwPSMAASMAADAACSAAADAABUgAACAD/DIAACQAQGygSGwwPSMAASMAADAACCIABGwQASMAADAABUgAACAD/DIAACQAIGygSGwwPSMAASMAADAACCIACGwQASMAADAABUgAACAD/DIAAGwQPSMAASMAADAACCIADGwQASMAADAABUgAAKAAACAAgDIABGwQBEwANDAAAWQALGwQPDAABG2AREwAODAAODIAADQANGygSGwwTEwAPDYAPKAAACAAESAAATgACVAAAQAAGEwAQCAAESAAATgACVAAAQAAGEwAFDAAASAAADAAQSAAACAAASAAACAKsIAADCAAASAAADAAQUAAACID/GwQPSMAADAABUAAASAAASAAACAAASAAADAAFUgAACAABSAAADAAQUAAACID/GwQPSMAADAABUAAASAAASAAACAABSAAADAAFUgAACAACSAAADAAQUAAACID/GwQPSMAADAABUAAASAAASAAACAACSAAADAAFUgAACAADSAAADAAQUAAACID/GwQPSMAADAABUAAASAAASAAACAADSAAADAAFUgAADAAFSAAACAAASAAACAJ8IAACEwARDAARSAAACAANSAAACALdIAACEwASDAARSAAACAAXSAAACALdIAACEwATDAARDIASGwQQDAATG2AQEwAUDYAUKAAAWAAMSAAAWAANSAAAWAAOSAAAWAAPSAAAWAAQSAAAWAARSAAAWAASSAAAWAATSAAAWAAUSAAAWAAVSAAAWAAWSAAAWAAXSAAAWAAYSAAAWAAZSAAAWAAaSAAAWAAbSAAAWAAcSAAAWAAdSAAAWAAeSAAAWAAfSAAAWAAgSAAAWAAhSAAAWAAiSAAAWAAjSAAAWAAkSAAAWAAlSAAAWAAmSAAAWAAnSAAAWAAoSAAAWAApSAAAWAAqSAAAWAArSAAAeIAsEAAXWAAtSAAAWAAuSAAAWAAvSAAAWAAwSAAAeIAxEAAYCAAESAAATgACVAAAQAAGEwAZCAAkSAAATgACVAAAQAAGEwAaDAABSAAACAAASAAACAJ8IAACSMAASMAACAAASAAADAAZUgAADAABSAAACAAESAAACAJ8IAACSMAASMAACAABSAAADAAZUgAADAABSAAACAAISAAACAJ8IAACSMAASMAACAACSAAADAAZUgAADAABSAAACAAMSAAACAJ8IAACSMAASMAACAADSAAADAAZUgAACAAASAAADAAZUAAACIAASEAADIAYUEgAGwQQSMAASMAACAAASAAADAAaUgAACAABSAAADAAZUAAACIABSEAADIAYUEgAGwQQSMAASMAACAABSAAADAAaUgAACAACSAAADAAZUAAACIACSEAADIAYUEgAGwQQSMAASMAACAACSAAADAAaUgAACAADSAAADAAZUAAACIADSEAADIAYUEgAGwQQSMAASMAACAADSAAADAAaUgAACAAAEAAJDAAJCIAgGwQOMwAGOBG2DAAJCIABGwQASMAADAAaUAAAEAAbDAAJCIACGwQASMAADAAaUAAAEAAcDAAJCIADGwQASMAADAAaUAAAEAAdDAAbDIAcGwQQDAAdG2AQDAAJSAAADAAXUAAAG2AQEwAeDAAeSAAADAACSAAACALvIAACEwAfDAAJSAAADAAaUAAADIAfGwQQSMAASMAADAAJCIAEGwQASMAADAAaUgAADAAJCIAEGwQASMAADAAaUAAASAAASAAADAAJSAAADAAAUgAADAAJCIABGQQAEQAJOBCIKAAADAABTgAyUAAACIAQGwQEEwAVCAAQDIAVGwQBEwAKCAAAEAAhDAAhDIAKGwQOMwAGOBImDAAKSAAADAABTgAzQAAFDAAhCIABGQQAEQAhOBHoCAAASAAACAAQSAAADAABTgA0QAAJEwAiCAAQSAAATgACVAAAQAAGEwAjCAAAEAALDAALCIAQGwQOMwAGOBLSDAALSAAADAAiUAAADIALSEAADIAAUEgAGwQQCAAqG2AQSMAASMAADAALSAAADAAjUgAADAALCIABGQQAEQALOBJkDAAjSAAATgAJVAAATgA1QAAFEwAkDAAkTgA0QAABEwAlCAAQSAAADAABTgAyUAAASA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4VGQIVLx4UBQ4ZDwALalQ7NA4RERMfBAAAFmpUOxgwCh8eDgMHCw81IgsPFQEMDQkAFWpUOxg0DhEREx8EACoiCw8VAQwNCQAdalQ7GDAKHx4OAwcLDzU0CAkDARwzIQsDFQ8FHhkAFWpUOxghBgQOAwcLDzUiCw8VAQwNCQAUalQ7GCMOAwcLDzUyAwEdCwkYDRkABmpUID0NCQAFalQKGQAAB2tVVRkYGBgABmpUKTQNBAAIalQWCxcSExoAB2pUAhIbGAUACWpUEQMFAxkXCgADalRkAAdqVFJIDiQGAAtqVBUjHW9telRIQQAJalQKLzkmNSYbABdqVCdvdgsWbht5IjltEFteRS0EPQM1DQAZalQwPx4aWH4sCQ4xNxMnMSA1X1s+b1MNOgACalQACGpUBxMRCyst"));
  913. var D = function (t) {
  914. return __g._encrypt(encodeURIComponent(t))
  915. };
  916. exports.XL = A,
  917. exports.ZP = D
  918. }
  919.  
  920. var o = {};
  921. f1(void 0, o)
  922. return o.ZP(s)
  923. }
  924.  
  925.  
  926. function genCommentHeader(url) {
  927. function K() {
  928. var t = (new RegExp("d_c0=([^;]+)")).exec(document.cookie);
  929. return t && t[1]
  930. }
  931.  
  932. var z = function(t) {
  933. var e = new URL(t,"https://www.zhihu.com");
  934. return "" + e.pathname + e.search
  935. };
  936. var
  937. S = function (t, e, n, r) {
  938. var o = n.zse93
  939. , i = n.dc0
  940. , a = n.xZst81
  941. , u = z(t)
  942. , c = ""
  943. , s = [o, u, i, "", a].filter(Boolean).join("+")
  944. ;
  945. return {
  946. source: s,
  947. signature: zhihu_enc(md5(s))
  948. }
  949. }(url, void 0, {
  950. zse93: '101_3_3.0',
  951. dc0: K(),
  952. xZst81: null
  953. })
  954.  
  955. return {
  956. "x-zse-93": "101_3_3.0",
  957. "x-zse-96": "2.0_" + S.signature
  958. }
  959. }
  960.  
  961. // ---biz---
  962.  
  963.  
  964. // --- common biz ---
  965.  
  966. function processContinue() {
  967. document.body.classList.remove('ModalWrap-body');
  968. document.body.style.overflow = "auto";
  969. // question
  970. removeBySelector('div.Card.AnswersNavWrapper div.ModalWrap');
  971. // zvideo
  972. removeBySelector('#root > div > main > article > div.ModalWrap');
  973. }
  974.  
  975. function addCommonStyle() {
  976. let style = `<style>
  977. .CommentsForOia, #div-gpt-ad-bannerAd,div.Card.AnswersNavWrapper div.ModalWrap, .MobileModal-backdrop,
  978. .MobileModal--plain.ConfirmModal,.AdBelowMoreAnswers,div.Card.HotQuestions, button.OpenInAppButton.OpenInApp,
  979. .DownloadGuide-inner, .DownloadGuide, div.OpenInAppButton, div.Card.RelatedReadings {
  980. display: none;
  981. }
  982. .CommentItemV2 {
  983. position: relative;
  984. -ms-flex-negative: 0;
  985. flex-shrink: 0;
  986. padding: 10px 5px;
  987. font-size: 15px
  988. }
  989. .CommentItemV2-footer {
  990. box-sizing: border-box;
  991. display: flex;
  992. }
  993. .CommentItemV2-time {
  994. font-size: 13px;
  995. color: #8590a6;
  996. flex: 1 1 auto;
  997. }
  998. .CommentItemV2-content {
  999. margin-bottom: 6px;
  1000. line-height: 25px;
  1001. }
  1002. .CommentItemV2-reply, .CommentItemV2-roleInfo, html[data-theme=dark] .CommentItemV2-reply, html[data-theme=dark] .CommentItemV2-roleInfo {
  1003. color: #8590a6;
  1004. }
  1005. .NestComment .NestComment--child {
  1006. position: relative;
  1007. padding-left: 33px;
  1008. }
  1009. .CommentRichText img[data-zhihu-emoticon] {
  1010. height: 1.4em;
  1011. width: 1.4em;
  1012. vertical-align: bottom;
  1013. }
  1014. </style>`;
  1015. addStyle(style);
  1016. }
  1017.  
  1018. function removeCommonBlock() {
  1019. removeBySelector('button.OpenInAppButton');
  1020. removeBySelector('.CommentsForOia');
  1021. }
  1022.  
  1023. function skipOpenApp() {
  1024. log('run:skipOpenApp');
  1025. // .ContentItem.AnswerItem
  1026. // .RichContent.is-collapsed.RichContent--unescapable
  1027. Array.prototype.forEach.call(document.querySelectorAll('.ContentItem.AnswerItem'), function (ele) {
  1028. let elRichContentInner = ele.querySelector('.RichContent-inner');
  1029. let elRichContent = ele.querySelector('.RichContent');
  1030. let button = ele.querySelector('button');
  1031.  
  1032. if (button) {
  1033. button.style.display = 'none';
  1034. }
  1035. if (elRichContentInner && elRichContent) {
  1036. let elMTimeMeta = ele.querySelector('meta[itemprop="dateModified"]');
  1037. let elCTimeMeta = ele.querySelector('meta[itemprop="dateCreated"]');
  1038.  
  1039. if (elMTimeMeta && elCTimeMeta) {
  1040. let mTime = elMTimeMeta.getAttribute('content').toString().split('T')[0];
  1041. let cTime = elCTimeMeta.getAttribute('content').toString().split('T')[0];
  1042. let elATime = ele.querySelector('.ContentItem-time');
  1043. let url = elCTimeMeta.previousElementSibling.getAttribute('content');
  1044. let mHtml = '';
  1045.  
  1046. if (mTime !== cTime) {
  1047. mHtml = `<span class="my-updated-time">编辑于 ${mTime}</span>`;
  1048. }
  1049. let tmpHtml = `<div>
  1050. <div class="ContentItem-time">
  1051. <a target="_blank" href="${url}">
  1052. <span class="my-created-time">发布于 ${cTime}</span>${mHtml}
  1053. </a>
  1054. </div>
  1055. </div>`;
  1056. if (elATime) {
  1057. elATime.remove();
  1058. }
  1059. elRichContentInner.insertAdjacentHTML('afterend', tmpHtml);
  1060. }
  1061.  
  1062. setTimeout(function () {
  1063. if (!elRichContent.classList.contains('is-collapsed')) {
  1064. return;
  1065. }
  1066. log('process:is-collapsed');
  1067. ele.classList.add('my-fold');
  1068. elRichContentInner.insertAdjacentHTML('afterend', `<span class="my-more-btn down-img"></span><span class="my-less-btn up-img"></span>`);
  1069. elRichContent.classList.remove('is-collapsed');
  1070. elRichContentInner.setAttribute("style", "");
  1071. processFold(elRichContent);
  1072. }, 1000);
  1073.  
  1074. forEachArray(elRichContentInner.querySelectorAll('.GifPlayer'), el => {
  1075. el.addEventListener('click', () => {
  1076. let elImg = el.querySelector('img'),
  1077. elIcon = el.querySelector('svg'),
  1078. url = elImg.getAttribute('src').toString().replace('.jpg', '.webp');
  1079. if (elIcon) {
  1080. elImg.setAttribute('src', url);
  1081. elIcon.remove();
  1082. }
  1083. });
  1084. });
  1085.  
  1086. let eleVoteButton = ele.querySelector('.VoteButton--up');
  1087. if (eleVoteButton) {
  1088. eleVoteButton.style = null;
  1089. }
  1090.  
  1091. } else {
  1092. log('RichContent not found')
  1093. }
  1094.  
  1095.  
  1096. ele.addEventListener("click", function (event) {
  1097. event.preventDefault();
  1098. event.stopPropagation();
  1099. if (elRichContentInner) {
  1100. elRichContentInner.setAttribute("style", "");
  1101. }
  1102. });
  1103.  
  1104. bindClickComment(ele.parentElement);
  1105. });
  1106.  
  1107.  
  1108. }
  1109.  
  1110. function removeAds() {
  1111. log('run:removeAds');
  1112. Array.prototype.forEach.call(document.querySelectorAll('.MBannerAd'), function (ele) {
  1113. ele.parentNode.removeChild(ele)
  1114. });
  1115. }
  1116.  
  1117. function removeBlock() {
  1118. log('run:removeBlock');
  1119. removeBySelector('.MobileModal-backdrop');
  1120. removeBySelector('.MobileModal--plain.ConfirmModal');
  1121. removeBySelector('.AdBelowMoreAnswers');
  1122. removeBySelector('div.Card.HotQuestions');
  1123. removeBySelector('div.KfeCollection-VipRecommendCard');
  1124. hideBySelector('div.ModalWrap');
  1125.  
  1126. let counter = 3;
  1127. let interval = null;
  1128. interval = setInterval(function () {
  1129. forEachBySelector('iframe', ele => {
  1130. if (!ele.getAttribute('src').toString().match(/^https?:\/\/[a-zA-Z0-9]+?\.?zhihu.com\//)) {
  1131. ele.remove();
  1132. }
  1133. });
  1134. counter--;
  1135. if (counter < 0) {
  1136. clearInterval(interval);
  1137. }
  1138. }, 1000);
  1139. }
  1140.  
  1141.  
  1142. function processContent(content) {
  1143. if (!content)
  1144. return '';
  1145. var r = /<img src="data:image.+?"(.+?)data-actualsrc="(.+?)"\/>/g;
  1146. return content.replace(r, '<img src="$2"$1/>');
  1147. }
  1148.  
  1149. function loadContent(url) {
  1150. let myHeaders = new Headers();
  1151. const myInit = {
  1152. method: 'GET',
  1153. headers: myHeaders,
  1154. };
  1155.  
  1156. return fetch(url, myInit).then(response => response.json());
  1157. }
  1158.  
  1159. function genAnswerItemHtml(data) {
  1160. var content = processContent(data.content);
  1161. let upTimeHtml = '';
  1162. if (getDate(data.created_time) !== getDate(data.updated_time)) {
  1163. upTimeHtml = `<span class="my-updated-time">编辑于 ${formatDate(data.updated_time, 'yyyy-MM-dd')}</span>`;
  1164. }
  1165. let headline = data.author.headline ||
  1166. data.author.badge_v2 && data.author.badge_v2.detail_badges[0] && data.author.badge_v2.detail_badges[0].description ||
  1167. data.author.badge && data.author.badge[0] && data.author.badge[0].description || '';
  1168.  
  1169. var html = `<div class="List-item" tabindex="0" id="answer-${data.id}">
  1170. <div class="ContentItem AnswerItem my-fold" data-za-index="0">
  1171. <div class="ContentItem-meta">
  1172. <div class="AuthorInfo AnswerItem-authorInfo AnswerItem-authorInfo--related" itemprop="author" itemscope=""
  1173. itemtype="http://schema.org/Person">
  1174. <span class="UserLink AuthorInfo-avatarWrapper">
  1175. <a class="UserLink-link"
  1176. target="_blank"
  1177. href="//www.zhihu.com/people/${data.author.url_token}">
  1178. <img class="Avatar AuthorInfo-avatar" width="38" height="38"
  1179. src="${data.author.avatar_url_template}"
  1180. alt="">
  1181. </a>
  1182. </span>
  1183. <div class="AuthorInfo-content">
  1184. <div class="AuthorInfo-head">
  1185. <span class="UserLink AuthorInfo-name">
  1186. <a class="UserLink-link"
  1187. target="_blank"
  1188. href="//www.zhihu.com/people/${data.author.url_token}">${data.author.name}</a>
  1189. </span>
  1190. </div>
  1191. <div class="AuthorInfo-detail">
  1192. <div class="AuthorInfo-badge">
  1193. <div class="ztext AuthorInfo-badgeText">${headline}</div>
  1194. </div>
  1195. </div>
  1196. </div>
  1197. </div>
  1198. </div>
  1199. <meta itemprop="image">
  1200. <meta itemprop="upvoteCount" content="${data.voteup_count}">
  1201. <meta itemprop="url" content="https://www.zhihu.com/question/${questionNumber}/answer/${data.id}">
  1202. <meta itemprop="dateCreated" content="${formatDate(data.created_time, 'yyyy-MM-ddThh:mm:ss')}.000Z">
  1203. <meta itemprop="dateModified" content="${formatDate(data.updated_time, 'yyyy-MM-ddThh:mm:ss')}.000Z">
  1204. <meta itemprop="commentCount" content="${data.comment_count}">
  1205. <div class="RichContent RichContent--unescapable">
  1206. <div class="RichContent-inner RichContent-inner--collapsed">
  1207. <span class="RichText ztext CopyrightRichText-richText" itemprop="text">
  1208. ${content}
  1209. </span>
  1210. </div>
  1211. <div>
  1212. <div class="ContentItem-time">
  1213. <a target="_blank" href="//www.zhihu.com/question/${questionNumber}/answer/${data.id}">
  1214. <span class="my-created-time">发布于 ${formatDate(data.created_time, 'yyyy-MM-dd')}</span>${upTimeHtml}
  1215. </a>
  1216. </div>
  1217. </div>
  1218.  
  1219. <span class="my-more-btn down-img"></span>
  1220. <span class="my-less-btn up-img"></span>
  1221.  
  1222. <div class="ContentItem-actions">
  1223. <span>
  1224. <button aria-label="赞同 ${formatNumber(data.voteup_count)}" type="button" class="Button VoteButton VoteButton--up">
  1225. <span style="display: inline-flex; align-items: center;">&#8203;
  1226. <svg class="Zi Zi--TriangleUp VoteButton-TriangleUp" fill="currentColor" viewBox="0 0 24 24"
  1227. width="10" height="10">
  1228. <path d="M2 18.242c0-.326.088-.532.237-.896l7.98-13.203C10.572 3.57 11.086 3 12 3c.915 0 1.429.571 1.784 1.143l7.98 13.203c.15.364.236.57.236.896 0 1.386-.875 1.9-1.955 1.9H3.955c-1.08 0-1.955-.517-1.955-1.9z"
  1229. fill-rule="evenodd"></path></svg>
  1230. </span>赞同 ${formatNumber(data.voteup_count)}
  1231. </button>
  1232. <button aria-label="反对" type="button"
  1233. class="Button VoteButton VoteButton--down VoteButton--mobileDown">
  1234. <span style="display: inline-flex; align-items: center;">&#8203;
  1235. <svg class="Zi Zi--TriangleDown" fill="currentColor" viewBox="0 0 24 24" width="10" height="10"><path
  1236. d="M20.044 3H3.956C2.876 3 2 3.517 2 4.9c0 .326.087.533.236.896L10.216 19c.355.571.87 1.143 1.784 1.143s1.429-.572 1.784-1.143l7.98-13.204c.149-.363.236-.57.236-.896 0-1.386-.876-1.9-1.956-1.9z"
  1237. fill-rule="evenodd"></path></svg>
  1238. </span>
  1239. </button>
  1240. </span>
  1241. <button type="button" class="Button ContentItem-action Button--plain Button--withIcon Button--withLabel">
  1242. <span style="display: inline-flex; align-items: center;">&#8203;
  1243. <svg width="1.2em" height="1.2em" viewBox="0 0 24 24" class="Zi Zi--Comment Button-zi t2ntD6J1DemdOdvh5FB4" fill="currentColor"><path fill-rule="evenodd" d="M12 2.75a9.25 9.25 0 1 0 4.737 17.197l2.643.817a1 1 0 0 0 1.25-1.25l-.8-2.588A9.25 9.25 0 0 0 12 2.75Z" clip-rule="evenodd"></path></svg>
  1244. </span>评论 ${formatNumber(data.comment_count)}
  1245. </button>
  1246. </div>
  1247. </div>
  1248. </div>
  1249. </div>`;
  1250. return html;
  1251. }
  1252.  
  1253.  
  1254. function genVideoHtml(videoId) {
  1255. if (!videoId)
  1256. return '';
  1257.  
  1258. var html = `<div class="RichText-video" data-za-detail-view-path-module="VideoItem" data-za-extra-module="{&quot;card&quot;:{&quot;content&quot;:{&quot;type&quot;:&quot;Video&quot;,&quot;sub_type&quot;:&quot;SelfHosted&quot;,&quot;video_id&quot;:&quot;${videoId}&quot;,&quot;is_playable&quot;:true}}}">
  1259. <div class="VideoCard VideoCard--interactive VideoCard--mobile">
  1260. <div class="VideoCard-layout">
  1261. <div class="VideoCard-video">
  1262. <div class="VideoCard-video-content">
  1263. <div class="VideoCard-player"><iframe frameborder="0" allowfullscreen="" src="https://www.zhihu.com/video/${videoId}?autoplay=false&amp;useMSE="></iframe></div>
  1264. </div>
  1265. </div>
  1266. </div>
  1267. <div class="VideoCard-mask"></div>
  1268. </div>
  1269. </div>
  1270. `;
  1271. return html;
  1272. }
  1273.  
  1274. function processVideo(elAncestor) {
  1275. if (elAncestor && elAncestor.querySelectorAll) {
  1276. forEachArray(elAncestor.querySelectorAll('a.video-box'), el => {
  1277. let videoId = el.dataset.lensId;
  1278. if (videoId) {
  1279. let html = genVideoHtml(videoId);
  1280. let div = document.createElement('div');
  1281. div.innerHTML = html;
  1282. el.insertAdjacentElement('afterend', div);
  1283. el.parentElement.removeChild(el);
  1284. }
  1285. });
  1286. }
  1287. }
  1288.  
  1289. function getListWrap() {
  1290. if (!elList) {
  1291. elList = document.querySelectorAll('.Question-main .List');
  1292. if (elList)
  1293. elList = elList[elList.length - 1];
  1294. }
  1295. return elList;
  1296. }
  1297.  
  1298. function loadAnswer() {
  1299. if (is_end || is_loading_answer) {
  1300. return;
  1301. }
  1302. if (elLoading) {
  1303. elLoading.classList.remove('hide');
  1304. }
  1305. is_loading_answer = 1;
  1306.  
  1307. if (answer_next_url === null) {
  1308. let elInit = document.querySelector('#js-initialData');
  1309. if (!elInit) {
  1310. return console.error('js-initialData not found.')
  1311. }
  1312.  
  1313. try {
  1314. let jsonInit = JSON.parse(elInit.innerText);
  1315. let answer = jsonInit.initialState.question.answers[questionNumber];
  1316. answer_next_url = answer['next'];
  1317. } catch (e) {
  1318. return console.error(e);
  1319. }
  1320. }
  1321.  
  1322. loadContent(answer_next_url).then(function (data) {
  1323. if (!answer_next_url) {
  1324. console.error('next_url empty');
  1325. return
  1326. }
  1327. if (elLoading) {
  1328. elLoading.classList.add('hide');
  1329. }
  1330. log('get data:', answer_next_url);
  1331. if (data.paging.is_end) {
  1332. is_end = 1;
  1333. }
  1334. answer_next_url = data.paging.next;
  1335. let elListWrap = getListWrap();
  1336. if (elListWrap) {
  1337. processLinkCard(elListWrap);
  1338. data.data.forEach(function (item) {
  1339. if (item.target_type !== 'answer') {
  1340. return log('not_answer:', item);
  1341. }
  1342.  
  1343. if (!load_answer_id_map[item.target.id]) {
  1344. load_answer_id_map[item.target.id] = 1;
  1345. let elListItemWrap = document.createElement('div');
  1346. elListItemWrap.innerHTML = genAnswerItemHtml(item.target);
  1347. elListWrap.insertAdjacentElement("beforeend", elListItemWrap);
  1348. processFold(elListItemWrap.querySelector('.RichContent'));
  1349. bindClickComment(elListItemWrap);
  1350. processAHref(elListItemWrap);
  1351. processVideo(elListItemWrap);
  1352. } else {
  1353. log('duplicate answer', item.target.id)
  1354. }
  1355. });
  1356. if (is_end) {
  1357. let html = '<div style="text-align: center; padding: 10px;">全部回答已加载完成...</div>'
  1358. elListWrap.insertAdjacentHTML("beforeend", html);
  1359. }
  1360. } else {
  1361. console.warn('elListWrap empty');
  1362. }
  1363. }).catch(function (err) {
  1364. console.error('load failed', err)
  1365. }).then(function () {
  1366. is_loading_answer = 0;
  1367. log('loading finish')
  1368. })
  1369. }
  1370.  
  1371.  
  1372. function addViewportCheckList(elListItem) {
  1373. if (elListItem) {
  1374. viewportElCheckList.push(elListItem);
  1375. }
  1376. }
  1377.  
  1378. function removeViewportCheckList(elListItem) {
  1379. viewportElCheckList.forEach(function (v, i) {
  1380. if (v === elListItem) {
  1381. viewportElCheckList.splice(i, 1);
  1382. }
  1383. })
  1384. }
  1385.  
  1386. function processFold(elRichContent) {
  1387. var elMoreBtn = elRichContent.querySelector('.my-more-btn');
  1388. var elLessBtn = elRichContent.querySelector('.my-less-btn');
  1389. var elContentItem = elLessBtn.closest('.ContentItem');
  1390. if (elMoreBtn && elLessBtn && elContentItem) {
  1391. let height = getElementHeight(elRichContent);
  1392. if (height > 0 && height < 400 && elRichContent.querySelectorAll('img').length < 2) {
  1393. elContentItem.classList.remove('my-fold');
  1394. elMoreBtn.remove();
  1395. elLessBtn.remove();
  1396. } else {
  1397. elMoreBtn.addEventListener('click', function (e) {
  1398. elContentItem.classList.add('my-unfold');
  1399. elContentItem.classList.remove('my-fold');
  1400. addViewportCheckList(elContentItem);
  1401. });
  1402. elLessBtn.addEventListener('click', function (e) {
  1403. elContentItem.classList.add('my-fold');
  1404. elContentItem.classList.remove('my-unfold');
  1405.  
  1406. removeViewportCheckList(elContentItem);
  1407. window.scrollTo(0, elContentItem.closest('.List-item').offsetTop);
  1408. });
  1409. }
  1410. }
  1411. }
  1412.  
  1413. function bindLoadData() {
  1414. log('run:bindLoadData');
  1415. var el;
  1416. if (inDetailPage) {
  1417. el = document.querySelector('.Card.ViewAll');
  1418. if (!el) {
  1419. console.warn('bindLoadData failed');
  1420. return;
  1421. }
  1422. el.style.textAlign = "center";
  1423. el.innerHTML = '<a class="QuestionMainAction ViewAll-QuestionMainAction" href="'+location.href.replace(/\/answer.+/,'')+'">查看所有回答<a>';
  1424. return;
  1425. }
  1426. document.querySelectorAll('.Question-main .Card').forEach(function (elCard) {
  1427. if (!el && elCard.classList && elCard.classList.length === 1) {
  1428. el = elCard;
  1429. }
  1430. });
  1431. if (!el) {
  1432. console.warn('bindLoadData failed');
  1433. return;
  1434. }
  1435. el.insertAdjacentHTML('afterend', `<div id="my-loading" class="hide"><div class="loadingio-spinner-dual-ring-41hxycfuw5t"><div class="ldio-4crll70kj">
  1436. <div></div><div><div></div></div>
  1437. </div></div></div>`);
  1438.  
  1439. elLoading = document.getElementById('my-loading');
  1440. window.onscroll = function() {
  1441. if (is_end) {
  1442. return;
  1443. }
  1444. if ((window.innerHeight + window.scrollY + 100) >= document.body.offsetHeight) {
  1445. log('reach bottom');
  1446. loadAnswer();
  1447. }
  1448. };
  1449. }
  1450.  
  1451. function bindProcessViewport() {
  1452. log('run:bindProcessViewport');
  1453. var interval;
  1454. document.addEventListener('scroll', function () {
  1455. if (interval) {
  1456. clearTimeout(interval);
  1457. }
  1458. interval = setTimeout(function () {
  1459. // log('scroll-view:', viewportElCheckList.length);
  1460. if (viewportElCheckList.length) {
  1461. viewportElCheckList.forEach(function (elListItem) {
  1462. var elLessBtn = elListItem.querySelector('.my-less-btn');
  1463. if (isElementInViewport(elListItem)) {
  1464. elLessBtn.classList.remove('hide');
  1465. } else {
  1466. elLessBtn.classList.add('hide');
  1467. }
  1468. });
  1469. }
  1470. }, 100);
  1471. }, false);
  1472. }
  1473.  
  1474. function loadCommentData(answerId, offset, isReverse) {
  1475. if (!answerId) {
  1476. return;
  1477. }
  1478. let url = `https://www.zhihu.com/api/v4/comment_v5/answers/${answerId}/root_comment?order_by=score&limit=20&offset=${offset}`;
  1479. if (isReverse)
  1480. url = `https://www.zhihu.com/api/v4/comment_v5/answers/${answerId}/root_comment?order_by=ts&limit=20&offset=${offset}`;
  1481. let myHeaders = new Headers(genCommentHeader(url));
  1482. const myInit = {
  1483. method: 'GET',
  1484. headers: myHeaders,
  1485. };
  1486. return fetch(url, myInit).then(response => response.json());
  1487. }
  1488.  
  1489. function loadChildCommentData(rootCommentId, offset) {
  1490. let url = `https://www.zhihu.com/api/v4/comment_v5/comment/${rootCommentId}/child_comment?order_by=ts&limit=20&offset=${offset}`
  1491. let myHeaders = new Headers(genCommentHeader(url));
  1492. const myInit = {
  1493. method: 'GET',
  1494. headers: myHeaders,
  1495. };
  1496. return fetch(url, myInit).then(response => response.json());
  1497. }
  1498.  
  1499. function getOffsetFromUrl(url) {
  1500. let m = url.toString().match(/offset=(\w+)&?/);
  1501. return m ? m[1] : '';
  1502. }
  1503.  
  1504. function processChildComment(elButton) {
  1505. if (!elButton) {
  1506. return;
  1507. }
  1508. let elWrap = elButton.parentElement.previousElementSibling,
  1509. elLoading = elButton.previousElementSibling,
  1510. rootId = elButton.dataset.rootId,
  1511. skipIds = elButton.dataset.skipIds.toString().split(','),
  1512. offset = elButton.dataset.offset || '',
  1513. loading = elButton.dataset.loading || '',
  1514. childCommentCount = elButton.dataset.childCommentCount || '',
  1515. remainCount = elButton.dataset.remainCount || '',
  1516. end = 0,
  1517. loadingTimer;
  1518.  
  1519. if (elButton.classList.contains('hide')) {
  1520. return;
  1521. }
  1522. elButton.classList.add('hide');
  1523. loadingTimer = setTimeout(() => elLoading.classList.remove('hide'), 500);
  1524. loadChildCommentData(rootId, offset).then(function (json) {
  1525. let html = '';
  1526. json.data.forEach(function (v) {
  1527. if (skipIds.indexOf(v.id) === -1) {
  1528. html += genCommentItemHtml(v, 'child');
  1529. if (remainCount) {
  1530. remainCount -= 1;
  1531. }
  1532. }
  1533. });
  1534.  
  1535. if (json.paging.is_end) {
  1536. // html += '<div class="my-center">子回复已全部加载完成...</div>'
  1537. end = 1;
  1538. } else {
  1539. elButton.dataset.offset = getOffsetFromUrl(json.paging.next);
  1540. }
  1541.  
  1542. elWrap.insertAdjacentHTML('beforeend', html)
  1543. }).finally(function () {
  1544. loadingTimer && clearTimeout(loadingTimer);
  1545. elLoading.classList.add('hide');
  1546. if (!end) {
  1547. elButton.classList.remove('hide');
  1548. if (childCommentCount) {
  1549. elButton.dataset.remainCount = remainCount;
  1550. elButton.innerText = `查看回复 ${remainCount} / ${childCommentCount}`;
  1551. }
  1552. }
  1553. })
  1554. }
  1555.  
  1556. function bindClickComment(elListItem) {
  1557. if (!elListItem)
  1558. return;
  1559. let elButton = elListItem.querySelector('button.ContentItem-action.Button--withLabel');
  1560. let elComment = elListItem.querySelector('.Comments-container');
  1561.  
  1562. if (!elButton) {
  1563. let elContentItemActions = elListItem.querySelector('.ContentItem-actions');
  1564. if (!elContentItemActions) {
  1565. console.warn('bindClickComment failed');
  1566. return;
  1567. }
  1568. let metaComment = elContentItemActions.parentElement.previousElementSibling.parentElement.querySelector('meta[itemprop="commentCount"]');
  1569. let commentCount = metaComment && metaComment.getAttribute('content') || '';
  1570. elButton = document.createElement('span');
  1571. elButton.innerHTML = `<button type="button" class="Button ContentItem-action Button--plain Button--withIcon Button--withLabel"><span style="display: inline-flex; align-items: center;">&ZeroWidthSpace;<svg width="1.2em" height="1.2em" viewBox="0 0 24 24" class="Zi Zi--Comment Button-zi t2ntD6J1DemdOdvh5FB4" fill="currentColor"><path fill-rule="evenodd" d="M12 2.75a9.25 9.25 0 1 0 4.737 17.197l2.643.817a1 1 0 0 0 1.25-1.25l-.8-2.588A9.25 9.25 0 0 0 12 2.75Z" clip-rule="evenodd"></path></svg></span>评论 ${commentCount}</button>`;
  1572. elContentItemActions.appendChild(elButton);
  1573. }
  1574.  
  1575. let fnFoldToggle = debounce(function () {
  1576. let elCommentWrap = elButton.elCommentWrap,
  1577. elCommentFold = elButton.elCommentFold;
  1578. if (!elCommentWrap || !elCommentFold) {
  1579. return
  1580. }
  1581. let rect = elCommentWrap.getBoundingClientRect()
  1582. if (rect.top > -200 && rect.top < 600) {
  1583. elCommentFold.classList.remove('hide')
  1584. } else {
  1585. elCommentFold.classList.add('hide')
  1586. }
  1587. }, 100);
  1588.  
  1589. elButton.addEventListener('click', function () {
  1590. let bindFold = () => document.addEventListener('scroll', fnFoldToggle, false);
  1591. let unbindFold = () => document.removeEventListener('scroll', fnFoldToggle, false);
  1592.  
  1593. if (elComment) {
  1594. elComment.classList.toggle('hide');
  1595. if (elComment.classList.contains('hide')) {
  1596. unbindFold();
  1597. } else {
  1598. bindFold();
  1599. }
  1600. } else {
  1601. let answerId = (elListItem.querySelector('.ContentItem-meta ~ meta[itemprop="url"]').getAttribute('content').match(/\/answer\/(\d+)/) || [])[1];
  1602. elComment = addCommentWrap(elListItem, answerId);
  1603.  
  1604. let elCommentWrap = elComment.querySelector('.CommentListV2');
  1605. let elSwitchBtn = elComment.querySelector('div.Topbar-options > button');
  1606. let elCommentFold = elComment.querySelector('a.comment-fold');
  1607.  
  1608. elComment.dataset.answerId = answerId;
  1609. elComment.dataset.offset = "";
  1610.  
  1611. elButton.elCommentWrap = elCommentWrap; // bind data
  1612. elButton.elCommentFold = elCommentFold;
  1613.  
  1614. processComment(elComment, elCommentWrap);
  1615.  
  1616. elCommentWrap.addEventListener('scroll', function(){
  1617. if (elCommentWrap.scrollTop + elCommentWrap.offsetHeight + 100 > elCommentWrap.scrollHeight) {
  1618. processComment(elComment, elCommentWrap);
  1619. }
  1620. }, false);
  1621.  
  1622. elCommentWrap.addEventListener('click', function(event){
  1623. if (event.target.closest('button.btn-child-comment')) {
  1624. processChildComment(event.target)
  1625. }
  1626. }, false);
  1627.  
  1628.  
  1629. elSwitchBtn.addEventListener('click', function(){
  1630. if (elSwitchBtn.innerText.replace(/[\s​]+/, '') === '切换为时间排序') {
  1631. elSwitchBtn.innerText = '切换为默认排序';
  1632. elComment.dataset.isReverse = "1";
  1633. } else {
  1634. elSwitchBtn.innerText = '切换为时间排序';
  1635. elComment.dataset.isReverse = "0";
  1636. }
  1637. elComment.dataset.offset = "";
  1638. elComment.dataset.isEnd = "0";
  1639. elCommentWrap.innerHTML = '';
  1640. processComment(elComment, elCommentWrap);
  1641. });
  1642.  
  1643. elCommentFold.addEventListener('click', function(){
  1644. elComment.classList.add('hide');
  1645. unbindFold();
  1646. });
  1647.  
  1648. bindFold();
  1649. }
  1650. });
  1651. }
  1652.  
  1653. function addCommentWrap(elListItem, answerId) {
  1654. if (!elListItem)
  1655. return;
  1656. var commentCount = elListItem.querySelector('meta[itemprop="commentCount"]').getAttribute('content');
  1657. let html = `<div class="Comments-container" id="comment-block-${answerId}">
  1658. <div class="CommentsV2 CommentsV2--withEditor">
  1659. <div class="Topbar CommentTopbar">
  1660. <div class="Topbar-title"><h2 class="CommentTopbar-title">${commentCount} 条评论</h2></div>
  1661. <div class="Topbar-options">
  1662. <button type="button" class="Button Button--plain Button--withIcon Button--withLabel">
  1663. <span style="display: inline-flex; align-items: center;">&#8203;
  1664. <svg class="Zi Zi--Switch Button-zi" fill="currentColor" viewBox="0 0 24 24" width="1.2em" height="1.2em">
  1665. <path d="M13.004 7V4.232c0-.405.35-.733.781-.733.183 0 .36.06.501.17l6.437 5.033c.331.26.376.722.1 1.033a.803.803 0 0 1-.601.264H2.75a.75.75 0 0 1-.75-.75V7.75A.75.75 0 0 1 2.75 7h10.254zm-1.997 9.999v2.768c0 .405-.35.733-.782.733a.814.814 0 0 1-.5-.17l-6.437-5.034a.702.702 0 0 1-.1-1.032.803.803 0 0 1 .6-.264H21.25a.75.75 0 0 1 .75.75v1.499a.75.75 0 0 1-.75.75H11.007z" fill-rule="evenodd"></path></svg>
  1666. </span>切换为时间排序
  1667. </button>
  1668. </div>
  1669. </div>
  1670. <a class="comment-fold up-img"></a>
  1671. <div class="CommentListV2">
  1672. </div>
  1673. </div>
  1674. </div>`;
  1675. elListItem.insertAdjacentHTML("beforeend", html);
  1676. return elListItem.querySelector('.Comments-container');
  1677. }
  1678.  
  1679. function genCommentHtml(dataList) {
  1680. if (!dataList || !dataList.length)
  1681. return '';
  1682. let html = '';
  1683. dataList.forEach(function(data) {
  1684. let liClass = data.child_comment_count ? 'rootComment' : 'rootCommentNoChild';
  1685. let tmp = genCommentItemHtml(data, liClass);
  1686. if (data.child_comment_count) {
  1687. let skipIds = [];
  1688. data.child_comments.forEach(function (v) {
  1689. skipIds.push(v.id)
  1690. tmp += genCommentItemHtml(v, 'child');
  1691. });
  1692. if (data.child_comment_count > data.child_comments.length) {
  1693. let remain_count = data.child_comment_count - data.child_comments.length;
  1694. tmp += '<div class="child-comment-wrap"></div><div class="my-center"><span class="hide">加载中...</span>'
  1695. tmp += `<button data-root-id="${data.id}" data-skip-ids="${skipIds.join(',')}" data-child-comment-count="${data.child_comment_count}" data-remain-count="${remain_count}" type="button" class="btn-child-comment Button Button--secondary Button--grey css-1p04wnp">查看回复 ${remain_count} / ${data.child_comment_count}<span style="display: inline-flex; align-items: center;">&ZeroWidthSpace;<svg width="24" height="24" viewBox="0 0 24 24" class="ZDI ZDI--ArrowRightSmall24" fill="currentColor"><path fill-rule="evenodd" d="m13.248 12-4.025 3.78a.684.684 0 0 0 0 1.01.796.796 0 0 0 1.075 0l4.42-4.15a.867.867 0 0 0 0-1.28l-4.42-4.15a.796.796 0 0 0-1.075 0 .684.684 0 0 0 0 1.01L13.248 12Z" clip-rule="evenodd"></path></svg></span></button>`
  1696. tmp += '</div>'
  1697. }
  1698. }
  1699. html += `<ul class="NestComment">${tmp}</ul>`;
  1700. });
  1701. return html;
  1702. }
  1703.  
  1704.  
  1705. function genCommentItemHtml(item, liClass) {
  1706. var replyHtml = '';
  1707. let authorTagHtml = '';
  1708. if (item.author_tag && item.author_tag.length) {
  1709. if (item.author_tag.filter(v => v.type === 'content_author')[0]) {
  1710. authorTagHtml = '<span class="author-tag">作者</span>'
  1711. }
  1712. }
  1713. if (item.reply_to_author) {
  1714. let tagHtml = ''
  1715. if (item.reply_author_tag && item.reply_author_tag.length) {
  1716. if (item.reply_author_tag.filter(v => v.type === 'content_author')[0]) {
  1717. tagHtml = `<span class="CommentItemV2-roleInfo author-tag">作者</span>`;
  1718. }
  1719. }
  1720. replyHtml += `
  1721. <svg width="12" height="12" viewBox="0 0 16 16" class="ZDI ZDI--ArrowRightAlt16 css-gx7lzm" fill="currentColor"><path d="M10.727 7.48a.63.63 0 0 1 0 1.039l-4.299 2.88c-.399.268-.926-.028-.926-.519V5.12c0-.491.527-.787.926-.52l4.299 2.881Z"></path></svg>
  1722. <span class="UserLink">
  1723. <a class="UserLink-link" data-za-detail-view-element_name="User" target="_blank"
  1724. href="//www.zhihu.com/people/${item.reply_to_author.url_token}">${item.reply_to_author.name}</a>${tagHtml}
  1725. </span>`;
  1726. }
  1727. let ip_info = item.comment_tag.filter(v => v.type === 'ip_info')[0];
  1728. let author_top = item.comment_tag.filter(v => v.type === 'author_top')[0];
  1729. let dot = ' · ';
  1730. let address_text = ip_info && ip_info['text'] ? ip_info['text']
  1731. .replace('IP 属地', '').replace('未知', '') + dot : '';
  1732. let hot = item.hot ? `<span>${dot}热评</span>` : '';
  1733. let pin = author_top ? `<span>${dot}置顶</span>` : '';
  1734. let content = item.content.replace(/\[.{1,8}?\]/g, getEmojiImg)
  1735. .replace(/<a([^<>]+?>)/g, function (match, p1) {
  1736. let res = '';
  1737. if (match.indexOf('href') > -1) { // open in new tab
  1738. if (p1.indexOf('target=') === -1) {
  1739. res = '<a target="_blank" '+ p1;
  1740. } else {
  1741. res = match.replace(/target=['"][^'"]*['"]/, 'target="_blank"');
  1742. }
  1743. } else {
  1744. res = match;
  1745. }
  1746. return res.replace(/href=['"]https?:\/\/link.zhihu.com\/\?target=([^'"]+)['"]/, function (_, p1) {
  1747. return 'href="'+decodeURIComponent(p1)+'"'
  1748. });
  1749. })
  1750. .replace(/<a.+?class="comment_sticker".+?>(.+?)<\/a>/, function (match, p1) {
  1751. let m = match.match(/href="(https?:\/\/[^'"]+\.[a-zA-Z]+)"/);
  1752. if (m) {
  1753. let url = m[1].replace(/_[a-z]+\./, '_xld\.');
  1754. return `<div class="comment_sticker"><img src="${url}" alt="${p1}" /></div>`;
  1755. }
  1756. return match;
  1757. })
  1758. .replace(/<a.+?class="comment_img".+?>\s*查看图片\s*<\/a>/, function (match) {
  1759. let m = match.match(/href="(https?:\/\/[^'"]+\.[a-zA-Z]+)"/);
  1760. if (m) {
  1761. let url = m[1].replace(/_[a-z]+\./, '_xld\.');
  1762. return `<div class="comment_img"><a target="_blank" href="${m[1]}"><img src="${url}" alt="查看图片" /></a></div>`;
  1763. }
  1764. return match;
  1765. });
  1766. var html = `<li class="NestComment--${liClass}">
  1767. <div class="CommentItemV2">
  1768. <div class="comment-item-wrap">
  1769. <div class="CommentItemV2-meta">
  1770. <span class="UserLink CommentItemV2-avatar">
  1771. <a class="UserLink-link" data-za-detail-view-element_name="User" target="_blank"
  1772. href="//www.zhihu.com/people/${item.author.url_token}">
  1773. <img class="Avatar UserLink-avatar"
  1774. width="30" height="30"
  1775. src="${formatUrl(item.author.avatar_url_template, 's')}"
  1776. srcset="${formatUrl(item.author.avatar_url_template, 'xs')} 2x"
  1777. alt="${item.author.name}">
  1778. </a>
  1779. </span>
  1780. </div>
  1781. <div class="CommentItemV2-metaSibling">
  1782. <span class="UserLink">
  1783. <a class="UserLink-link" data-za-detail-view-element_name="User"
  1784. target="_blank" href="//www.zhihu.com/people/${item.author.url_token}">${item.author.name}
  1785. </a>
  1786. ${authorTagHtml}
  1787. </span>${replyHtml}
  1788. <div class="CommentRichText CommentItemV2-content">
  1789. <div class="RichText ztext">${content}</div>
  1790. </div>
  1791. <div class="CommentItemV2-footer">
  1792. <span class="CommentItemV2-time">${address_text}${getDate(item.created_time)}${hot}${pin}</span>
  1793. <button type="button" class="Button CommentItemV2-likeBtn Button--plain"><span
  1794. style="display: inline-flex; align-items: center;">&#8203;<svg
  1795. class="Zi Zi--Like" fill="currentColor" viewBox="0 0 24 24" width="16"
  1796. height="16" style="margin-right: 5px;"><path
  1797. d="M14.445 9h5.387s2.997.154 1.95 3.669c-.168.51-2.346 6.911-2.346 6.911s-.763 1.416-2.86 1.416H8.989c-1.498 0-2.005-.896-1.989-2v-7.998c0-.987.336-2.032 1.114-2.639 4.45-3.773 3.436-4.597 4.45-5.83.985-1.13 3.2-.5 3.037 2.362C15.201 7.397 14.445 9 14.445 9zM3 9h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V10a1 1 0 0 1 1-1z"
  1798. fill-rule="evenodd"></path></svg></span>${item.like_count}
  1799. </button>
  1800. </div>
  1801. </div>
  1802. </div>
  1803. </div>
  1804. </li>`;
  1805. return html;
  1806. }
  1807.  
  1808. function genCommentLoding() {
  1809. var html = `<div>
  1810. <div class="PlaceHolder CommentItemV2">
  1811. <div class="PlaceHolder-inner">
  1812. <div class="PlaceHolder-bg"></div>
  1813. <svg width="656" height="44" viewBox="0 0 656 44" class="PlaceHolder-mask">
  1814. <path d="M0 0h656v44H0V0zm0 0h480v12H0V0zm0 32h238v12H0V32z" fill="currentColor"
  1815. fill-rule="evenodd"></path>
  1816. </svg>
  1817. </div>
  1818. </div>
  1819. </div>`;
  1820. var el = document.createElement('div');
  1821. el.innerHTML = html;
  1822. return el;
  1823. }
  1824.  
  1825. function processComment(elComment, elCommentWrap) {
  1826. if (!elComment || !elCommentWrap || is_loading_comment) {
  1827. return;
  1828. }
  1829. let offset = elComment.dataset.offset,
  1830. answerId = elComment.dataset.answerId,
  1831. isReverse = +elComment.dataset.isReverse,
  1832. isEnd = +elComment.dataset.isEnd
  1833. ;
  1834. if (!answerId || isEnd) {
  1835. return;
  1836. }
  1837.  
  1838. log('beginLoadComment', offset);
  1839. is_loading_comment = 1;
  1840. let elLoading = genCommentLoding();
  1841. elCommentWrap.appendChild(elLoading);
  1842. loadCommentData(answerId, offset, isReverse).then(function (json) {
  1843. log('getCommentData', offset);
  1844. elComment.dataset.offset = getOffsetFromUrl(json.paging.next);
  1845. elCommentWrap.removeChild(elLoading);
  1846. elLoading = null;
  1847. let html = genCommentHtml(json.data);
  1848. if (json.paging.is_end) {
  1849. elComment.dataset.isEnd = "1";
  1850. html += '<div style="text-align: center; padding: 10px;">全部评论已加载完成...</div>'
  1851. }
  1852. elCommentWrap.insertAdjacentHTML('beforeend', html);
  1853. processAHref(elCommentWrap);
  1854. }).catch(function (err) {
  1855. console.warn('load comment failed', err);
  1856. }).then(function () {
  1857. is_loading_comment = 0;
  1858. elLoading = null;
  1859. });
  1860. }
  1861.  
  1862. function processAHref(elAncestor) {
  1863. log('run:processAHref');
  1864. if (elAncestor && elAncestor.querySelectorAll) {
  1865. forEachArray(
  1866. elAncestor.querySelectorAll('a[href^="https://link.zhihu.com/"]'),
  1867. ele => {
  1868. log('a_href', ele.getAttribute('href'));
  1869. ele.setAttribute('href', decodeURIComponent(ele.getAttribute('href').replace('https://link.zhihu.com/?target=', '')));
  1870. ele.setAttribute('target', '_blank');
  1871. stopPropagation(ele);
  1872. }
  1873. );
  1874. forEachArray(
  1875. elAncestor.querySelectorAll('a[href^="https://"],a[href^="http://"]'),
  1876. ele => stopPropagation(ele)
  1877. )
  1878. }
  1879. }
  1880.  
  1881. function processLinkCard(elRichContent) {
  1882. // .RichContent-inner will be replaced, .RichContent will keep.
  1883. observerAddNodes(elRichContent, el => {
  1884. log(el);
  1885. if (el.tagName === 'A' && el.href && el.href.indexOf('http') === 0) {
  1886. processAHref(el.parentElement)
  1887. }
  1888. });
  1889. }
  1890.  
  1891. function processAllLink() {
  1892. // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
  1893. processAHref(document);
  1894. observerAddNodes(document, el => {
  1895. if (el.tagName === 'A' && el.href && el.href.indexOf('http') === 0) {
  1896. processAHref(el.parentElement)
  1897. }
  1898. });
  1899. }
  1900.  
  1901. function addCss() {
  1902. log('run:addCss');
  1903. var style = `
  1904. <style type="text/css">
  1905. .my-fold .RichContent-inner {
  1906. max-height: 400px;
  1907. }
  1908. .my-fold .my-more-btn {
  1909. display: block;
  1910. }
  1911. .my-fold .my-less-btn {
  1912. display:none;
  1913. }
  1914. .my-unfold .RichContent-inner {
  1915. max-height: none;
  1916. }
  1917. .my-unfold .my-more-btn {
  1918. display: none;
  1919. }
  1920. .my-unfold .my-less-btn {
  1921. display: block;
  1922. }
  1923. .up-img {
  1924. background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAXVBMVEUAAABDQz+GhIt6eX61tL25uMGko6u6ucKzsruzsbqtrLSnpq60sruzsbumpa2xsLmvrba0srusqrOko6qkoqqioKm7usO4tr+6ucK4tsC5t8Gkoqugn6a8u8K9vMT0mL20AAAAHXRSTlMABAQH0u0o7n95TyPIey6yoIxZNDEa8eHdx7JEF78gUdEAAAFLSURBVEjHrZOLcoIwEEVPgsUWsbZa+yb//5mNGYclG5YUxwwzh0SPd70KDpzHRVwu2UV4QX4Y7+Nlw6udGDVRIJHGW0tA5cNL3M3wSwZWBpiiYbSH7w7T8DNT9WEYhk+Qw5qxGdJ6oDAi0IYbjbi2YFRmGTFnjSGONrANydFRpVE4tuGVIR1UM8ocVbJhhJAw17U1VUfIcurGE7S5U5SsjEeaRjuqgCKjiS/ynDmLxj4ZDnah7NqY6mo0OsdJyXoqaaed6RpvZbiIsgPHUkYCb7kTl5lxRVN2YBkClePhMDuVQHXwAedgZAjyDo682hmC6e/TT5S9afhpB1/8BmOqHJzC+FTwkm6CytAYv88GkhPej2IY4LwNQ+gvRgM/J8Swwa4D0jahbjgPyD+5YqBQMwQ3G6w1ItZm/N9AG6uAj1wp3m641SWTny7iD6BPQB47/T0pAAAAAElFTkSuQmCC);
  1925. background-repeat: no-repeat;
  1926. background-size: 20px 20px;
  1927. width: 20px;
  1928. height: 20px;
  1929. display: inline-block;
  1930. }
  1931. .down-img {
  1932. background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAXVBMVEUAAABDQz+GhIt6eX61tL25uMGko6u6ucKzsruzsbqtrLSnpq60sruzsbumpa2xsLmvrba0srusqrOko6qkoqqioKm7usO4tr+6ucK4tsC5t8Gkoqugn6a8u8K9vMT0mL20AAAAHXRSTlMABAQH0u0o7n95TyPIey6yoIxZNDEa8eHdx7JEF78gUdEAAAFHSURBVEjHrZXtcoIwFERPgkiLVFut/Q7v/5ilcSKY1Rtwmj9LMjmzNwvc4MA5bPHZYlotikuzpGW5n/DIalnkrLOIpR5RFwksJdzdxChlIoYM+HkekKTdUCYqOHzDIND1oW+OFIn9Wx/CM8Aq/I1+TWUTTwMQItMOEpkDJvGQ9v3wGdLzhsrwCGm80IUzs+Um8RhGhH3U83nMquKmI7xPmaJH2IGnnjCv2B5hBThoQphmUCAcQOZjVLUav8v6MgPLw58IaC4Y08NzxWdLdcvDpV9ZMpB3roQj95GqlNAMrlSVt4ucEQ9tF5kPbYnQrHutKkrWk6c+SkgAkrVUJYRkbXto1kpoyJK1EkZPrhcT0FiER4joI1mNhAMlHHwMQN+ZRC60X7u1VmVffKDE3ItPQWvrvxHMJrwZsi2y1c8iRsvTTBYdTGa/Od1AHiFyP4wAAAAASUVORK5CYII=);
  1933. background-repeat: no-repeat;
  1934. background-size: 20px 20px;
  1935. width: 20px;
  1936. height: 20px;
  1937. display: inline-block;
  1938. }
  1939. .my-more-btn {
  1940. float: right;
  1941. padding: 0 10px 10px 10px;
  1942. }
  1943. .my-less-btn {
  1944. position: fixed;
  1945. top: 10%;
  1946. right: 10px;
  1947. padding: 0 10px 10px 10px;
  1948. z-index: 2;
  1949. }
  1950. #my-loading {
  1951. text-align: center;
  1952. padding-bottom: 10px;
  1953. }
  1954. .hide, .my-less-btn.hide {
  1955. display: none;
  1956. }
  1957. .CommentListV2 {
  1958. max-height: 500px;
  1959. overflow-y: scroll;
  1960. }
  1961. a.comment-fold {
  1962. position: fixed;
  1963. right: 10px;
  1964. bottom: 30%;
  1965. padding: 10px;
  1966. z-index: 2;
  1967. }
  1968. .my-updated-time {
  1969. font-size: 13px;
  1970. margin-left: 10px;
  1971. }
  1972. .my-created-time {
  1973. font-size: 13px;
  1974. }
  1975. .my-center {
  1976. margin: 0 auto;
  1977. text-align: center;
  1978. }
  1979. .author-tag {
  1980. position: relative;
  1981. padding: 0px 4px;
  1982. height: 16px;
  1983. line-height: 16px;
  1984. box-sizing: border-box;
  1985. font-size: 10px;
  1986. color: rgb(153, 153, 153);
  1987. }
  1988. .author-tag::before {
  1989. display: block;
  1990. content: " ";
  1991. position: absolute;
  1992. inset: -50%;
  1993. pointer-events: none;
  1994. transform: scale(0.5, 0.5);
  1995. border: 1px solid rgb(211, 211, 211);
  1996. border-radius: 4px;
  1997. }
  1998. .comment-item-wrap {
  1999. box-sizing: border-box;
  2000. margin: 0px;
  2001. min-width: 0px;
  2002. display: flex;
  2003. padding: 10px 0px 6px;
  2004. }
  2005. .CommentItemV2-meta {
  2006. box-sizing: border-box;
  2007. margin: 0px;
  2008. min-width: 0px;
  2009. flex: 0 0 auto;
  2010. }
  2011. .CommentItemV2-metaSibling {
  2012. box-sizing: border-box;
  2013. margin: 0px 0px 0px 10px;
  2014. min-width: 0px;
  2015. flex: 1 1 auto;
  2016. }
  2017. img.UserLink-avatar {
  2018. box-sizing: border-box;
  2019. margin: 0px;
  2020. min-width: 0px;
  2021. max-width: 100%;
  2022. width: 30px;
  2023. height: 30px;
  2024. border-radius: 50%;
  2025. filter: brightness(0.95);
  2026. display: block;
  2027. position: relative;
  2028. background-color: rgb(246, 246, 246);
  2029. flex: 0 0 auto;
  2030. text-indent: -9999px;
  2031. overflow: hidden;
  2032. }
  2033. .comment_sticker {
  2034. box-sizing: border-box;
  2035. margin: 12px 0px 0px;
  2036. min-width: 0px;
  2037. background-color: rgb(246, 246, 246);
  2038. position: relative;
  2039. border-radius: 8px;
  2040. width: 120px;
  2041. height: 120px;
  2042. }
  2043. .comment_sticker img {
  2044. width: 100%;
  2045. height: 100%;
  2046. border-radius: 8px;
  2047. object-fit: cover;
  2048. cursor: zoom-in;
  2049. object-position: unset;
  2050. }
  2051. .comment_img {
  2052. box-sizing: border-box;
  2053. margin: 12px 0px 0px;
  2054. min-width: 0px;
  2055. background-color: rgb(246, 246, 246);
  2056. position: relative;
  2057. border-radius: 8px;
  2058. max-width: 120px;
  2059. max-height: 200px;
  2060. }
  2061. .comment_img img {
  2062. width: 100%;
  2063. height: 100%;
  2064. border-radius: 8px;
  2065. object-fit: cover;
  2066. cursor: zoom-in;
  2067. object-position: center top;
  2068. max-width: 120px;
  2069. max-height: 200px;
  2070. }
  2071. </style>
  2072. <style type="text/css">
  2073. @keyframes ldio-4crll70kj {
  2074. 0% { transform: rotate(0) }
  2075. 100% { transform: rotate(360deg) }
  2076. }
  2077. .ldio-4crll70kj div { box-sizing: border-box!important }
  2078. .ldio-4crll70kj > div {
  2079. position: absolute;
  2080. width: 76px;
  2081. height: 76px;
  2082. top: 12px;
  2083. left: 12px;
  2084. border-radius: 50%;
  2085. border: 8px solid #000;
  2086. border-color: #fe718d transparent #fe718d transparent;
  2087. animation: ldio-4crll70kj 1.4925373134328357s linear infinite;
  2088. }
  2089. .ldio-4crll70kj > div:nth-child(2) { border-color: transparent }
  2090. .ldio-4crll70kj > div:nth-child(2) div {
  2091. position: absolute;
  2092. width: 100%;
  2093. height: 100%;
  2094. transform: rotate(45deg);
  2095. }
  2096. .ldio-4crll70kj > div:nth-child(2) div:before, .ldio-4crll70kj > div:nth-child(2) div:after {
  2097. content: "";
  2098. display: block;
  2099. position: absolute;
  2100. width: 8px;
  2101. height: 8px;
  2102. top: -8px;
  2103. left: 26px;
  2104. background: #fe718d;
  2105. border-radius: 50%;
  2106. box-shadow: 0 68px 0 0 #fe718d;
  2107. }
  2108. .ldio-4crll70kj > div:nth-child(2) div:after {
  2109. left: -8px;
  2110. top: 26px;
  2111. box-shadow: 68px 0 0 0 #fe718d;
  2112. }
  2113. .loadingio-spinner-dual-ring-41hxycfuw5t {
  2114. width: 54px;
  2115. height: 54px;
  2116. display: inline-block;
  2117. overflow: hidden;
  2118. background: none;
  2119. }
  2120. .ldio-4crll70kj {
  2121. width: 100%;
  2122. height: 100%;
  2123. position: relative;
  2124. transform: translateZ(0) scale(0.54);
  2125. backface-visibility: hidden;
  2126. transform-origin: 0 0; /* see note above */
  2127. }
  2128. .ldio-4crll70kj div { box-sizing: content-box; }
  2129. /* generated by https://loading.io/ */
  2130. </style>
  2131. `;
  2132. addStyle(style);
  2133. }
  2134.  
  2135. function processHomePage() {
  2136. function processBtn(objBtn) {
  2137. if (!objBtn || objBtn.innerText.indexOf('内查看') === -1)
  2138. return;
  2139. let elParent = objBtn.parentNode;
  2140.  
  2141. let elContentItem = objBtn.closest('.ContentItem');
  2142. let elUrl = elContentItem && elContentItem.querySelector('meta[itemprop="url"]');
  2143. let url = '';
  2144. if (elUrl && elUrl.getAttribute("content")) {
  2145. url = elUrl.getAttribute("content");
  2146. let elNew = document.createElement('a');
  2147. elNew.className = "Button ContentItem-more Button--plain";
  2148. elNew.href = url;
  2149. elNew.target="_blank";
  2150. elNew.innerText = "打开详情";
  2151. elParent.replaceChild(elNew, objBtn);
  2152. stopPropagation(elNew);
  2153. }
  2154. }
  2155.  
  2156. function processBtnAll(targetNode) {
  2157. if (targetNode && targetNode.querySelectorAll) {
  2158. forEachArray(
  2159. targetNode.querySelectorAll('button.ContentItem-more'),
  2160. el => processBtn(el)
  2161. );
  2162. }
  2163. }
  2164. processBtnAll(document);
  2165. observerAddNodes(document.querySelector('.TopstoryMain'), el => processBtnAll(el))
  2166. }
  2167.  
  2168. function processDetailOrList() {
  2169. setTimeout(function () {
  2170. addCss();
  2171. skipOpenApp();
  2172. bindProcessViewport();
  2173. }, 0);
  2174. setTimeout(function () {
  2175. removeAds();
  2176. removeBlock();
  2177. processAHref(document);
  2178.  
  2179. function stopElePropagation(ele1, selector) {
  2180. if (ele1) {
  2181. forEachArray(ele1.querySelectorAll(selector), function (el) {
  2182. stopPropagation(el)
  2183. })
  2184. }
  2185. }
  2186.  
  2187. if (inDetailPage) {
  2188. stopElePropagation(document.querySelector('.Question-main'), 'figure img,a')
  2189. } else {
  2190. // list page
  2191. let list_item = document.querySelectorAll('.List-item');
  2192. forEachArray(list_item, function (ele) {
  2193. let ele1 = ele.querySelector('.AnswerItem');
  2194. let zop = ele1 && ele1.dataset && ele1.dataset.zop;
  2195. if (zop) {
  2196. try {
  2197. let t = JSON.parse(zop);
  2198. log('answer_id', t.itemId);
  2199. if (t.itemId) {
  2200. load_answer_id_map[t.itemId] = 1;
  2201. }
  2202. } catch (e) {
  2203. console.error(e)
  2204. }
  2205. }
  2206. processLinkCard(ele.querySelector('.RichContent'));
  2207. stopElePropagation(ele1, 'figure img,a')
  2208. });
  2209. }
  2210. bindLoadData();
  2211. }, 0);
  2212. }
  2213.  
  2214. function processZvideo() {
  2215. setTimeout(function () {
  2216. observerAddNodes(document.querySelector('.ZVideoRecommendationList'), el => processAHref(el));
  2217. }, 0);
  2218. }
  2219.  
  2220. function processCommon() {
  2221. let elA = document.querySelector('.QuestionHeader-title a');
  2222. if (elA) {
  2223. stopPropagation(elA)
  2224. }
  2225. }
  2226.  
  2227.  
  2228. function init() {
  2229. if (init_done) {
  2230. return;
  2231. }
  2232. init_done = 1;
  2233. log('run:init');
  2234. // init
  2235. if (fromMobile) {
  2236. if (questionNumber || inDetailPage) {
  2237. processDetailOrList();
  2238. } else if (inHomePage) {
  2239. processHomePage();
  2240. } else if (inZvideo) {
  2241. processZvideo();
  2242. } else if (inZhuanlan) {
  2243. hideByAddCss('.OpenInAppButton,.KfeCollection-VipRecommendCard')
  2244. }
  2245.  
  2246. setTimeout(function () {
  2247. addCommonStyle();
  2248. processContinue();
  2249. processCommon();
  2250. }, 0);
  2251.  
  2252. setTimeout(function () {
  2253. removeCommonBlock();
  2254. }, 0);
  2255. } else {
  2256. setTimeout(processAllLink, 0);
  2257. }
  2258. }
  2259.  
  2260.  
  2261. document.onreadystatechange = function () {
  2262. if (document.readyState === "complete") {
  2263. log('document.readyState');
  2264. init()
  2265. }
  2266. };
  2267. document.addEventListener("DOMContentLoaded", function() {
  2268. log('DOMContentLoaded');
  2269. init()
  2270. });