V2Next

V2Next - 一个好用的V2EX脚本! 已适配移动端

目前為 2024-01-26 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name V2Next
  3. // @namespace http://tampermonkey.net/
  4. // @version 8.0.0
  5. // @author zyronon
  6. // @description V2Next - 一个好用的V2EX脚本! 已适配移动端
  7. // @license GPL License
  8. // @icon https://v2next.netlify.app/favicon.ico
  9. // @homepage https://github.com/zyronon/web-scripts
  10. // @homepageURL https://github.com/zyronon/web-scripts
  11. // @supportURL https://update.greasyfork.org/scripts/458024/V2Next.user.js
  12. // @match https://v2ex.com/
  13. // @match https://v2ex.com/?tab=*
  14. // @match https://v2ex.com/t/*
  15. // @match https://v2ex.com/recent*
  16. // @match https://v2ex.com/go/*
  17. // @match https://v2ex.com/member/*
  18. // @match https://*.v2ex.com/
  19. // @match https://*.v2ex.com/?tab=*
  20. // @match https://*.v2ex.com/t/*
  21. // @match https://*.v2ex.com/recent*
  22. // @match https://*.v2ex.com/go/*
  23. // @match https://*.v2ex.com/member/*
  24. // @require https://cdn.jsdelivr.net/npm/vue@3.4.14/dist/vue.global.prod.js
  25. // @grant GM_addStyle
  26. // @grant GM_notification
  27. // @grant GM_openInTab
  28. // @grant GM_registerMenuCommand
  29. // ==/UserScript==
  30.  
  31.  
  32. (function (vue) {
  33. 'use strict';
  34.  
  35. var PageType = /* @__PURE__ */ ((PageType2) => {
  36. PageType2["Home"] = "Home";
  37. PageType2["Node"] = "Node";
  38. PageType2["Post"] = "Post";
  39. PageType2["Member"] = "Member";
  40. PageType2["Changes"] = "Changes";
  41. return PageType2;
  42. })(PageType || {});
  43. var CommentDisplayType = /* @__PURE__ */ ((CommentDisplayType2) => {
  44. CommentDisplayType2[CommentDisplayType2["FloorInFloor"] = 0] = "FloorInFloor";
  45. CommentDisplayType2[CommentDisplayType2["FloorInFloorNoCallUser"] = 4] = "FloorInFloorNoCallUser";
  46. CommentDisplayType2[CommentDisplayType2["FloorInFloorNested"] = 5] = "FloorInFloorNested";
  47. CommentDisplayType2[CommentDisplayType2["Like"] = 1] = "Like";
  48. CommentDisplayType2[CommentDisplayType2["V2exOrigin"] = 2] = "V2exOrigin";
  49. CommentDisplayType2[CommentDisplayType2["OnlyOp"] = 3] = "OnlyOp";
  50. CommentDisplayType2[CommentDisplayType2["New"] = 6] = "New";
  51. return CommentDisplayType2;
  52. })(CommentDisplayType || {});
  53. const MAX_REPLY_LIMIT = 400;
  54. const _sfc_main$j = {
  55. name: "Tooltip",
  56. props: {
  57. title: {
  58. type: String,
  59. default() {
  60. return "";
  61. }
  62. },
  63. disabled: {
  64. type: Boolean,
  65. default() {
  66. return false;
  67. }
  68. }
  69. },
  70. data() {
  71. return {
  72. show: false
  73. };
  74. },
  75. methods: {
  76. showPop(e2) {
  77. if (this.disabled)
  78. return;
  79. if (!this.title)
  80. return;
  81. e2.stopPropagation();
  82. let rect = e2.target.getBoundingClientRect();
  83. this.show = true;
  84. vue.nextTick(() => {
  85. var _a, _b;
  86. let tip = (_b = (_a = this.$refs) == null ? void 0 : _a.tip) == null ? void 0 : _b.getBoundingClientRect();
  87. if (!tip)
  88. return;
  89. if (rect.top < 50) {
  90. this.$refs.tip.style.top = rect.top + rect.height + 10 + "px";
  91. } else {
  92. this.$refs.tip.style.top = rect.top - tip.height - 10 + "px";
  93. }
  94. let tipWidth = tip.width;
  95. let rectWidth = rect.width;
  96. this.$refs.tip.style.left = rect.left - (tipWidth - rectWidth) / 2 + "px";
  97. });
  98. }
  99. },
  100. render() {
  101. let Vnode = this.$slots.default()[0];
  102. return vue.createVNode(vue.Fragment, null, [this.show && this.title && vue.createVNode(vue.Teleport, {
  103. "to": "body"
  104. }, {
  105. default: () => [vue.createVNode(vue.Transition, {
  106. "name": "fade"
  107. }, {
  108. default: () => [vue.createVNode("div", {
  109. "ref": "tip",
  110. "className": "tip"
  111. }, [this.title])]
  112. })]
  113. }), vue.createVNode(Vnode, {
  114. "onClick": () => this.show = false,
  115. "onmouseenter": (e2) => this.showPop(e2),
  116. "onmouseleave": () => this.show = false
  117. }, null)]);
  118. }
  119. };
  120. const _export_sfc = (sfc, props) => {
  121. const target = sfc.__vccOpts || sfc;
  122. for (const [key, val] of props) {
  123. target[key] = val;
  124. }
  125. return target;
  126. };
  127. const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-ee672411"]]);
  128. const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
  129. __name: "BaseSwitch",
  130. props: {
  131. modelValue: { type: Boolean }
  132. },
  133. emits: ["update:modelValue"],
  134. setup(__props, { emit: __emit }) {
  135. return (_ctx, _cache) => {
  136. return vue.openBlock(), vue.createElementBlock("div", {
  137. class: vue.normalizeClass(["switch", { active: _ctx.modelValue }]),
  138. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", !_ctx.modelValue))
  139. }, null, 2);
  140. };
  141. }
  142. });
  143. const BaseSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-e7c0fbef"]]);
  144. const _sfc_main$h = {
  145. name: "Setting",
  146. components: {
  147. BaseSwitch,
  148. Tooltip
  149. },
  150. inject: ["isNight"],
  151. props: {
  152. modelValue: {
  153. type: Object,
  154. default() {
  155. return {};
  156. }
  157. },
  158. show: {
  159. type: Boolean,
  160. default() {
  161. return false;
  162. }
  163. }
  164. },
  165. data() {
  166. return {
  167. tabIndex: 0,
  168. config: window.clone(this.modelValue)
  169. };
  170. },
  171. computed: {
  172. windowConst() {
  173. return window.const;
  174. },
  175. CommentDisplayType() {
  176. return CommentDisplayType;
  177. },
  178. isNew() {
  179. return this.config.version < window.currentVersion;
  180. }
  181. },
  182. watch: {
  183. config: {
  184. handler(n2) {
  185. n2.topReplyLoveMinCount = Math.trunc(n2.topReplyLoveMinCount);
  186. if (n2.topReplyLoveMinCount < 0) {
  187. n2.topReplyLoveMinCount = 1;
  188. }
  189. this.$emit("update:modelValue", n2);
  190. },
  191. deep: true
  192. }
  193. },
  194. methods: {
  195. close() {
  196. this.config.version = window.currentVersion;
  197. this.$emit("update:show", false);
  198. }
  199. }
  200. };
  201. const _withScopeId$b = (n2) => (vue.pushScopeId("data-v-36f77223"), n2 = n2(), vue.popScopeId(), n2);
  202. const _hoisted_1$g = {
  203. key: 0,
  204. class: "setting-modal modal"
  205. };
  206. const _hoisted_2$f = { class: "modal-root" };
  207. const _hoisted_3$b = { class: "modal-header" };
  208. const _hoisted_4$b = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 脚本设置 ", -1));
  209. const _hoisted_5$8 = { class: "body" };
  210. const _hoisted_6$8 = { class: "left" };
  211. const _hoisted_7$7 = { class: "tabs" };
  212. const _hoisted_8$7 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("span", null, "列表设置", -1));
  213. const _hoisted_9$7 = [
  214. _hoisted_8$7
  215. ];
  216. const _hoisted_10$6 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("span", null, "帖子设置", -1));
  217. const _hoisted_11$6 = [
  218. _hoisted_10$6
  219. ];
  220. const _hoisted_12$6 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("span", null, "其他设置", -1));
  221. const _hoisted_13$6 = [
  222. _hoisted_12$6
  223. ];
  224. const _hoisted_14$6 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("span", null, "关于脚本", -1));
  225. const _hoisted_15$6 = [
  226. _hoisted_14$6
  227. ];
  228. const _hoisted_16$6 = { class: "modal-content" };
  229. const _hoisted_17$5 = { class: "scroll" };
  230. const _hoisted_18$5 = { key: 0 };
  231. const _hoisted_19$4 = { class: "row" };
  232. const _hoisted_20$4 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "列表展示方式", -1));
  233. const _hoisted_21$4 = { class: "wrapper" };
  234. const _hoisted_22$3 = { class: "radio-group2" };
  235. const _hoisted_23$3 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  236. const _hoisted_24$2 = { class: "row" };
  237. const _hoisted_25$3 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "列表hover时显示预览按钮", -1));
  238. const _hoisted_26$2 = { class: "wrapper" };
  239. const _hoisted_27$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  240. const _hoisted_28$1 = { class: "row" };
  241. const _hoisted_29$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "帖子弹框显示", -1));
  242. const _hoisted_30$1 = { class: "wrapper" };
  243. const _hoisted_31$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此选项后,帖子始终会以弹框的方式显示。优先级大于“新标签页打开链接” ", -1));
  244. const _hoisted_32$1 = { class: "row" };
  245. const _hoisted_33$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "新标签页打开链接", -1));
  246. const _hoisted_34$1 = { class: "wrapper" };
  247. const _hoisted_35$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 网页上所有链接通过新标签页打开 ", -1));
  248. const _hoisted_36$1 = { key: 1 };
  249. const _hoisted_37$1 = { class: "row" };
  250. const _hoisted_38$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "显示回复展示方式", -1));
  251. const _hoisted_39$1 = { class: "wrapper" };
  252. const _hoisted_40$1 = { class: "row" };
  253. const _hoisted_41$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "回复展示方式", -1));
  254. const _hoisted_42$1 = { class: "wrapper" };
  255. const _hoisted_43$1 = { class: "radio-group2" };
  256. const _hoisted_44$1 = { class: "row" };
  257. const _hoisted_45$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "单独打开帖子时默认显示楼中楼", -1));
  258. const _hoisted_46$1 = { class: "wrapper" };
  259. const _hoisted_47$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 单独打开这种地址 https://v2ex.com/t/xxxx 时,是否默认显示楼中楼 ", -1));
  260. const _hoisted_48$1 = { class: "row" };
  261. const _hoisted_49$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "点击左右两侧透明处关闭帖子详情弹框", -1));
  262. const _hoisted_50$1 = { class: "wrapper" };
  263. const _hoisted_51$1 = { class: "row" };
  264. const _hoisted_52$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "正文超长自动折叠", -1));
  265. const _hoisted_53$1 = { class: "wrapper" };
  266. const _hoisted_54$1 = { class: "row" };
  267. const _hoisted_55$1 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "帖子宽度", -1));
  268. const _hoisted_56 = { class: "wrapper" };
  269. const _hoisted_57 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  270. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则默认宽度为77rem。接受合法的width值: "),
  271. /* @__PURE__ */ vue.createElementVNode("a", {
  272. href: "https://vue3js.cn/interview/css/em_px_rem_vh_vw.html#%E4%BA%8C%E3%80%81%E5%8D%95%E4%BD%8D",
  273. target: "_blank"
  274. }, "rem、px、vw、vh(点此查看)"),
  275. /* @__PURE__ */ vue.createTextVNode("。 vw代表屏幕百分比,如想要屏幕的66%,请填写66vw ")
  276. ], -1));
  277. const _hoisted_58 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 提示:此项设置以后,单独打开详情页时会出现帖子突然变宽(窄)的问题,暂时无解 ", -1));
  278. const _hoisted_59 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  279. const _hoisted_60 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  280. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "高赞回复")
  281. ], -1));
  282. const _hoisted_61 = { class: "row" };
  283. const _hoisted_62 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "显示高赞回复", -1));
  284. const _hoisted_63 = { class: "wrapper" };
  285. const _hoisted_64 = { class: "row" };
  286. const _hoisted_65 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "最多显示多少个高赞回复", -1));
  287. const _hoisted_66 = { class: "wrapper" };
  288. const _hoisted_67 = { class: "row" };
  289. const _hoisted_68 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "最少需要多少赞才能被判定为高赞", -1));
  290. const _hoisted_69 = { class: "wrapper" };
  291. const _hoisted_70 = { key: 2 };
  292. const _hoisted_71 = { class: "row" };
  293. const _hoisted_72 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "用户打标签(跨平台,数据保存在自己的记事本):", -1));
  294. const _hoisted_73 = { class: "wrapper" };
  295. const _hoisted_74 = { class: "row" };
  296. const _hoisted_75 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "划词显示Base64解码框", -1));
  297. const _hoisted_76 = { class: "wrapper" };
  298. const _hoisted_77 = { class: "row" };
  299. const _hoisted_78 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自动签到", -1));
  300. const _hoisted_79 = { class: "wrapper" };
  301. const _hoisted_80 = { class: "row" };
  302. const _hoisted_81 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自定义背景", -1));
  303. const _hoisted_82 = { class: "wrapper" };
  304. const _hoisted_83 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  305. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则背景颜色默认为 #e2e2e2。接受一个合法的css color值:例如"),
  306. /* @__PURE__ */ vue.createElementVNode("a", {
  307. href: "https://developer.mozilla.org/zh-CN/docs/Web/CSS/color_value",
  308. target: "_blank"
  309. }, "red、#ffffff、rgb(222,222,22)(点此查看)"),
  310. /* @__PURE__ */ vue.createTextVNode("等等。 ")
  311. ], -1));
  312. const _hoisted_84 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  313. const _hoisted_85 = { class: "row" };
  314. const _hoisted_86 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "收藏时提醒添加到书签", -1));
  315. const _hoisted_87 = { class: "wrapper" };
  316. const _hoisted_88 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " V站帐号一旦被封禁,则无法登录,无法查看账号收藏了 ", -1));
  317. const _hoisted_89 = { key: 3 };
  318. const _hoisted_90 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("h1", null, "V2EX Next", -1));
  319. const _hoisted_91 = { class: "project-desc" };
  320. const _hoisted_92 = ["href"];
  321. const _hoisted_93 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("b", null, "请帮我点一个Star,您的Star是对我最大的鼓励", -1));
  322. const _hoisted_94 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("h2", null, "为什么选择这个,而不是其他?", -1));
  323. const _hoisted_95 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "其他脚本:", -1));
  324. const _hoisted_96 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "本脚本:", -1));
  325. const _hoisted_97 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("b", null, "最好用的楼中楼、查看回复上下文、高赞回复、简洁模式等特色功能。", -1));
  326. const _hoisted_98 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("h2", null, "特色功能", -1));
  327. const _hoisted_99 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("ul", null, [
  328. /* @__PURE__ */ vue.createElementVNode("li", null, [
  329. /* @__PURE__ */ vue.createTextVNode("楼中楼 "),
  330. /* @__PURE__ */ vue.createElementVNode("ol", null, [
  331. /* @__PURE__ */ vue.createElementVNode("li", null, "可按高赞排序显示"),
  332. /* @__PURE__ */ vue.createElementVNode("li", null, "可只看楼主")
  333. ])
  334. ]),
  335. /* @__PURE__ */ vue.createElementVNode("li", null, "简洁模式"),
  336. /* @__PURE__ */ vue.createElementVNode("li", null, "查看回复上下文"),
  337. /* @__PURE__ */ vue.createElementVNode("li", null, "高赞回复")
  338. ], -1));
  339. const _hoisted_100 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("h2", null, "增强(辅助)功能", -1));
  340. const _hoisted_101 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("ul", null, [
  341. /* @__PURE__ */ vue.createElementVNode("li", null, "预览帖子正文"),
  342. /* @__PURE__ */ vue.createElementVNode("li", null, "弹框显示帖子正文和回复"),
  343. /* @__PURE__ */ vue.createElementVNode("li", null, "帖子显示OP注册时间"),
  344. /* @__PURE__ */ vue.createElementVNode("li", null, "链接自动转图片"),
  345. /* @__PURE__ */ vue.createElementVNode("li", null, "快捷发送贴吧表情、emoji、图片"),
  346. /* @__PURE__ */ vue.createElementVNode("li", null, "新标签页打开链接,默认打开,可单独关闭"),
  347. /* @__PURE__ */ vue.createElementVNode("li", null, "对用户打标签"),
  348. /* @__PURE__ */ vue.createElementVNode("li", null, "划词 base64 解码,支持解码中文"),
  349. /* @__PURE__ */ vue.createElementVNode("li", null, "一键@所有人,@管理员:回复时,可一键@所有人和@管理员"),
  350. /* @__PURE__ */ vue.createElementVNode("li", null, "自适应屏幕宽度,支持黑暗模式"),
  351. /* @__PURE__ */ vue.createElementVNode("li", null, "记忆上次阅读位置"),
  352. /* @__PURE__ */ vue.createElementVNode("li", null, "按钮异步请求:操作按钮(感谢、收藏、回复、隐藏)异步请求,不会刷新页面"),
  353. /* @__PURE__ */ vue.createElementVNode("li", null, "收藏时提醒添加到浏览器书签,防止账号被封无法查看收藏"),
  354. /* @__PURE__ */ vue.createElementVNode("li", null, "自动签到"),
  355. /* @__PURE__ */ vue.createElementVNode("li", null, "正文超长自动折叠")
  356. ], -1));
  357. const _hoisted_102 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("h2", null, "如何帮助我", -1));
  358. const _hoisted_103 = ["href"];
  359. const _hoisted_104 = ["href"];
  360. const _hoisted_105 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", null, [
  361. /* @__PURE__ */ vue.createTextVNode(" 更新日志:"),
  362. /* @__PURE__ */ vue.createElementVNode("a", {
  363. href: "https://greasyfork.org/zh-CN/scripts/458024/versions",
  364. target: "_blank"
  365. }, "https://greasyfork.org/zh-CN/scripts/458024/versions")
  366. ], -1));
  367. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  368. const _component_BaseSwitch = vue.resolveComponent("BaseSwitch");
  369. const _component_Tooltip = vue.resolveComponent("Tooltip");
  370. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  371. default: vue.withCtx(() => [
  372. $props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  373. vue.createElementVNode("div", {
  374. class: "mask",
  375. onClick: _cache[0] || (_cache[0] = (...args) => $options.close && $options.close(...args))
  376. }),
  377. vue.createElementVNode("div", _hoisted_2$f, [
  378. vue.createElementVNode("div", _hoisted_3$b, [
  379. _hoisted_4$b,
  380. vue.createElementVNode("i", {
  381. class: "fa fa-times",
  382. onClick: _cache[1] || (_cache[1] = (...args) => $options.close && $options.close(...args))
  383. })
  384. ]),
  385. vue.createElementVNode("div", _hoisted_5$8, [
  386. vue.createElementVNode("div", _hoisted_6$8, [
  387. vue.createElementVNode("div", _hoisted_7$7, [
  388. vue.createElementVNode("div", {
  389. class: vue.normalizeClass(["tab", $data.tabIndex === 0 && "active"]),
  390. onClick: _cache[2] || (_cache[2] = ($event) => $data.tabIndex = 0)
  391. }, _hoisted_9$7, 2),
  392. vue.createElementVNode("div", {
  393. class: vue.normalizeClass(["tab", $data.tabIndex === 1 && "active"]),
  394. onClick: _cache[3] || (_cache[3] = ($event) => $data.tabIndex = 1)
  395. }, _hoisted_11$6, 2),
  396. vue.createElementVNode("div", {
  397. class: vue.normalizeClass(["tab", $data.tabIndex === 2 && "active"]),
  398. onClick: _cache[4] || (_cache[4] = ($event) => $data.tabIndex = 2)
  399. }, _hoisted_13$6, 2),
  400. vue.createElementVNode("div", {
  401. class: vue.normalizeClass(["tab", $data.tabIndex === 3 && "active"]),
  402. onClick: _cache[5] || (_cache[5] = ($event) => $data.tabIndex = 3)
  403. }, _hoisted_15$6, 2)
  404. ])
  405. ]),
  406. vue.createElementVNode("div", _hoisted_16$6, [
  407. vue.createElementVNode("div", _hoisted_17$5, [
  408. $data.tabIndex === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$5, [
  409. vue.createElementVNode("div", _hoisted_19$4, [
  410. _hoisted_20$4,
  411. vue.createElementVNode("div", _hoisted_21$4, [
  412. vue.createElementVNode("div", _hoisted_22$3, [
  413. vue.createElementVNode("div", {
  414. class: vue.normalizeClass(["radio", $data.config.viewType === "simple" ? "active" : ""]),
  415. onClick: _cache[6] || (_cache[6] = ($event) => $data.config.viewType = "simple")
  416. }, "简洁 ", 2),
  417. vue.createElementVNode("div", {
  418. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  419. onClick: _cache[7] || (_cache[7] = ($event) => $data.config.viewType = "table")
  420. }, "表格 ", 2),
  421. vue.createElementVNode("div", {
  422. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  423. onClick: _cache[8] || (_cache[8] = ($event) => $data.config.viewType = "card")
  424. }, "卡片 ", 2)
  425. ])
  426. ])
  427. ]),
  428. _hoisted_23$3,
  429. vue.createElementVNode("div", _hoisted_24$2, [
  430. _hoisted_25$3,
  431. vue.createElementVNode("div", _hoisted_26$2, [
  432. vue.createVNode(_component_BaseSwitch, {
  433. modelValue: $data.config.showPreviewBtn,
  434. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.config.showPreviewBtn = $event)
  435. }, null, 8, ["modelValue"])
  436. ])
  437. ]),
  438. _hoisted_27$1,
  439. vue.createElementVNode("div", _hoisted_28$1, [
  440. _hoisted_29$1,
  441. vue.createElementVNode("div", _hoisted_30$1, [
  442. vue.createVNode(_component_BaseSwitch, {
  443. modelValue: $data.config.clickPostItemOpenDetail,
  444. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.config.clickPostItemOpenDetail = $event)
  445. }, null, 8, ["modelValue"])
  446. ])
  447. ]),
  448. _hoisted_31$1,
  449. vue.createElementVNode("div", _hoisted_32$1, [
  450. _hoisted_33$1,
  451. vue.createElementVNode("div", _hoisted_34$1, [
  452. vue.createVNode(_component_BaseSwitch, {
  453. modelValue: $data.config.newTabOpen,
  454. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.config.newTabOpen = $event)
  455. }, null, 8, ["modelValue"])
  456. ])
  457. ]),
  458. _hoisted_35$1
  459. ])) : vue.createCommentVNode("", true),
  460. $data.tabIndex === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_36$1, [
  461. vue.createElementVNode("div", _hoisted_37$1, [
  462. _hoisted_38$1,
  463. vue.createElementVNode("div", _hoisted_39$1, [
  464. vue.createVNode(_component_BaseSwitch, {
  465. modelValue: $data.config.showToolbar,
  466. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.config.showToolbar = $event)
  467. }, null, 8, ["modelValue"])
  468. ])
  469. ]),
  470. vue.createElementVNode("div", _hoisted_40$1, [
  471. _hoisted_41$1,
  472. vue.createElementVNode("div", _hoisted_42$1, [
  473. vue.createElementVNode("div", _hoisted_43$1, [
  474. vue.createVNode(_component_Tooltip, { title: "不隐藏@用户" }, {
  475. default: vue.withCtx(() => [
  476. vue.createElementVNode("div", {
  477. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === $options.CommentDisplayType.FloorInFloor ? "active" : ""]),
  478. onClick: _cache[13] || (_cache[13] = ($event) => $data.config.commentDisplayType = $options.CommentDisplayType.FloorInFloor)
  479. }, "楼中楼(@) ", 2)
  480. ]),
  481. _: 1
  482. }),
  483. vue.createVNode(_component_Tooltip, { title: "隐藏第一个@用户,双击内容可显示原文" }, {
  484. default: vue.withCtx(() => [
  485. vue.createElementVNode("div", {
  486. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser ? "active" : ""]),
  487. onClick: _cache[14] || (_cache[14] = ($event) => $data.config.commentDisplayType = $options.CommentDisplayType.FloorInFloorNoCallUser)
  488. }, " 楼中楼 ", 2)
  489. ]),
  490. _: 1
  491. }),
  492. vue.createVNode(_component_Tooltip, { title: "重复显示楼中楼的回复" }, {
  493. default: vue.withCtx(() => [
  494. vue.createElementVNode("div", {
  495. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNested ? "active" : ""]),
  496. onClick: _cache[15] || (_cache[15] = ($event) => $data.config.commentDisplayType = $options.CommentDisplayType.FloorInFloorNested)
  497. }, " 冗余楼中楼 ", 2)
  498. ]),
  499. _: 1
  500. }),
  501. vue.createElementVNode("div", {
  502. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === $options.CommentDisplayType.Like ? "active" : ""]),
  503. onClick: _cache[16] || (_cache[16] = ($event) => $data.config.commentDisplayType = $options.CommentDisplayType.Like)
  504. }, "感谢 ", 2),
  505. vue.createElementVNode("div", {
  506. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === $options.CommentDisplayType.OnlyOp ? "active" : ""]),
  507. onClick: _cache[17] || (_cache[17] = ($event) => $data.config.commentDisplayType = $options.CommentDisplayType.OnlyOp)
  508. }, "只看楼主 ", 2),
  509. vue.createElementVNode("div", {
  510. class: vue.normalizeClass(["radio", $data.config.commentDisplayType === $options.CommentDisplayType.V2exOrigin ? "active" : ""]),
  511. onClick: _cache[18] || (_cache[18] = ($event) => $data.config.commentDisplayType = $options.CommentDisplayType.V2exOrigin)
  512. }, "V2原版 ", 2)
  513. ])
  514. ])
  515. ]),
  516. vue.createElementVNode("div", _hoisted_44$1, [
  517. _hoisted_45$1,
  518. vue.createElementVNode("div", _hoisted_46$1, [
  519. vue.createVNode(_component_BaseSwitch, {
  520. modelValue: $data.config.autoOpenDetail,
  521. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.config.autoOpenDetail = $event)
  522. }, null, 8, ["modelValue"])
  523. ])
  524. ]),
  525. _hoisted_47$1,
  526. vue.createElementVNode("div", _hoisted_48$1, [
  527. _hoisted_49$1,
  528. vue.createElementVNode("div", _hoisted_50$1, [
  529. vue.createVNode(_component_BaseSwitch, {
  530. modelValue: $data.config.closePostDetailBySpace,
  531. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.config.closePostDetailBySpace = $event)
  532. }, null, 8, ["modelValue"])
  533. ])
  534. ]),
  535. vue.createElementVNode("div", _hoisted_51$1, [
  536. _hoisted_52$1,
  537. vue.createElementVNode("div", _hoisted_53$1, [
  538. vue.createVNode(_component_BaseSwitch, {
  539. modelValue: $data.config.contentAutoCollapse,
  540. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.config.contentAutoCollapse = $event)
  541. }, null, 8, ["modelValue"])
  542. ])
  543. ]),
  544. vue.createElementVNode("div", _hoisted_54$1, [
  545. _hoisted_55$1,
  546. vue.createElementVNode("div", _hoisted_56, [
  547. vue.withDirectives(vue.createElementVNode("input", {
  548. type: "text",
  549. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.config.postWidth = $event)
  550. }, null, 512), [
  551. [vue.vModelText, $data.config.postWidth]
  552. ])
  553. ])
  554. ]),
  555. _hoisted_57,
  556. _hoisted_58,
  557. _hoisted_59,
  558. _hoisted_60,
  559. vue.createElementVNode("div", _hoisted_61, [
  560. _hoisted_62,
  561. vue.createElementVNode("div", _hoisted_63, [
  562. vue.createVNode(_component_BaseSwitch, {
  563. modelValue: $data.config.showTopReply,
  564. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.config.showTopReply = $event)
  565. }, null, 8, ["modelValue"])
  566. ])
  567. ]),
  568. vue.createElementVNode("div", _hoisted_64, [
  569. _hoisted_65,
  570. vue.createElementVNode("div", _hoisted_66, [
  571. vue.withDirectives(vue.createElementVNode("input", {
  572. type: "number",
  573. min: "1",
  574. "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => $data.config.topReplyCount = $event)
  575. }, null, 512), [
  576. [vue.vModelText, $data.config.topReplyCount]
  577. ])
  578. ])
  579. ]),
  580. vue.createElementVNode("div", _hoisted_67, [
  581. _hoisted_68,
  582. vue.createElementVNode("div", _hoisted_69, [
  583. vue.withDirectives(vue.createElementVNode("input", {
  584. type: "number",
  585. min: "1",
  586. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => $data.config.topReplyLoveMinCount = $event)
  587. }, null, 512), [
  588. [vue.vModelText, $data.config.topReplyLoveMinCount]
  589. ])
  590. ])
  591. ])
  592. ])) : vue.createCommentVNode("", true),
  593. $data.tabIndex === 2 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_70, [
  594. vue.createElementVNode("div", _hoisted_71, [
  595. _hoisted_72,
  596. vue.createElementVNode("div", _hoisted_73, [
  597. vue.createVNode(_component_BaseSwitch, {
  598. modelValue: $data.config.openTag,
  599. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => $data.config.openTag = $event)
  600. }, null, 8, ["modelValue"])
  601. ])
  602. ]),
  603. vue.createElementVNode("div", _hoisted_74, [
  604. _hoisted_75,
  605. vue.createElementVNode("div", _hoisted_76, [
  606. vue.createVNode(_component_BaseSwitch, {
  607. modelValue: $data.config.base64,
  608. "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => $data.config.base64 = $event)
  609. }, null, 8, ["modelValue"])
  610. ])
  611. ]),
  612. vue.createElementVNode("div", _hoisted_77, [
  613. _hoisted_78,
  614. vue.createElementVNode("div", _hoisted_79, [
  615. vue.createVNode(_component_BaseSwitch, {
  616. modelValue: $data.config.autoSignin,
  617. "onUpdate:modelValue": _cache[28] || (_cache[28] = ($event) => $data.config.autoSignin = $event)
  618. }, null, 8, ["modelValue"])
  619. ])
  620. ]),
  621. vue.createElementVNode("div", _hoisted_80, [
  622. _hoisted_81,
  623. vue.createElementVNode("div", _hoisted_82, [
  624. vue.withDirectives(vue.createElementVNode("input", {
  625. type: "text",
  626. "onUpdate:modelValue": _cache[29] || (_cache[29] = ($event) => $data.config.customBgColor = $event)
  627. }, null, 512), [
  628. [vue.vModelText, $data.config.customBgColor]
  629. ])
  630. ])
  631. ]),
  632. _hoisted_83,
  633. _hoisted_84,
  634. vue.createElementVNode("div", _hoisted_85, [
  635. _hoisted_86,
  636. vue.createElementVNode("div", _hoisted_87, [
  637. vue.createVNode(_component_BaseSwitch, {
  638. modelValue: $data.config.collectBrowserNotice,
  639. "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => $data.config.collectBrowserNotice = $event)
  640. }, null, 8, ["modelValue"])
  641. ])
  642. ]),
  643. _hoisted_88
  644. ])) : vue.createCommentVNode("", true),
  645. $data.tabIndex === 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_89, [
  646. _hoisted_90,
  647. vue.createElementVNode("div", _hoisted_91, [
  648. vue.createElementVNode("div", null, [
  649. vue.createTextVNode(" 本项目完全开源,项目地址:"),
  650. vue.createElementVNode("a", {
  651. href: $options.windowConst.git,
  652. target: "_blank"
  653. }, vue.toDisplayString($options.windowConst.git), 9, _hoisted_92),
  654. vue.createTextVNode(",目前由我一个人维护,如果您觉得好用,"),
  655. _hoisted_93
  656. ]),
  657. vue.createElementVNode("div", null, [
  658. _hoisted_94,
  659. _hoisted_95,
  660. vue.createTextVNode(" 大多只是对V2EX修修补补、美化UI,在使用体验上依旧是10年前的网站,太多脚本年久失修无人维护。楼中楼只能解析当前页,如果有多页回复,楼中楼就会前言不搭后语莫名其妙的 "),
  661. _hoisted_96,
  662. _hoisted_97,
  663. vue.createTextVNode(" 对V2EX进行了整体改造,如预览、点赞、回复、屏蔽等等都走异步请求,使用体验上已和现代网站无异,同时也集成了市面上常见的增强(辅助)功能, "),
  664. _hoisted_98,
  665. _hoisted_99,
  666. _hoisted_100,
  667. _hoisted_101,
  668. _hoisted_102,
  669. vue.createTextVNode(" 这个项目花了我很多精力,如果对您有用: 点个 "),
  670. vue.createElementVNode("a", {
  671. href: $options.windowConst.git
  672. }, "Star ⭐️", 8, _hoisted_103),
  673. vue.createTextVNode(" 或分享给他人,让更多的人知道我的存在。 "),
  674. vue.createElementVNode("div", null, [
  675. vue.createTextVNode("提供反馈,帮助我改进,以持续完善脚本。在 "),
  676. vue.createElementVNode("a", {
  677. href: $options.windowConst.issue
  678. }, "这里", 8, _hoisted_104),
  679. vue.createTextVNode(" 提出。")
  680. ]),
  681. _hoisted_105
  682. ])
  683. ])
  684. ])) : vue.createCommentVNode("", true)
  685. ])
  686. ])
  687. ])
  688. ])
  689. ])) : vue.createCommentVNode("", true)
  690. ]),
  691. _: 1
  692. });
  693. }
  694. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$8], ["__scopeId", "data-v-36f77223"]]);
  695. const eventBus = {
  696. eventMap: /* @__PURE__ */ new Map(),
  697. on(eventType, cb) {
  698. let cbs = this.eventMap.get(eventType);
  699. if (cbs) {
  700. cbs.push(cb);
  701. } else {
  702. cbs = [cb];
  703. }
  704. this.eventMap.set(eventType, cbs);
  705. },
  706. emit(eventType, val) {
  707. let cbs = this.eventMap.get(eventType);
  708. if (cbs) {
  709. cbs.map((cb) => cb(val));
  710. }
  711. },
  712. off(eventType) {
  713. let cbs = this.eventMap.has(eventType);
  714. if (cbs) {
  715. this.eventMap.delete(eventType);
  716. }
  717. },
  718. clear() {
  719. this.eventMap = /* @__PURE__ */ new Map();
  720. }
  721. };
  722. const CMD = {
  723. SHOW_TOOLTIP: "SHOW_TOOLTIP",
  724. SHOW_MSG: "SHOW_MSG",
  725. SET_CALL: "SET_CALL",
  726. SHOW_CALL: "SHOW_CALL",
  727. REFRESH_ONCE: "REFRESH_ONCE",
  728. ADD_REPLY: "ADD_REPLY",
  729. IGNORE: "IGNORE",
  730. MERGE: "MERGE",
  731. REMOVE: "REMOVE",
  732. CHANGE_COMMENT_THANK: "CHANGE_COMMENT_THANK",
  733. CHANGE_POST_THANK: "CHANGE_POST_THANK",
  734. ADD_TAG: "ADD_TAG",
  735. REMOVE_TAG: "REMOVE_TAG",
  736. RELATION_REPLY: "RELATION_REPLY",
  737. JUMP: "JUMP",
  738. REFRESH_POST: "REFRESH_POST"
  739. };
  740. const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
  741. __name: "BaseLoading",
  742. props: {
  743. size: { default: "normal" }
  744. },
  745. setup(__props) {
  746. return (_ctx, _cache) => {
  747. return vue.openBlock(), vue.createElementBlock("div", {
  748. class: vue.normalizeClass(["loading", [_ctx.size]])
  749. }, null, 2);
  750. };
  751. }
  752. });
  753. const BaseLoading = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-2697baa2"]]);
  754. const _hoisted_1$f = {
  755. key: 1,
  756. class: "key-notice"
  757. };
  758. const _hoisted_2$e = { class: "key" };
  759. const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
  760. __name: "BaseButton",
  761. props: {
  762. keyboard: {},
  763. active: { type: Boolean },
  764. disabled: { type: Boolean },
  765. loading: { type: Boolean },
  766. size: { default: "normal" },
  767. type: { default: "primary" }
  768. },
  769. emits: ["click"],
  770. setup(__props) {
  771. return (_ctx, _cache) => {
  772. return vue.openBlock(), vue.createBlock(Tooltip, {
  773. disabled: !_ctx.keyboard,
  774. title: `快捷键: ${_ctx.keyboard}`
  775. }, {
  776. default: vue.withCtx(() => [
  777. vue.createElementVNode("div", vue.mergeProps({ class: "base-button" }, _ctx.$attrs, {
  778. onClick: _cache[0] || (_cache[0] = (e2) => !_ctx.disabled && !_ctx.loading && _ctx.$emit("click", e2)),
  779. class: [
  780. _ctx.active && "active",
  781. _ctx.size,
  782. _ctx.type,
  783. (_ctx.disabled || _ctx.loading) && "disabled",
  784. !_ctx.disabled && "hvr-grow"
  785. ]
  786. }), [
  787. vue.createElementVNode("span", {
  788. style: vue.normalizeStyle({ opacity: _ctx.loading ? 0 : 1 })
  789. }, [
  790. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  791. ], 4),
  792. _ctx.loading ? (vue.openBlock(), vue.createBlock(BaseLoading, {
  793. key: 0,
  794. size: "small"
  795. })) : vue.createCommentVNode("", true),
  796. _ctx.keyboard ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
  797. vue.createElementVNode("span", _hoisted_2$e, vue.toDisplayString(_ctx.keyboard), 1)
  798. ])) : vue.createCommentVNode("", true)
  799. ], 16)
  800. ]),
  801. _: 3
  802. }, 8, ["disabled", "title"]);
  803. };
  804. }
  805. });
  806. const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5a7d79ba"]]);
  807. const _sfc_main$e = {
  808. name: "PopConfirm",
  809. components: { BaseButton },
  810. props: {
  811. title: {
  812. type: String,
  813. default() {
  814. return "";
  815. }
  816. },
  817. disabled: {
  818. type: Boolean,
  819. default() {
  820. return false;
  821. }
  822. }
  823. },
  824. data() {
  825. return {
  826. show: false
  827. };
  828. },
  829. methods: {
  830. showPop(e2) {
  831. if (this.disabled)
  832. return;
  833. let rect = e2.target.getBoundingClientRect();
  834. this.show = true;
  835. vue.nextTick(() => {
  836. this.$refs.tip.style.top = rect.top + "px";
  837. this.$refs.tip.style.left = rect.left + rect.width / 2 - 50 + "px";
  838. });
  839. },
  840. confirm() {
  841. this.show = false;
  842. this.$emit("confirm");
  843. }
  844. }
  845. };
  846. const _hoisted_1$e = { class: "pop-confirm" };
  847. const _hoisted_2$d = {
  848. key: 0,
  849. ref: "tip",
  850. class: "pop-confirm-content"
  851. };
  852. const _hoisted_3$a = { class: "text" };
  853. const _hoisted_4$a = { class: "options" };
  854. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  855. const _component_BaseButton = vue.resolveComponent("BaseButton");
  856. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
  857. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  858. vue.createVNode(vue.Transition, null, {
  859. default: vue.withCtx(() => [
  860. $data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$d, [
  861. vue.createElementVNode("div", _hoisted_3$a, vue.toDisplayString($props.title), 1),
  862. vue.createElementVNode("div", _hoisted_4$a, [
  863. vue.createVNode(_component_BaseButton, {
  864. type: "link",
  865. size: "small",
  866. onClick: _cache[0] || (_cache[0] = ($event) => $data.show = false)
  867. }, {
  868. default: vue.withCtx(() => [
  869. vue.createTextVNode("取消")
  870. ]),
  871. _: 1
  872. }),
  873. vue.createVNode(_component_BaseButton, {
  874. size: "small",
  875. onClick: $options.confirm
  876. }, {
  877. default: vue.withCtx(() => [
  878. vue.createTextVNode("确认")
  879. ]),
  880. _: 1
  881. }, 8, ["onClick"])
  882. ])
  883. ], 512)) : vue.createCommentVNode("", true)
  884. ]),
  885. _: 1
  886. })
  887. ])),
  888. vue.createElementVNode("span", {
  889. onClick: _cache[1] || (_cache[1] = (...args) => $options.showPop && $options.showPop(...args))
  890. }, [
  891. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  892. ])
  893. ]);
  894. }
  895. const PopConfirm = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$7], ["__scopeId", "data-v-05424197"]]);
  896. const loveColor = "rgb(224,42,42)";
  897. const _sfc_main$d = {
  898. name: "Point",
  899. components: { PopConfirm },
  900. inject: ["post", "isLogin"],
  901. props: {
  902. item: {
  903. type: Object,
  904. default() {
  905. return {};
  906. }
  907. },
  908. full: {
  909. type: Boolean,
  910. default() {
  911. return true;
  912. }
  913. },
  914. apiUrl: ""
  915. },
  916. computed: {
  917. disabled() {
  918. return this.item.username === window.user.username || this.item.isThanked || !this.isLogin;
  919. }
  920. },
  921. methods: {
  922. getColor() {
  923. if (this.item.isThanked)
  924. return loveColor;
  925. return this.full ? loveColor : "#929596";
  926. },
  927. getIsFull() {
  928. if (this.item.isThanked)
  929. return loveColor;
  930. return this.full ? loveColor : "none";
  931. },
  932. thankError() {
  933. if (!this.isLogin) {
  934. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  935. }
  936. if (this.item.username === window.user.username) {
  937. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  938. }
  939. if (this.item.isThanked) {
  940. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  941. }
  942. },
  943. async thank() {
  944. this.$emit("addThank");
  945. let url = `${window.baseUrl}/thank/${this.apiUrl}?once=${this.post.once}`;
  946. $.post(url).then((res) => {
  947. if (!res.success) {
  948. this.$emit("recallThank");
  949. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  950. }
  951. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  952. }, (err) => {
  953. this.$emit("recallThank");
  954. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  955. eventBus.emit(CMD.REFRESH_ONCE);
  956. });
  957. }
  958. }
  959. };
  960. const _hoisted_1$d = {
  961. viewBox: "0 0 48 48",
  962. fill: "none",
  963. xmlns: "http://www.w3.org/2000/svg"
  964. };
  965. const _hoisted_2$c = ["fill", "stroke"];
  966. const _hoisted_3$9 = {
  967. key: 0,
  968. class: "link-num"
  969. };
  970. const _hoisted_4$9 = { key: 1 };
  971. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  972. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  973. return vue.openBlock(), vue.createBlock(_component_PopConfirm, {
  974. disabled: $options.disabled,
  975. title: `确认花费 10 个铜币向 @${$props.item.username} 的这条回复发送感谢?`,
  976. onConfirm: $options.thank
  977. }, {
  978. default: vue.withCtx(() => [
  979. vue.createElementVNode("div", {
  980. class: vue.normalizeClass(["tool", $options.disabled ? "disabled" : ""]),
  981. onClick: _cache[0] || (_cache[0] = (...args) => $options.thankError && $options.thankError(...args))
  982. }, [
  983. (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$d, [
  984. vue.createElementVNode("path", {
  985. d: "M15 8C8.92487 8 4 12.9249 4 19C4 30 17 40 24 42.3262C31 40 44 30 44 19C44 12.9249 39.0751 8 33 8C29.2797 8 25.9907 9.8469 24 12.6738C22.0093 9.8469 18.7203 8 15 8Z",
  986. fill: $options.getIsFull(),
  987. stroke: $options.getColor(),
  988. "stroke-width": "2",
  989. "stroke-linecap": "round",
  990. "stroke-linejoin": "round"
  991. }, null, 8, _hoisted_2$c)
  992. ])),
  993. $props.item.thankCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$9, vue.toDisplayString($props.item.thankCount), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$9, "感谢"))
  994. ], 2)
  995. ]),
  996. _: 1
  997. }, 8, ["disabled", "title", "onConfirm"]);
  998. }
  999. const Point = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$6]]);
  1000. const _sfc_main$c = {
  1001. name: "Author",
  1002. components: { PopConfirm, Point },
  1003. inject: ["isLogin", "tags", "config", "isNight"],
  1004. props: {
  1005. modelValue: false,
  1006. comment: {
  1007. type: Object,
  1008. default() {
  1009. return {};
  1010. }
  1011. },
  1012. type: {
  1013. type: String,
  1014. default() {
  1015. return "list";
  1016. }
  1017. }
  1018. },
  1019. computed: {
  1020. isDev() {
  1021. return false;
  1022. },
  1023. pointInfo() {
  1024. return {
  1025. isThanked: this.comment.isThanked,
  1026. thankCount: this.comment.thankCount,
  1027. username: this.comment.username
  1028. };
  1029. },
  1030. myTags() {
  1031. return this.tags[this.comment.username] ?? [];
  1032. },
  1033. context() {
  1034. return this.comment.replyUsers.length;
  1035. }
  1036. },
  1037. methods: {
  1038. jump() {
  1039. eventBus.emit(CMD.JUMP, this.comment.floor);
  1040. },
  1041. showRelationReply() {
  1042. if (!this.comment.replyUsers.length) {
  1043. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "该回复无上下文" });
  1044. return;
  1045. }
  1046. eventBus.emit(CMD.RELATION_REPLY, {
  1047. left: this.comment.replyUsers,
  1048. right: this.comment.username,
  1049. rightFloor: this.comment.floor
  1050. });
  1051. },
  1052. addTag() {
  1053. eventBus.emit(CMD.ADD_TAG, this.comment.username);
  1054. },
  1055. removeTag(tag) {
  1056. eventBus.emit(CMD.REMOVE_TAG, { username: this.comment.username, tag });
  1057. },
  1058. checkIsLogin(emitName = "") {
  1059. if (!this.isLogin) {
  1060. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  1061. return false;
  1062. }
  1063. this.$emit(emitName);
  1064. return true;
  1065. },
  1066. addThank() {
  1067. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "add" });
  1068. },
  1069. recallThank() {
  1070. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "recall" });
  1071. }
  1072. }
  1073. };
  1074. const _withScopeId$a = (n2) => (vue.pushScopeId("data-v-c450f45f"), n2 = n2(), vue.popScopeId(), n2);
  1075. const _hoisted_1$c = { class: "Author-left" };
  1076. const _hoisted_2$b = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  1077. d: "M22 42H6V26",
  1078. stroke: "#177EC9",
  1079. "stroke-width": "4",
  1080. "stroke-linecap": "round",
  1081. "stroke-linejoin": "round"
  1082. }, null, -1));
  1083. const _hoisted_3$8 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  1084. d: "M26 6H42V22",
  1085. stroke: "#177EC9",
  1086. "stroke-width": "4",
  1087. "stroke-linecap": "round",
  1088. "stroke-linejoin": "round"
  1089. }, null, -1));
  1090. const _hoisted_4$8 = [
  1091. _hoisted_2$b,
  1092. _hoisted_3$8
  1093. ];
  1094. const _hoisted_5$7 = ["href"];
  1095. const _hoisted_6$7 = ["src"];
  1096. const _hoisted_7$6 = { class: "texts" };
  1097. const _hoisted_8$6 = ["href"];
  1098. const _hoisted_9$6 = {
  1099. key: 0,
  1100. class: "owner"
  1101. };
  1102. const _hoisted_10$5 = {
  1103. key: 1,
  1104. class: "dup"
  1105. };
  1106. const _hoisted_11$5 = {
  1107. key: 2,
  1108. class: "mod"
  1109. };
  1110. const _hoisted_12$5 = { class: "ago" };
  1111. const _hoisted_13$5 = { class: "my-tag" };
  1112. const _hoisted_14$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  1113. const _hoisted_15$5 = ["onClick"];
  1114. const _hoisted_16$5 = { class: "Author-right" };
  1115. const _hoisted_17$4 = {
  1116. key: 0,
  1117. class: "toolbar"
  1118. };
  1119. const _hoisted_18$4 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "tool" }, [
  1120. /* @__PURE__ */ vue.createElementVNode("span", null, "隐藏")
  1121. ], -1));
  1122. const _hoisted_19$3 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上下文", -1));
  1123. const _hoisted_20$3 = [
  1124. _hoisted_19$3
  1125. ];
  1126. const _hoisted_21$3 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  1127. const _hoisted_22$2 = [
  1128. _hoisted_21$3
  1129. ];
  1130. const _hoisted_23$2 = /* @__PURE__ */ vue.createStaticVNode('<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c450f45f><path d="M4 6H44V36H29L24 41L19 36H4V6Z" fill="none" stroke="#929596" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-c450f45f></path><path d="M23 21H25.0025" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-c450f45f></path><path d="M33.001 21H34.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-c450f45f></path><path d="M13.001 21H14.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-c450f45f></path></svg><span data-v-c450f45f>回复</span>', 2);
  1131. const _hoisted_25$2 = [
  1132. _hoisted_23$2
  1133. ];
  1134. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  1135. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  1136. const _component_Point = vue.resolveComponent("Point");
  1137. return vue.openBlock(), vue.createElementBlock("div", {
  1138. class: vue.normalizeClass(["Author", { expand: !$props.modelValue }])
  1139. }, [
  1140. vue.createElementVNode("div", _hoisted_1$c, [
  1141. !$props.modelValue ? (vue.openBlock(), vue.createElementBlock("svg", {
  1142. key: 0,
  1143. class: "expand-icon",
  1144. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", true)),
  1145. width: "24",
  1146. height: "24",
  1147. viewBox: "0 0 48 48",
  1148. fill: "none",
  1149. xmlns: "http://www.w3.org/2000/svg"
  1150. }, _hoisted_4$8)) : vue.createCommentVNode("", true),
  1151. $options.config.viewType !== "simple" ? (vue.openBlock(), vue.createElementBlock("a", {
  1152. key: 1,
  1153. class: "avatar",
  1154. href: `/member/${$props.comment.username}`
  1155. }, [
  1156. vue.createElementVNode("img", {
  1157. src: $props.comment.avatar,
  1158. alt: ""
  1159. }, null, 8, _hoisted_6$7)
  1160. ], 8, _hoisted_5$7)) : vue.createCommentVNode("", true),
  1161. vue.createElementVNode("span", _hoisted_7$6, [
  1162. vue.createElementVNode("strong", null, [
  1163. vue.createElementVNode("a", {
  1164. href: `/member/${$props.comment.username}`,
  1165. class: vue.normalizeClass(["username", { "dark": $options.isNight }])
  1166. }, vue.toDisplayString($props.comment.username), 11, _hoisted_8$6)
  1167. ]),
  1168. $props.comment.isOp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$6, "OP")) : vue.createCommentVNode("", true),
  1169. $props.comment.isDup ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$5, "DUP")) : vue.createCommentVNode("", true),
  1170. $props.comment.isMod ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$5, "MOD")) : vue.createCommentVNode("", true),
  1171. vue.createElementVNode("span", _hoisted_12$5, vue.toDisplayString($props.comment.date), 1),
  1172. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
  1173. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  1174. return vue.openBlock(), vue.createElementBlock("span", _hoisted_13$5, [
  1175. _hoisted_14$5,
  1176. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  1177. vue.createElementVNode("i", {
  1178. class: "fa fa-trash-o remove",
  1179. onClick: ($event) => $options.removeTag(i)
  1180. }, null, 8, _hoisted_15$5)
  1181. ]);
  1182. }), 256)),
  1183. vue.createElementVNode("span", {
  1184. class: "add-tag ago",
  1185. onClick: _cache[1] || (_cache[1] = (...args) => $options.addTag && $options.addTag(...args)),
  1186. title: "添加标签"
  1187. }, "+")
  1188. ], 64)) : vue.createCommentVNode("", true)
  1189. ])
  1190. ]),
  1191. vue.createElementVNode("div", _hoisted_16$5, [
  1192. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$4, [
  1193. vue.createVNode(_component_PopConfirm, {
  1194. title: "确认隐藏这条回复?",
  1195. onConfirm: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("hide"))
  1196. }, {
  1197. default: vue.withCtx(() => [
  1198. _hoisted_18$4
  1199. ]),
  1200. _: 1
  1201. }),
  1202. $options.context ? (vue.openBlock(), vue.createElementBlock("div", {
  1203. key: 0,
  1204. class: "tool",
  1205. onClick: _cache[3] || (_cache[3] = (...args) => $options.showRelationReply && $options.showRelationReply(...args))
  1206. }, _hoisted_20$3)) : vue.createCommentVNode("", true),
  1207. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock("div", {
  1208. key: 1,
  1209. class: "tool",
  1210. onClick: _cache[4] || (_cache[4] = (...args) => $options.jump && $options.jump(...args))
  1211. }, _hoisted_22$2)) : vue.createCommentVNode("", true),
  1212. vue.createElementVNode("div", {
  1213. class: "tool",
  1214. onClick: _cache[5] || (_cache[5] = ($event) => $options.checkIsLogin("reply"))
  1215. }, _hoisted_25$2),
  1216. vue.withDirectives(vue.createVNode(_component_Point, {
  1217. item: $options.pointInfo,
  1218. onAddThank: $options.addThank,
  1219. onRecallThank: $options.recallThank,
  1220. "api-url": "reply/" + $props.comment.id
  1221. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  1222. [vue.vShow, !$props.comment.thankCount]
  1223. ])
  1224. ])) : vue.createCommentVNode("", true),
  1225. vue.withDirectives(vue.createVNode(_component_Point, {
  1226. style: { "margin-left": "1rem" },
  1227. item: $options.pointInfo,
  1228. onAddThank: $options.addThank,
  1229. onRecallThank: $options.recallThank,
  1230. "api-url": "reply/" + $props.comment.id
  1231. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  1232. [vue.vShow, $props.comment.thankCount]
  1233. ]),
  1234. vue.createElementVNode("div", {
  1235. class: vue.normalizeClass(["floor", { isDev: $options.isDev }])
  1236. }, vue.toDisplayString($props.comment.floor), 3)
  1237. ])
  1238. ], 2);
  1239. }
  1240. const Author = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$5], ["__scopeId", "data-v-c450f45f"]]);
  1241. const _withScopeId$9 = (n2) => (vue.pushScopeId("data-v-fb753464"), n2 = n2(), vue.popScopeId(), n2);
  1242. const _hoisted_1$b = { class: "get-cursor" };
  1243. const _hoisted_2$a = ["innerHTML"];
  1244. const _hoisted_3$7 = { class: "toolbar" };
  1245. const _hoisted_4$7 = { class: "left" };
  1246. const _hoisted_5$6 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("path", {
  1247. d: "M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",
  1248. fill: "none",
  1249. stroke: "#929596",
  1250. "stroke-width": "2",
  1251. "stroke-linejoin": "round"
  1252. }, null, -1));
  1253. const _hoisted_6$6 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("path", {
  1254. d: "M24 35C29 35 31 31 31 31H17C17 31 19 35 24 35Z",
  1255. stroke: "#929596",
  1256. "stroke-width": "2",
  1257. "stroke-linecap": "round",
  1258. "stroke-linejoin": "round"
  1259. }, null, -1));
  1260. const _hoisted_7$5 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("path", {
  1261. d: "M31 18V22",
  1262. stroke: "#929596",
  1263. "stroke-width": "2",
  1264. "stroke-linecap": "round",
  1265. "stroke-linejoin": "round"
  1266. }, null, -1));
  1267. const _hoisted_8$5 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("path", {
  1268. d: "M17 18V22",
  1269. stroke: "#929596",
  1270. "stroke-width": "2",
  1271. "stroke-linecap": "round",
  1272. "stroke-linejoin": "round"
  1273. }, null, -1));
  1274. const _hoisted_9$5 = [
  1275. _hoisted_5$6,
  1276. _hoisted_6$6,
  1277. _hoisted_7$5,
  1278. _hoisted_8$5
  1279. ];
  1280. const _hoisted_10$4 = { class: "upload" };
  1281. const _hoisted_11$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  1282. width: "20",
  1283. height: "20",
  1284. viewBox: "0 0 48 48",
  1285. fill: "none",
  1286. xmlns: "http://www.w3.org/2000/svg"
  1287. }, [
  1288. /* @__PURE__ */ vue.createElementVNode("path", {
  1289. "fill-rule": "evenodd",
  1290. "clip-rule": "evenodd",
  1291. d: "M5 10C5 8.89543 5.89543 8 7 8L41 8C42.1046 8 43 8.89543 43 10V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V10Z",
  1292. stroke: "#929596",
  1293. "stroke-width": "2",
  1294. "stroke-linecap": "round",
  1295. "stroke-linejoin": "round"
  1296. }),
  1297. /* @__PURE__ */ vue.createElementVNode("path", {
  1298. "fill-rule": "evenodd",
  1299. "clip-rule": "evenodd",
  1300. d: "M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z",
  1301. stroke: "#929596",
  1302. "stroke-width": "2",
  1303. "stroke-linecap": "round",
  1304. "stroke-linejoin": "round"
  1305. }),
  1306. /* @__PURE__ */ vue.createElementVNode("path", {
  1307. d: "M15 24L20 28L26 21L43 34V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V34L15 24Z",
  1308. fill: "none",
  1309. stroke: "#929596",
  1310. "stroke-width": "2",
  1311. "stroke-linejoin": "round"
  1312. })
  1313. ], -1));
  1314. const _hoisted_12$4 = {
  1315. key: 0,
  1316. style: { "color": "black", "font-size": "1.4rem" }
  1317. };
  1318. const _hoisted_13$4 = { class: "right" };
  1319. const _hoisted_14$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "经典表情", -1));
  1320. const _hoisted_15$4 = { class: "list" };
  1321. const _hoisted_16$4 = ["src", "onClick"];
  1322. const _hoisted_17$3 = { class: "emoji" };
  1323. const _hoisted_18$3 = { class: "title" };
  1324. const _hoisted_19$2 = { class: "list" };
  1325. const _hoisted_20$2 = ["onClick"];
  1326. const _sfc_main$b = {
  1327. __name: "PostEditor",
  1328. props: {
  1329. replyUser: null,
  1330. replyFloor: null,
  1331. useType: {
  1332. type: String,
  1333. default() {
  1334. return "reply-comment";
  1335. }
  1336. }
  1337. },
  1338. emits: ["close"],
  1339. setup(__props, { expose: __expose, emit: __emit }) {
  1340. const props = __props;
  1341. const { replyUser, replyFloor, useType } = props;
  1342. const replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  1343. const emits = __emit;
  1344. const post = vue.inject("post");
  1345. const show = vue.inject("show");
  1346. const isNight = vue.inject("isNight");
  1347. vue.inject("pageType");
  1348. const allReplyUsers = vue.inject("allReplyUsers");
  1349. let isFocus = vue.ref(false);
  1350. const loading = vue.ref(false);
  1351. const uploadLoading = vue.ref(false);
  1352. const isShowEmoticons = vue.ref(false);
  1353. const editorId = vue.ref("editorId_" + Date.now());
  1354. const content = vue.ref(replyInfo);
  1355. const txtRef = vue.ref(null);
  1356. const cursorRef = vue.ref(null);
  1357. const emoticonsRef = vue.ref(null);
  1358. const none = vue.ref('<span style="white-space:pre-wrap;"> </span>');
  1359. const emojiEmoticons = [
  1360. {
  1361. title: "小黄脸",
  1362. list: [
  1363. "😀",
  1364. "😁",
  1365. "😂",
  1366. "🤣",
  1367. "😅",
  1368. "😊",
  1369. "😋",
  1370. "😘",
  1371. "🥰",
  1372. "😗",
  1373. "🤩",
  1374. "🤔",
  1375. "🤨",
  1376. "😐",
  1377. "😑",
  1378. "🙄",
  1379. "😏",
  1380. "😪",
  1381. "😫",
  1382. "🥱",
  1383. "😜",
  1384. "😒",
  1385. "😔",
  1386. "😨",
  1387. "😰",
  1388. "😱",
  1389. "🥵",
  1390. "😡",
  1391. "🥳",
  1392. "🥺",
  1393. "🤭",
  1394. "🧐",
  1395. "😎",
  1396. "🤓",
  1397. "😭",
  1398. "🤑",
  1399. "🤮"
  1400. ]
  1401. },
  1402. {
  1403. title: "手势",
  1404. list: [
  1405. "🙋",
  1406. "🙎",
  1407. "🙅",
  1408. "🙇",
  1409. "🤷",
  1410. "🤏",
  1411. "👉",
  1412. "✌️",
  1413. "🤘",
  1414. "🤙",
  1415. "👌",
  1416. "🤌",
  1417. "👍",
  1418. "👎",
  1419. "👋",
  1420. "🤝",
  1421. "🙏",
  1422. "👏"
  1423. ]
  1424. },
  1425. {
  1426. title: "庆祝",
  1427. list: ["✨", "🎉", "🎊"]
  1428. },
  1429. {
  1430. title: "其他",
  1431. list: ["👻", "🤡", "🐔", "👀", "💩", "🐴", "🦄", "🐧", "🐶", "🐒", "🙈", "🙉", "🙊", "🐵"]
  1432. }
  1433. ];
  1434. const classicsEmoticons = [
  1435. {
  1436. name: "[狗头]",
  1437. low: "https://i.imgur.com/io2SM1h.png",
  1438. high: "https://i.imgur.com/0icl60r.png"
  1439. },
  1440. {
  1441. name: "[马]",
  1442. low: "https://i.imgur.com/8EKZv7I.png",
  1443. high: "https://i.imgur.com/ANFUX52.png"
  1444. },
  1445. {
  1446. name: "[不高兴]",
  1447. low: "https://i.imgur.com/huX6coX.png",
  1448. high: "https://i.imgur.com/N7JEuvc.png"
  1449. },
  1450. {
  1451. name: "[呵呵]",
  1452. low: "https://i.imgur.com/RvoLAbX.png",
  1453. high: "https://i.imgur.com/xSzIqrK.png"
  1454. },
  1455. {
  1456. name: "[真棒]",
  1457. low: "https://i.imgur.com/xr1UOz1.png",
  1458. high: "https://i.imgur.com/w8YEw9Q.png"
  1459. },
  1460. {
  1461. name: "[鄙视]",
  1462. low: "https://i.imgur.com/u6jlqVq.png",
  1463. high: "https://i.imgur.com/8JFNANq.png"
  1464. },
  1465. {
  1466. name: "[疑问]",
  1467. low: "https://i.imgur.com/F29pmQ6.png",
  1468. high: "https://i.imgur.com/EbbTQAR.png"
  1469. },
  1470. {
  1471. name: "[吐舌]",
  1472. low: "https://i.imgur.com/InmIzl9.png",
  1473. high: "https://i.imgur.com/Ovj56Cd.png"
  1474. },
  1475. // {
  1476. // name: '[嘲笑]',
  1477. // low: 'https://i.imgur.com/BaWcsMR.png',
  1478. // high: 'https://i.imgur.com/0OGfJw4.png'
  1479. // },
  1480. // {
  1481. // name: '[滑稽]',
  1482. // low: 'https://i.imgur.com/lmbN0yI.png',
  1483. // high: 'https://i.imgur.com/Pc0wH85.png'
  1484. // },
  1485. {
  1486. name: "[笑眼]",
  1487. low: "https://i.imgur.com/ZveiiGy.png",
  1488. high: "https://i.imgur.com/PI1CfEr.png"
  1489. },
  1490. {
  1491. name: "[狂汗]",
  1492. low: "https://i.imgur.com/veWihk6.png",
  1493. high: "https://i.imgur.com/3LtHdQv.png"
  1494. },
  1495. {
  1496. name: "[大哭]",
  1497. low: "https://i.imgur.com/hu4oR6C.png",
  1498. high: "https://i.imgur.com/b4X9XLE.png"
  1499. },
  1500. {
  1501. name: "[喷]",
  1502. low: "https://i.imgur.com/bkw3VRr.png",
  1503. high: "https://i.imgur.com/wnZL13L.png"
  1504. },
  1505. {
  1506. name: "[苦笑]",
  1507. low: "https://i.imgur.com/VUWFktU.png",
  1508. high: "https://i.imgur.com/NAfspZ1.png"
  1509. },
  1510. {
  1511. name: "[喝酒]",
  1512. low: "https://i.imgur.com/2ZZSapE.png",
  1513. high: "https://i.imgur.com/rVbSVak.png"
  1514. },
  1515. {
  1516. name: "[吃瓜]",
  1517. low: "https://i.imgur.com/ee8Lq7H.png",
  1518. high: "https://i.imgur.com/0L26og9.png"
  1519. },
  1520. {
  1521. name: "[捂脸]",
  1522. low: "https://i.imgur.com/krir4IG.png",
  1523. high: "https://i.imgur.com/qqBqgVm.png"
  1524. },
  1525. {
  1526. name: "[呕]",
  1527. low: "https://i.imgur.com/6CUiUxv.png",
  1528. high: "https://i.imgur.com/kgdxRsG.png"
  1529. },
  1530. {
  1531. name: "[阴险]",
  1532. low: "https://i.imgur.com/MA8YqTP.png",
  1533. high: "https://i.imgur.com/e94jbaT.png"
  1534. },
  1535. {
  1536. name: "[怒]",
  1537. low: "https://i.imgur.com/n4kWfGB.png",
  1538. high: "https://i.imgur.com/iMXxNxh.png"
  1539. },
  1540. {
  1541. name: "[衰]",
  1542. low: "https://i.imgur.com/voHFDyQ.png",
  1543. high: "https://i.imgur.com/XffE6gu.png"
  1544. },
  1545. {
  1546. name: "[合十]",
  1547. low: "https://i.imgur.com/I8x3ang.png",
  1548. high: "https://i.imgur.com/T4rJVee.png"
  1549. },
  1550. {
  1551. name: "[赞]",
  1552. low: "https://i.imgur.com/lG44yUl.png",
  1553. high: "https://i.imgur.com/AoF5PLp.png"
  1554. },
  1555. {
  1556. name: "[踩]",
  1557. low: "https://i.imgur.com/cJp0uKZ.png",
  1558. high: "https://i.imgur.com/1XYGfXj.png"
  1559. },
  1560. {
  1561. name: "[爱心]",
  1562. low: "https://i.imgur.com/sLENaF5.png",
  1563. high: "https://i.imgur.com/dND56oX.png"
  1564. },
  1565. {
  1566. name: "[心碎]",
  1567. low: "https://i.imgur.com/AZxJzve.png",
  1568. high: "https://i.imgur.com/RiUsPci.png"
  1569. }
  1570. ];
  1571. const imgurClientIdPool = [
  1572. "3107b9ef8b316f3",
  1573. "442b04f26eefc8a",
  1574. "59cfebe717c09e4",
  1575. "60605aad4a62882",
  1576. "6c65ab1d3f5452a",
  1577. "83e123737849aa9",
  1578. "9311f6be1c10160",
  1579. "c4a4a563f698595",
  1580. "81be04b9e4a08ce"
  1581. ];
  1582. __expose({ content, isFocus: () => isFocus.value });
  1583. const editorClass = vue.computed(() => {
  1584. return [useType, isFocus.value ? "isFocus" : "", isNight.value ? "isNight" : ""];
  1585. });
  1586. const cursorHtml = vue.computed(() => {
  1587. var _a;
  1588. if (!txtRef.value || !content.value)
  1589. return "";
  1590. let index = ((_a = txtRef.value) == null ? void 0 : _a.selectionStart) || 0;
  1591. return content.value.substring(0, index).replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>").replace(/\s/g, none.value);
  1592. });
  1593. const disabled = vue.computed(() => {
  1594. if (content.value) {
  1595. return content.value === replyInfo;
  1596. } else {
  1597. return true;
  1598. }
  1599. });
  1600. function drop(e2) {
  1601. e2.preventDefault();
  1602. upload(e2.dataTransfer.files[0]);
  1603. }
  1604. async function upload(file) {
  1605. if (!file)
  1606. return;
  1607. if (uploadLoading.value)
  1608. return;
  1609. uploadLoading.value = true;
  1610. const formData = new FormData();
  1611. formData.append("image", file);
  1612. const randomIndex = Math.floor(Math.random() * imgurClientIdPool.length);
  1613. const clidenId = imgurClientIdPool[randomIndex];
  1614. const res = await fetch("https://api.imgur.com/3/upload", {
  1615. method: "POST",
  1616. headers: { Authorization: `Client-ID ${clidenId}` },
  1617. body: formData
  1618. });
  1619. uploadLoading.value = false;
  1620. if (res.ok) {
  1621. const resData = await res.json();
  1622. if (resData.success) {
  1623. return insert(" " + resData.data.link + " ");
  1624. }
  1625. }
  1626. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "上传失败" });
  1627. }
  1628. async function submit() {
  1629. if (disabled.value || loading.value)
  1630. return;
  1631. loading.value = true;
  1632. let submit_content = content.value.replace(/\[((?!\[).)+\]/g, function(match) {
  1633. let item2 = classicsEmoticons.find((v) => v.name === match);
  1634. if (item2) {
  1635. return item2.low + " ";
  1636. }
  1637. return match;
  1638. });
  1639. let show_content = content.value.replace(/https?:\/\/(i\.)?imgur\.com\/((?!http).)+\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)/g, function(match) {
  1640. return `<img src="${match}" data-originUrl="${match}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`;
  1641. });
  1642. show_content = show_content.replace(/\[((?!\[).)+\]/g, function(match) {
  1643. let item2 = classicsEmoticons.find((v) => v.name === match);
  1644. if (item2) {
  1645. return `<a target="_blank" href="${item2.low}" rel="nofollow noopener"><img src="${item2.low}" class="embedded_image" rel="noreferrer"></a> `;
  1646. }
  1647. return match;
  1648. });
  1649. let matchUsers = show_content.match(/@([\w]+?[\s])/g);
  1650. if (matchUsers) {
  1651. matchUsers.map((i) => {
  1652. let username = i.replace("@", "").replace(" ", "");
  1653. show_content = show_content.replace(username, `<a href="/member/${username}">${username}</a>`);
  1654. });
  1655. }
  1656. show_content = show_content.replaceAll("\n", "<br/>");
  1657. let item = {
  1658. thankCount: 0,
  1659. isThanked: false,
  1660. isOp: post.value.username === window.user.username,
  1661. isDup: false,
  1662. id: Date.now(),
  1663. username: window.user.username,
  1664. avatar: window.user.avatar,
  1665. date: "几秒前",
  1666. floor: post.value.replyCount + 1,
  1667. reply_content: show_content ?? "",
  1668. children: [],
  1669. replyUsers: replyUser ? [replyUser] : [],
  1670. replyFloor: replyFloor || -1,
  1671. level: useType === "reply-comment" ? 1 : 0
  1672. };
  1673. item.hideCallUserReplyContent = item.reply_content;
  1674. if (item.replyUsers.length === 1) {
  1675. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  1676. }
  1677. console.log("回复", item);
  1678. let url = `${window.baseUrl}/t/${post.value.id}`;
  1679. $.post(url, { content: submit_content, once: post.value.once }).then(
  1680. // $.post(url, {content: submit_content, once: 123}).then(
  1681. (res) => {
  1682. loading.value = false;
  1683. let r2 = res.search("你上一条回复的内容和这条相同");
  1684. if (r2 > -1)
  1685. return eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你上一条回复的内容和这条相同" });
  1686. r2 = res.search("请不要在每一个回复中都包括外链,这看起来像是在 spamming");
  1687. if (r2 > -1)
  1688. return eventBus.emit(CMD.SHOW_MSG, {
  1689. type: "error",
  1690. text: "请不要在每一个回复中都包括外链,这看起来像是在 spamming"
  1691. });
  1692. let r22 = res.search("创建新回复");
  1693. if (r22 > -1) {
  1694. eventBus.emit(CMD.REFRESH_ONCE, res);
  1695. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复出现了问题,请使用原版进行回复" });
  1696. let clientWidth = window.document.body.clientWidth;
  1697. let windowWidth = 1200;
  1698. let left = clientWidth / 2 - windowWidth / 2;
  1699. let newWin = window.open("创建新回复", "", `width=${windowWidth},height=600,left=${left},top=100`);
  1700. newWin.document.write(res);
  1701. let loop = setInterval(function() {
  1702. if (newWin.closed) {
  1703. clearInterval(loop);
  1704. eventBus.emit(CMD.REFRESH_POST);
  1705. }
  1706. }, 1e3);
  1707. return;
  1708. }
  1709. content.value = replyInfo;
  1710. emits("close");
  1711. eventBus.emit(CMD.REFRESH_ONCE, res);
  1712. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "回复成功" });
  1713. eventBus.emit(CMD.ADD_REPLY, item);
  1714. },
  1715. (err) => {
  1716. console.log("err", err);
  1717. loading.value = false;
  1718. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  1719. }
  1720. ).catch((r2) => {
  1721. console.log("catch", r2);
  1722. });
  1723. }
  1724. function showEmoticons(e2) {
  1725. if (isShowEmoticons.value) {
  1726. return isShowEmoticons.value = false;
  1727. }
  1728. let rect = e2.currentTarget.getBoundingClientRect();
  1729. emoticonsRef.value.style.left = rect.left + 30 + "px";
  1730. emoticonsRef.value.style.bottom = window.innerHeight - rect.top - 20 + "px";
  1731. isShowEmoticons.value = true;
  1732. }
  1733. function off() {
  1734. eventBus.emit(CMD.SHOW_CALL, { show: false });
  1735. eventBus.off(CMD.SET_CALL);
  1736. }
  1737. function checkHeight2() {
  1738. txtRef.value.style.height = 0;
  1739. txtRef.value.style.height = txtRef.value.scrollHeight + "px";
  1740. }
  1741. function insert(str) {
  1742. let cursorPos = txtRef.value.selectionStart;
  1743. let start = content.value.slice(0, cursorPos);
  1744. let end = content.value.slice(cursorPos, content.value.length);
  1745. content.value = start + str + end;
  1746. let moveCursorPos = start.length + str.length;
  1747. setTimeout(() => {
  1748. txtRef.value.focus();
  1749. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  1750. checkHeight2();
  1751. });
  1752. }
  1753. function showCallPopover(text) {
  1754. let r2 = cursorRef.value.getBoundingClientRect();
  1755. eventBus.emit(CMD.SHOW_CALL, { show: true, top: r2.top, left: r2.left, text });
  1756. eventBus.off(CMD.SET_CALL);
  1757. eventBus.on(CMD.SET_CALL, (e2) => {
  1758. let cursorPos = txtRef.value.selectionStart;
  1759. let start = content.value.slice(0, cursorPos);
  1760. let end = content.value.slice(cursorPos, content.value.length);
  1761. let lastCallPos = start.lastIndexOf("@");
  1762. start = content.value.slice(0, lastCallPos + 1);
  1763. if (e2 === "管理员") {
  1764. e2 = "Livid @Kai @Olivia @GordianZ @sparanoid";
  1765. }
  1766. if (e2 === "所有人") {
  1767. e2 = allReplyUsers.value.map((v, i) => {
  1768. if (i)
  1769. return "@" + v;
  1770. else
  1771. return v;
  1772. }).join(" ");
  1773. }
  1774. content.value = start + e2 + " " + end;
  1775. let moveCursorPos = start.length + e2.length + 1;
  1776. setTimeout(() => {
  1777. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  1778. checkHeight2();
  1779. });
  1780. eventBus.off(CMD.SET_CALL);
  1781. });
  1782. }
  1783. function onKeydown(e2) {
  1784. let code = e2.keyCode;
  1785. switch (code) {
  1786. case 8:
  1787. if (content.value === "@") {
  1788. off();
  1789. }
  1790. break;
  1791. case 37:
  1792. case 38:
  1793. case 39:
  1794. case 40:
  1795. setTimeout(() => onInput({ data: "" }), 100);
  1796. break;
  1797. case 27:
  1798. e2.preventDefault();
  1799. e2.stopPropagation();
  1800. e2.stopImmediatePropagation();
  1801. return false;
  1802. case 13:
  1803. if (e2.ctrlKey)
  1804. submit();
  1805. if (e2.metaKey)
  1806. submit();
  1807. break;
  1808. }
  1809. }
  1810. function onInput(e2) {
  1811. let cursorPos = txtRef.value.selectionStart;
  1812. if (!content.value)
  1813. return;
  1814. if (e2.data === " ") {
  1815. return off();
  1816. }
  1817. if (e2.data === "@") {
  1818. if (content.value.length !== 1) {
  1819. if (content.value[cursorPos - 2] === " " || content.value[cursorPos - 2] === "\n") {
  1820. return showCallPopover("");
  1821. }
  1822. } else {
  1823. return showCallPopover("");
  1824. }
  1825. off();
  1826. } else {
  1827. let judgeStr = content.value.slice(0, cursorPos);
  1828. let lastCallPos = judgeStr.lastIndexOf("@");
  1829. if (lastCallPos === -1) {
  1830. return off();
  1831. }
  1832. let callStr = judgeStr.slice(lastCallPos, cursorPos);
  1833. let hasSpace = callStr.includes(" ");
  1834. if (hasSpace) {
  1835. off();
  1836. } else {
  1837. if (lastCallPos === 0) {
  1838. return showCallPopover(callStr.replace("@", ""));
  1839. }
  1840. if (content.value.length !== 1) {
  1841. if (content.value[lastCallPos - 1] === " " || content.value[lastCallPos - 1] === "\n") {
  1842. return showCallPopover(callStr.replace("@", ""));
  1843. }
  1844. } else {
  1845. return showCallPopover(callStr.replace("@", ""));
  1846. }
  1847. off();
  1848. }
  1849. }
  1850. }
  1851. function onPaste(e2) {
  1852. const dataTransferItemList = e2.clipboardData.items;
  1853. const items = [].slice.call(dataTransferItemList).filter(function(item) {
  1854. return item.type.indexOf("image") !== -1;
  1855. });
  1856. if (items.length === 0) {
  1857. return;
  1858. }
  1859. const dataTransferItem = items[0];
  1860. const blob = dataTransferItem.getAsFile();
  1861. upload(blob);
  1862. }
  1863. function onBlur() {
  1864. document.removeEventListener("paste", onPaste);
  1865. isFocus.value = false;
  1866. }
  1867. function onFocusin() {
  1868. document.addEventListener("paste", onPaste);
  1869. }
  1870. vue.watch(() => show, (n2) => {
  1871. if (n2.value)
  1872. isShowEmoticons.value = false;
  1873. }, { deep: true });
  1874. vue.onMounted(() => {
  1875. $(`.${editorId.value}`).each(function() {
  1876. this.setAttribute("style", "height:" + this.scrollHeight + "px;overflow-y:hidden;");
  1877. }).on("input", function() {
  1878. this.style.height = 0;
  1879. this.style.height = this.scrollHeight + "px";
  1880. });
  1881. if (useType === "reply-comment") {
  1882. txtRef.value && txtRef.value.focus();
  1883. }
  1884. });
  1885. vue.onBeforeUnmount(() => {
  1886. $(`.${editorId.value}`).off();
  1887. });
  1888. return (_ctx, _cache) => {
  1889. return vue.openBlock(), vue.createElementBlock("div", {
  1890. class: vue.normalizeClass(["post-editor-wrapper", editorClass.value])
  1891. }, [
  1892. vue.withDirectives(vue.createElementVNode("textarea", {
  1893. class: vue.normalizeClass(["post-editor", editorId.value]),
  1894. ref_key: "txtRef",
  1895. ref: txtRef,
  1896. onFocus: _cache[0] || (_cache[0] = ($event) => vue.isRef(isFocus) ? isFocus.value = true : isFocus = true),
  1897. onBlur,
  1898. onFocusin,
  1899. placeholder: "请尽量让自己的回复能够对别人有帮助",
  1900. onInput,
  1901. onKeydown,
  1902. onDrop: drop,
  1903. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => content.value = $event)
  1904. }, null, 34), [
  1905. [vue.vModelText, content.value]
  1906. ]),
  1907. vue.createElementVNode("div", _hoisted_1$b, [
  1908. vue.createElementVNode("span", { innerHTML: cursorHtml.value }, null, 8, _hoisted_2$a),
  1909. vue.createElementVNode("span", {
  1910. class: "cursor",
  1911. ref_key: "cursorRef",
  1912. ref: cursorRef
  1913. }, "|", 512)
  1914. ]),
  1915. vue.createElementVNode("div", _hoisted_3$7, [
  1916. vue.createElementVNode("div", _hoisted_4$7, [
  1917. (vue.openBlock(), vue.createElementBlock("svg", {
  1918. onClick: showEmoticons,
  1919. width: "20",
  1920. height: "20",
  1921. viewBox: "0 0 48 48",
  1922. fill: "none",
  1923. xmlns: "http://www.w3.org/2000/svg"
  1924. }, _hoisted_9$5)),
  1925. vue.createElementVNode("div", _hoisted_10$4, [
  1926. vue.createElementVNode("input", {
  1927. type: "file",
  1928. accept: "image/*",
  1929. onChange: _cache[2] || (_cache[2] = (e2) => upload(e2.currentTarget.files[0]))
  1930. }, null, 32),
  1931. _hoisted_11$4
  1932. ]),
  1933. uploadLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12$4, "上传中.....")) : vue.createCommentVNode("", true)
  1934. ]),
  1935. vue.createElementVNode("div", _hoisted_13$4, [
  1936. vue.unref(useType) === "reply-comment" ? (vue.openBlock(), vue.createBlock(BaseButton, {
  1937. key: 0,
  1938. type: "link",
  1939. size: "small",
  1940. style: { "margin-right": "1rem", "cursor": "pointer" },
  1941. onClick: _cache[3] || (_cache[3] = ($event) => emits("close"))
  1942. }, {
  1943. default: vue.withCtx(() => [
  1944. vue.createTextVNode(" 关闭 ")
  1945. ]),
  1946. _: 1
  1947. })) : vue.createCommentVNode("", true),
  1948. vue.createVNode(BaseButton, {
  1949. size: "small",
  1950. disabled: disabled.value,
  1951. loading: loading.value,
  1952. onClick: submit
  1953. }, {
  1954. default: vue.withCtx(() => [
  1955. vue.createTextVNode("回复 ")
  1956. ]),
  1957. _: 1
  1958. }, 8, ["disabled", "loading"])
  1959. ])
  1960. ]),
  1961. vue.withDirectives(vue.createElementVNode("div", {
  1962. class: "emoticon-pack",
  1963. ref_key: "emoticonsRef",
  1964. ref: emoticonsRef
  1965. }, [
  1966. vue.createElementVNode("i", {
  1967. class: "fa fa-times",
  1968. "aria-hidden": "true",
  1969. onClick: _cache[4] || (_cache[4] = ($event) => isShowEmoticons.value = false)
  1970. }),
  1971. _hoisted_14$4,
  1972. vue.createElementVNode("div", _hoisted_15$4, [
  1973. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(classicsEmoticons, (item) => {
  1974. return vue.createElementVNode("img", {
  1975. src: item.high,
  1976. onClick: ($event) => {
  1977. insert(item.name);
  1978. isShowEmoticons.value = false;
  1979. }
  1980. }, null, 8, _hoisted_16$4);
  1981. }), 64))
  1982. ]),
  1983. vue.createElementVNode("div", _hoisted_17$3, [
  1984. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(emojiEmoticons, (item) => {
  1985. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  1986. vue.createElementVNode("div", _hoisted_18$3, vue.toDisplayString(item.title), 1),
  1987. vue.createElementVNode("div", _hoisted_19$2, [
  1988. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.list, (emoji) => {
  1989. return vue.openBlock(), vue.createElementBlock("span", {
  1990. onClick: ($event) => {
  1991. insert(emoji);
  1992. isShowEmoticons.value = false;
  1993. }
  1994. }, vue.toDisplayString(emoji), 9, _hoisted_20$2);
  1995. }), 256))
  1996. ])
  1997. ], 64);
  1998. }), 64))
  1999. ])
  2000. ], 512), [
  2001. [vue.vShow, isShowEmoticons.value]
  2002. ])
  2003. ], 2);
  2004. };
  2005. }
  2006. };
  2007. const PostEditor = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-fb753464"]]);
  2008. const _hoisted_1$a = {
  2009. key: 0,
  2010. class: "html-wrapper"
  2011. };
  2012. const _hoisted_2$9 = ["innerHTML"];
  2013. const checkHeight = 900;
  2014. const _sfc_main$a = {
  2015. __name: "BaseHtmlRender",
  2016. props: ["html"],
  2017. setup(__props) {
  2018. const config2 = vue.inject("config");
  2019. const props = __props;
  2020. const contentRef = vue.ref(null);
  2021. const mask = vue.ref(false);
  2022. const handOpen = vue.ref(false);
  2023. function mouseup(e2) {
  2024. if (!config2.value.base64)
  2025. return;
  2026. let selectionText = window.win().getSelection().toString();
  2027. if (selectionText) {
  2028. let r2 = selectionText.match(/([A-Za-z0-9+/=]+)/g);
  2029. if (r2) {
  2030. if (r2[0].length < 4)
  2031. return;
  2032. eventBus.emit(CMD.SHOW_TOOLTIP, { text: r2[0], e: e2 });
  2033. }
  2034. }
  2035. }
  2036. vue.watch(config2.value, (newVale) => {
  2037. if (!newVale.contentAutoCollapse) {
  2038. mask.value = false;
  2039. }
  2040. });
  2041. vue.watch([() => contentRef.value, () => props.html], () => {
  2042. if (!contentRef.value || !props.html)
  2043. return;
  2044. if (!config2.value.contentAutoCollapse)
  2045. return;
  2046. contentRef.value.querySelectorAll("img").forEach((item) => {
  2047. item.removeEventListener("load", checkContentHeight);
  2048. item.addEventListener("load", checkContentHeight);
  2049. });
  2050. checkContentHeight();
  2051. }, { immediate: true, flush: "post" });
  2052. function checkContentHeight() {
  2053. if (handOpen.value)
  2054. return;
  2055. let rect = contentRef.value.getBoundingClientRect();
  2056. mask.value = rect.height >= checkHeight;
  2057. }
  2058. return (_ctx, _cache) => {
  2059. return props.html ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
  2060. vue.createElementVNode("div", {
  2061. class: vue.normalizeClass({ mask: mask.value })
  2062. }, [
  2063. vue.createElementVNode("div", {
  2064. ref_key: "contentRef",
  2065. ref: contentRef,
  2066. innerHTML: props.html,
  2067. onMouseup: mouseup
  2068. }, null, 40, _hoisted_2$9)
  2069. ], 2),
  2070. mask.value ? (vue.openBlock(), vue.createElementBlock("div", {
  2071. key: 0,
  2072. class: "expand",
  2073. onClick: _cache[0] || (_cache[0] = ($event) => {
  2074. mask.value = false;
  2075. handOpen.value = true;
  2076. })
  2077. }, "展开")) : vue.createCommentVNode("", true)
  2078. ])) : vue.createCommentVNode("", true);
  2079. };
  2080. }
  2081. };
  2082. const BaseHtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-2c9a538c"]]);
  2083. const _sfc_main$9 = {
  2084. name: "Comment",
  2085. components: { BaseHtmlRender, Author, PostEditor, Point },
  2086. inject: ["post", "postDetailWidth", "show", "isNight", "config"],
  2087. props: {
  2088. modelValue: {
  2089. reply_content: ""
  2090. },
  2091. type: {
  2092. type: String,
  2093. default() {
  2094. return "list";
  2095. }
  2096. }
  2097. },
  2098. data() {
  2099. return {
  2100. showOrigin: false,
  2101. edit: false,
  2102. ding: false,
  2103. expand: true,
  2104. expandWrong: false,
  2105. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  2106. cssStyle: null,
  2107. floor: this.modelValue.floor
  2108. };
  2109. },
  2110. watch: {
  2111. show(e2) {
  2112. if (e2) {
  2113. this.edit = false;
  2114. }
  2115. },
  2116. postDetailWidth(n2, o) {
  2117. this.checkIsTooLong(n2);
  2118. }
  2119. },
  2120. computed: {
  2121. CommentDisplayType() {
  2122. return CommentDisplayType;
  2123. },
  2124. myClass() {
  2125. return {
  2126. isOp: this.modelValue.isOp,
  2127. isSimple: this.config.viewType === "simple",
  2128. ding: this.ding,
  2129. isLevelOne: this.modelValue.level === 0,
  2130. ["c_" + this.floor]: this.type !== "top"
  2131. };
  2132. }
  2133. },
  2134. mounted() {
  2135. this.checkIsTooLong(this.postDetailWidth);
  2136. },
  2137. methods: {
  2138. checkIsTooLong(postDetailWidth) {
  2139. if (postDetailWidth !== 0) {
  2140. let rect = this.$refs.comment.getBoundingClientRect();
  2141. let ban = postDetailWidth / 2;
  2142. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  2143. this.expand = false;
  2144. let padding = 2;
  2145. this.cssStyle = {
  2146. padding: "1rem 0",
  2147. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  2148. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  2149. background: this.isNight ? "#18222d" : "white"
  2150. };
  2151. }
  2152. }
  2153. },
  2154. //高亮一下
  2155. showDing() {
  2156. this.ding = true;
  2157. setTimeout(() => {
  2158. this.ding = false;
  2159. }, 2e3);
  2160. },
  2161. hide() {
  2162. let url = `${window.baseUrl}/ignore/reply/${this.modelValue.id}?once=${this.post.once}`;
  2163. eventBus.emit(CMD.REMOVE, this.modelValue.floor);
  2164. $.post(url).then((res) => {
  2165. eventBus.emit(CMD.REFRESH_ONCE);
  2166. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  2167. }, (err) => {
  2168. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  2169. });
  2170. },
  2171. toggle() {
  2172. this.expand = !this.expand;
  2173. },
  2174. toggleContent() {
  2175. if (this.modelValue.level === 0 && this.modelValue.replyUsers.length === 0)
  2176. return;
  2177. this.showOrigin = !this.showOrigin;
  2178. }
  2179. }
  2180. };
  2181. const _withScopeId$8 = (n2) => (vue.pushScopeId("data-v-888958af"), n2 = n2(), vue.popScopeId(), n2);
  2182. const _hoisted_1$9 = ["data-floor"];
  2183. const _hoisted_2$8 = { class: "comment-content" };
  2184. const _hoisted_3$6 = { class: "right" };
  2185. const _hoisted_4$6 = { class: "w" };
  2186. const _hoisted_5$5 = {
  2187. key: 0,
  2188. class: "wrong-wrapper"
  2189. };
  2190. const _hoisted_6$5 = ["href"];
  2191. const _hoisted_7$4 = { class: "del-line" };
  2192. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("i", {
  2193. class: "fa fa-question-circle-o wrong-icon",
  2194. "aria-hidden": "true"
  2195. }, null, -1));
  2196. const _hoisted_9$4 = {
  2197. key: 0,
  2198. class: "warning"
  2199. };
  2200. const _hoisted_10$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  2201. const _hoisted_11$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  2202. const _hoisted_12$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  2203. const _hoisted_13$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  2204. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  2205. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("a", {
  2206. href: "https://github.com/zyronon/web-scripts/issues",
  2207. target: "_blank"
  2208. }, "这里", -1));
  2209. const _hoisted_16$3 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("p", null, "---原文---", -1));
  2210. const _hoisted_17$2 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("p", null, "-----------", -1));
  2211. const _hoisted_18$2 = { class: "simple-wrapper" };
  2212. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  2213. const _component_Author = vue.resolveComponent("Author");
  2214. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  2215. const _component_PostEditor = vue.resolveComponent("PostEditor");
  2216. const _component_Comment = vue.resolveComponent("Comment", true);
  2217. return vue.openBlock(), vue.createElementBlock("div", {
  2218. class: vue.normalizeClass(["comment", $options.myClass]),
  2219. ref: "comment",
  2220. "data-floor": $data.floor
  2221. }, [
  2222. vue.createVNode(_component_Author, {
  2223. modelValue: $data.expand,
  2224. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  2225. comment: $props.modelValue,
  2226. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  2227. type: $props.type,
  2228. onHide: $options.hide
  2229. }, null, 8, ["modelValue", "comment", "type", "onHide"]),
  2230. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  2231. key: 0,
  2232. class: "more ago",
  2233. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  2234. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  2235. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  2236. key: 1,
  2237. class: "comment-content-w",
  2238. style: vue.normalizeStyle($data.cssStyle)
  2239. }, [
  2240. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  2241. key: 0,
  2242. class: "more ago",
  2243. onClick: _cache[3] || (_cache[3] = ($event) => $data.expand = !$data.expand)
  2244. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  2245. vue.createElementVNode("div", _hoisted_2$8, [
  2246. vue.createElementVNode("div", {
  2247. class: "left expand-line",
  2248. onClick: _cache[4] || (_cache[4] = (...args) => $options.toggle && $options.toggle(...args))
  2249. }),
  2250. vue.createElementVNode("div", _hoisted_3$6, [
  2251. vue.createElementVNode("div", _hoisted_4$6, [
  2252. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
  2253. vue.createElementVNode("span", {
  2254. onClick: _cache[5] || (_cache[5] = ($event) => $data.expandWrong = !$data.expandWrong),
  2255. title: "点击楼层号查看提示"
  2256. }, [
  2257. vue.createElementVNode("a", {
  2258. href: "/member/" + $props.modelValue.replyUsers[0]
  2259. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$5),
  2260. vue.createElementVNode("span", _hoisted_7$4, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  2261. _hoisted_8$4
  2262. ]),
  2263. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$4, [
  2264. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  2265. _hoisted_10$3,
  2266. vue.createTextVNode(" 原因可能有下面几种: "),
  2267. _hoisted_11$3,
  2268. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  2269. _hoisted_12$3,
  2270. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  2271. _hoisted_13$3,
  2272. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  2273. _hoisted_14$3,
  2274. vue.createTextVNode(" 四、脚本解析错误,请在 "),
  2275. _hoisted_15$3,
  2276. vue.createTextVNode("反馈 ")
  2277. ])) : vue.createCommentVNode("", true)
  2278. ])) : vue.createCommentVNode("", true),
  2279. $options.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser && this.type !== "top" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  2280. $data.showOrigin ? (vue.openBlock(), vue.createElementBlock("div", {
  2281. key: 0,
  2282. onDblclick: _cache[6] || (_cache[6] = (...args) => $options.toggleContent && $options.toggleContent(...args))
  2283. }, [
  2284. _hoisted_16$3,
  2285. vue.createVNode(_component_BaseHtmlRender, {
  2286. class: "reply_content",
  2287. html: $props.modelValue.reply_content
  2288. }, null, 8, ["html"]),
  2289. _hoisted_17$2
  2290. ], 32)) : vue.createCommentVNode("", true),
  2291. vue.createVNode(_component_BaseHtmlRender, {
  2292. class: "reply_content",
  2293. onDblclick: $options.toggleContent,
  2294. html: $props.modelValue.hideCallUserReplyContent
  2295. }, null, 8, ["onDblclick", "html"])
  2296. ], 64)) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  2297. key: 2,
  2298. class: "reply_content",
  2299. html: $props.modelValue.reply_content
  2300. }, null, 8, ["html"])),
  2301. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  2302. key: 3,
  2303. onClose: _cache[7] || (_cache[7] = ($event) => $data.edit = false),
  2304. replyInfo: $data.replyInfo,
  2305. replyUser: $props.modelValue.username,
  2306. replyFloor: $props.modelValue.floor
  2307. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true)
  2308. ]),
  2309. vue.createElementVNode("div", _hoisted_18$2, [
  2310. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  2311. return vue.openBlock(), vue.createBlock(_component_Comment, {
  2312. modelValue: $props.modelValue.children[index],
  2313. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  2314. key: index
  2315. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  2316. }), 128))
  2317. ])
  2318. ])
  2319. ]),
  2320. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  2321. key: 1,
  2322. class: "more ago",
  2323. onClick: _cache[8] || (_cache[8] = ($event) => $data.expand = !$data.expand)
  2324. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  2325. ], 4)) : vue.createCommentVNode("", true)
  2326. ], 10, _hoisted_1$9);
  2327. }
  2328. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$4], ["__scopeId", "data-v-888958af"]]);
  2329. const _sfc_main$8 = {
  2330. name: "Toolbar",
  2331. components: { BaseLoading },
  2332. inject: [
  2333. "isLogin",
  2334. "post",
  2335. "pageType"
  2336. ],
  2337. data() {
  2338. return {
  2339. timer: null,
  2340. loading: false,
  2341. loading2: false,
  2342. loading3: false
  2343. };
  2344. },
  2345. methods: {
  2346. checkIsLogin(emitName = "") {
  2347. if (!this.isLogin) {
  2348. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  2349. return false;
  2350. }
  2351. this.$emit(emitName);
  2352. return true;
  2353. },
  2354. getColor(val) {
  2355. return val ? "#ff4500" : "#929596";
  2356. },
  2357. getIsFull(val) {
  2358. return val ? "#ff4500" : "none";
  2359. },
  2360. tweet() {
  2361. if (!this.checkIsLogin())
  2362. return;
  2363. let username = window.user.username;
  2364. let url = `https://twitter.com/intent/tweet?url=${window.baseUrl}/t/${this.post.id}?r=${username}&related=v2ex&text=${this.post.title}`;
  2365. window.win().open(url, "_blank", "width=550,height=370");
  2366. },
  2367. report() {
  2368. if (!this.checkIsLogin())
  2369. return;
  2370. if (!this.isLogin)
  2371. return;
  2372. if (this.post.isReport)
  2373. return;
  2374. let username = window.user.username;
  2375. let url = `https://twitter.com/share?url=${window.baseUrl}/t/${this.post.id}?r=${username}&amp;related=v2ex&amp;hashtags=apple&amp;text=${this.post.title}`;
  2376. window.win().open(url, "_blank", "width=550,height=370");
  2377. },
  2378. async toggleIgnore() {
  2379. if (!this.checkIsLogin())
  2380. return;
  2381. let url = `${window.baseUrl}/${this.post.isIgnore ? "unignore" : "ignore"}/topic/${this.post.id}?once=${this.post.once}`;
  2382. if (this.pageType === PageType.Post) {
  2383. this.loading2 = true;
  2384. let apiRes = await window.win().fetch(url);
  2385. if (apiRes.redirected) {
  2386. if (!this.post.isIgnore) {
  2387. window.win().location = window.baseUrl;
  2388. }
  2389. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  2390. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  2391. } else {
  2392. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  2393. }
  2394. this.loading2 = false;
  2395. } else {
  2396. if (this.post.isIgnore) {
  2397. this.loading2 = true;
  2398. } else {
  2399. eventBus.emit(CMD.IGNORE);
  2400. }
  2401. let apiRes = await window.win().fetch(url);
  2402. if (apiRes.redirected) {
  2403. if (this.post.isIgnore) {
  2404. eventBus.emit(CMD.REFRESH_ONCE);
  2405. }
  2406. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  2407. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  2408. } else {
  2409. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略成功,仅本次有效(接口调用失败!)" });
  2410. }
  2411. this.loading2 = false;
  2412. }
  2413. },
  2414. async toggleFavorite() {
  2415. if (!this.post.isFavorite && config.collectBrowserNotice) {
  2416. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记按Command/Cmd/CTRL + D添加到书签哦" });
  2417. }
  2418. if (!this.checkIsLogin())
  2419. return;
  2420. this.loading = true;
  2421. let url = `${window.baseUrl}/${this.post.isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  2422. let apiRes = await window.win().fetch(url);
  2423. this.loading = false;
  2424. if (apiRes.redirected) {
  2425. let htmlText = await apiRes.text();
  2426. if (htmlText.search(this.post.isFavorite ? "加入收藏" : "取消收藏")) {
  2427. eventBus.emit(CMD.MERGE, { collectCount: this.post.isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  2428. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isFavorite ? "取消成功" : "收藏成功" });
  2429. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  2430. eventBus.emit(CMD.MERGE, { isFavorite: !this.post.isFavorite });
  2431. return;
  2432. }
  2433. }
  2434. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  2435. }
  2436. }
  2437. };
  2438. const _withScopeId$7 = (n2) => (vue.pushScopeId("data-v-c98b8c46"), n2 = n2(), vue.popScopeId(), n2);
  2439. const _hoisted_1$8 = { class: "toolbar" };
  2440. const _hoisted_2$7 = /* @__PURE__ */ vue.createStaticVNode('<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c98b8c46><path d="M4 6H44V36H29L24 41L19 36H4V6Z" fill="none" stroke="#929596" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-c98b8c46></path><path d="M23 21H25.0025" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-c98b8c46></path><path d="M33.001 21H34.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-c98b8c46></path><path d="M13.001 21H14.9999" stroke="#929596" stroke-width="2" stroke-linecap="round" data-v-c98b8c46></path></svg><span data-v-c98b8c46>回复</span>', 2);
  2441. const _hoisted_4$5 = [
  2442. _hoisted_2$7
  2443. ];
  2444. const _hoisted_5$4 = {
  2445. key: 1,
  2446. viewBox: "0 0 48 48",
  2447. fill: "none",
  2448. xmlns: "http://www.w3.org/2000/svg"
  2449. };
  2450. const _hoisted_6$4 = ["fill", "stroke"];
  2451. const _hoisted_7$3 = {
  2452. key: 1,
  2453. class: "tool no-hover"
  2454. };
  2455. const _hoisted_8$3 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2456. viewBox: "0 0 48 48",
  2457. fill: "none",
  2458. xmlns: "http://www.w3.org/2000/svg"
  2459. }, [
  2460. /* @__PURE__ */ vue.createElementVNode("path", {
  2461. d: "M28 6H42V20",
  2462. stroke: "#929596",
  2463. "stroke-width": "2",
  2464. "stroke-linecap": "round",
  2465. "stroke-linejoin": "round"
  2466. }),
  2467. /* @__PURE__ */ vue.createElementVNode("path", {
  2468. d: "M42 29.4737V39C42 40.6569 40.6569 42 39 42H9C7.34315 42 6 40.6569 6 39V9C6 7.34315 7.34315 6 9 6L18 6",
  2469. stroke: "#929596",
  2470. "stroke-width": "2",
  2471. "stroke-linecap": "round",
  2472. "stroke-linejoin": "round"
  2473. }),
  2474. /* @__PURE__ */ vue.createElementVNode("path", {
  2475. d: "M25.7998 22.1999L41.0998 6.8999",
  2476. stroke: "#929596",
  2477. "stroke-width": "2",
  2478. "stroke-linecap": "round",
  2479. "stroke-linejoin": "round"
  2480. })
  2481. ], -1));
  2482. const _hoisted_9$3 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("span", null, "Tweet", -1));
  2483. const _hoisted_10$2 = [
  2484. _hoisted_8$3,
  2485. _hoisted_9$3
  2486. ];
  2487. const _hoisted_11$2 = {
  2488. key: 1,
  2489. viewBox: "0 0 48 48",
  2490. fill: "none",
  2491. xmlns: "http://www.w3.org/2000/svg"
  2492. };
  2493. const _hoisted_12$2 = ["fill", "stroke"];
  2494. const _hoisted_13$2 = ["fill", "stroke"];
  2495. const _hoisted_14$2 = ["fill", "stroke"];
  2496. const _hoisted_15$2 = {
  2497. key: 1,
  2498. width: "19",
  2499. height: "19",
  2500. viewBox: "0 0 48 48",
  2501. fill: "none",
  2502. xmlns: "http://www.w3.org/2000/svg"
  2503. };
  2504. const _hoisted_16$2 = /* @__PURE__ */ vue.createStaticVNode('<path d="M36 35H12V21C12 14.3726 17.3726 9 24 9C30.6274 9 36 14.3726 36 21V35Z" fill="#929596" stroke="#929596" stroke-width="4" stroke-linejoin="round" data-v-c98b8c46></path><path d="M8 42H40" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-c98b8c46></path><path d="M4 13L7 14" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-c98b8c46></path><path d="M13 3.9999L14 6.9999" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-c98b8c46></path><path d="M10.0001 9.99989L7.00009 6.99989" stroke="#929596" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-c98b8c46></path>', 5);
  2505. const _hoisted_21$2 = [
  2506. _hoisted_16$2
  2507. ];
  2508. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  2509. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  2510. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
  2511. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  2512. vue.createElementVNode("div", {
  2513. class: "tool",
  2514. onClick: _cache[0] || (_cache[0] = ($event) => $options.checkIsLogin("reply"))
  2515. }, _hoisted_4$5),
  2516. $options.post.once ? (vue.openBlock(), vue.createElementBlock("div", {
  2517. key: 0,
  2518. class: vue.normalizeClass(["tool", { disabled: $data.loading }]),
  2519. onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleFavorite && $options.toggleFavorite(...args))
  2520. }, [
  2521. $data.loading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  2522. key: 0,
  2523. size: "small"
  2524. })) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_5$4, [
  2525. vue.createElementVNode("path", {
  2526. d: "M23.9986 5L17.8856 17.4776L4 19.4911L14.0589 29.3251L11.6544 43L23.9986 36.4192L36.3454 43L33.9586 29.3251L44 19.4911L30.1913 17.4776L23.9986 5Z",
  2527. fill: $options.getIsFull($options.post.isFavorite),
  2528. stroke: $options.getColor($options.post.isFavorite),
  2529. "stroke-width": "2",
  2530. "stroke-linejoin": "round"
  2531. }, null, 8, _hoisted_6$4)
  2532. ])),
  2533. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isFavorite ? "取消收藏" : "加入收藏"), 1)
  2534. ], 2)) : vue.createCommentVNode("", true),
  2535. $options.post.once && $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$3, [
  2536. vue.createElementVNode("span", null, vue.toDisplayString($options.post.collectCount + "人收藏"), 1)
  2537. ])) : vue.createCommentVNode("", true),
  2538. vue.createElementVNode("div", {
  2539. class: "tool",
  2540. onClick: _cache[2] || (_cache[2] = (...args) => $options.tweet && $options.tweet(...args))
  2541. }, _hoisted_10$2),
  2542. $options.post.once ? (vue.openBlock(), vue.createElementBlock("div", {
  2543. key: 2,
  2544. class: vue.normalizeClass(["tool", { "disabled": $data.loading2 }]),
  2545. onClick: _cache[3] || (_cache[3] = (...args) => $options.toggleIgnore && $options.toggleIgnore(...args))
  2546. }, [
  2547. $data.loading2 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  2548. key: 0,
  2549. size: "small"
  2550. })) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_11$2, [
  2551. vue.createElementVNode("path", {
  2552. fill: $options.getIsFull($options.post.isIgnore),
  2553. stroke: $options.getColor($options.post.isIgnore),
  2554. d: "M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30",
  2555. "stroke-width": "2",
  2556. "stroke-linecap": "round",
  2557. "stroke-linejoin": "round"
  2558. }, null, 8, _hoisted_12$2),
  2559. vue.createElementVNode("path", {
  2560. fill: $options.getIsFull($options.post.isIgnore),
  2561. d: "M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705",
  2562. stroke: $options.getColor($options.post.isIgnore),
  2563. "stroke-width": "2",
  2564. "stroke-linecap": "round",
  2565. "stroke-linejoin": "round"
  2566. }, null, 8, _hoisted_13$2),
  2567. vue.createElementVNode("path", {
  2568. d: "M42 42L6 6",
  2569. fill: $options.getIsFull($options.post.isIgnore),
  2570. stroke: $options.getColor($options.post.isIgnore),
  2571. "stroke-width": "2",
  2572. "stroke-linecap": "round",
  2573. "stroke-linejoin": "round"
  2574. }, null, 8, _hoisted_14$2)
  2575. ])),
  2576. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isIgnore ? "取消忽略" : "忽略主题"), 1)
  2577. ], 2)) : vue.createCommentVNode("", true),
  2578. $options.post.once && $options.isLogin && false ? (vue.openBlock(), vue.createElementBlock("div", {
  2579. key: 3,
  2580. class: vue.normalizeClass(["tool", { "disabled": $data.loading3, "no-hover": $options.post.isLogin }]),
  2581. onClick: _cache[4] || (_cache[4] = (...args) => $options.report && $options.report(...args))
  2582. }, [
  2583. $data.loading3 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  2584. key: 0,
  2585. size: "small"
  2586. })) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_15$2, _hoisted_21$2)),
  2587. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isReport ? "你已对本主题进行了报告" : "报告这个主题"), 1)
  2588. ], 2)) : vue.createCommentVNode("", true)
  2589. ]);
  2590. }
  2591. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$3], ["__scopeId", "data-v-c98b8c46"]]);
  2592. const _withScopeId$6 = (n2) => (vue.pushScopeId("data-v-953d8ab1"), n2 = n2(), vue.popScopeId(), n2);
  2593. const _hoisted_1$7 = ["href"];
  2594. const _hoisted_2$6 = ["src"];
  2595. const _hoisted_3$5 = { class: "texts" };
  2596. const _hoisted_4$4 = {
  2597. key: 0,
  2598. class: "point"
  2599. };
  2600. const _hoisted_5$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2601. width: "19",
  2602. height: "19",
  2603. viewBox: "0 0 48 48",
  2604. fill: "none"
  2605. }, [
  2606. /* @__PURE__ */ vue.createElementVNode("path", {
  2607. d: "M15 8C8.92487 8 4 12.9249 4 19C4 30 17 40 24 42.3262C31 40 44 30 44 19C44 12.9249 39.0751 8 33 8C29.2797 8 25.9907 9.8469 24 12.6738C22.0093 9.8469 18.7203 8 15 8Z",
  2608. fill: "#E02A2A",
  2609. stroke: "#E02A2A",
  2610. "stroke-width": "2",
  2611. "stroke-linecap": "round",
  2612. "stroke-linejoin": "round"
  2613. })
  2614. ], -1));
  2615. const _hoisted_6$3 = { class: "link-num" };
  2616. const _hoisted_7$2 = { class: "my-tag" };
  2617. const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  2618. const _hoisted_9$2 = {
  2619. key: 2,
  2620. class: "ago"
  2621. };
  2622. const _hoisted_10$1 = {
  2623. key: 3,
  2624. class: "mod"
  2625. };
  2626. const _hoisted_11$1 = {
  2627. key: 4,
  2628. class: "owner"
  2629. };
  2630. const _hoisted_12$1 = ["href"];
  2631. const _hoisted_13$1 = {
  2632. key: 5,
  2633. class: "owner"
  2634. };
  2635. const _hoisted_14$1 = {
  2636. key: 6,
  2637. class: "mod"
  2638. };
  2639. const _hoisted_15$1 = {
  2640. key: 7,
  2641. class: "ago"
  2642. };
  2643. const _hoisted_16$1 = { class: "my-tag" };
  2644. const _hoisted_17$1 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  2645. const _hoisted_18$1 = {
  2646. key: 9,
  2647. class: "point"
  2648. };
  2649. const _hoisted_19$1 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  2650. width: "19",
  2651. height: "19",
  2652. viewBox: "0 0 48 48",
  2653. fill: "none"
  2654. }, [
  2655. /* @__PURE__ */ vue.createElementVNode("path", {
  2656. d: "M15 8C8.92487 8 4 12.9249 4 19C4 30 17 40 24 42.3262C31 40 44 30 44 19C44 12.9249 39.0751 8 33 8C29.2797 8 25.9907 9.8469 24 12.6738C22.0093 9.8469 18.7203 8 15 8Z",
  2657. fill: "#E02A2A",
  2658. stroke: "#E02A2A",
  2659. "stroke-width": "2",
  2660. "stroke-linecap": "round",
  2661. "stroke-linejoin": "round"
  2662. })
  2663. ], -1));
  2664. const _hoisted_20$1 = { class: "link-num" };
  2665. const _hoisted_21$1 = ["href"];
  2666. const _hoisted_22$1 = ["src"];
  2667. const _hoisted_23$1 = { class: "Author-right" };
  2668. const _hoisted_24$1 = { class: "floor" };
  2669. const _hoisted_25$1 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  2670. const _hoisted_26$1 = [
  2671. _hoisted_25$1
  2672. ];
  2673. const _sfc_main$7 = {
  2674. __name: "SingleComment",
  2675. props: {
  2676. comment: {
  2677. reply_content: ""
  2678. },
  2679. isRight: {
  2680. type: Boolean,
  2681. default() {
  2682. return false;
  2683. }
  2684. }
  2685. },
  2686. setup(__props) {
  2687. const config2 = vue.inject("config");
  2688. const isLogin = vue.inject("isLogin");
  2689. const tags = vue.inject("tags");
  2690. const props = __props;
  2691. const myTags = vue.computed(() => {
  2692. return tags[props.comment.username] ?? [];
  2693. });
  2694. function jump() {
  2695. eventBus.emit(CMD.JUMP, props.comment.floor);
  2696. }
  2697. return (_ctx, _cache) => {
  2698. return vue.openBlock(), vue.createElementBlock("div", {
  2699. class: vue.normalizeClass(["comment", { isSimple: vue.unref(config2).viewType === "simple" }]),
  2700. ref: "comment"
  2701. }, [
  2702. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  2703. key: 0,
  2704. class: "avatar",
  2705. href: `/member/${__props.comment.username}`
  2706. }, [
  2707. vue.createElementVNode("img", {
  2708. src: __props.comment.avatar,
  2709. alt: ""
  2710. }, null, 8, _hoisted_2$6)
  2711. ], 8, _hoisted_1$7)) : vue.createCommentVNode("", true),
  2712. vue.createElementVNode("div", {
  2713. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  2714. }, [
  2715. vue.createElementVNode("div", _hoisted_3$5, [
  2716. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [
  2717. _hoisted_5$3,
  2718. vue.createElementVNode("div", _hoisted_6$3, vue.toDisplayString(__props.comment.thankCount), 1)
  2719. ])) : vue.createCommentVNode("", true),
  2720. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(myTags.value, (i) => {
  2721. return vue.openBlock(), vue.createElementBlock("span", _hoisted_7$2, [
  2722. _hoisted_8$2,
  2723. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  2724. ]);
  2725. }), 256)) : vue.createCommentVNode("", true),
  2726. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$2, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  2727. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$1, "MOD")) : vue.createCommentVNode("", true),
  2728. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, "OP")) : vue.createCommentVNode("", true),
  2729. vue.createElementVNode("a", {
  2730. href: `/member/${__props.comment.username}`,
  2731. class: "username"
  2732. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_12$1),
  2733. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, "OP")) : vue.createCommentVNode("", true),
  2734. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$1, "MOD")) : vue.createCommentVNode("", true),
  2735. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_15$1, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  2736. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(myTags.value, (i) => {
  2737. return vue.openBlock(), vue.createElementBlock("span", _hoisted_16$1, [
  2738. _hoisted_17$1,
  2739. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  2740. ]);
  2741. }), 256)) : vue.createCommentVNode("", true),
  2742. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, [
  2743. _hoisted_19$1,
  2744. vue.createElementVNode("div", _hoisted_20$1, vue.toDisplayString(__props.comment.thankCount), 1)
  2745. ])) : vue.createCommentVNode("", true)
  2746. ]),
  2747. vue.createVNode(BaseHtmlRender, {
  2748. class: "reply_content",
  2749. html: __props.comment.reply_content
  2750. }, null, 8, ["html"])
  2751. ], 2),
  2752. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  2753. key: 1,
  2754. class: "avatar",
  2755. href: `/member/${__props.comment.username}`
  2756. }, [
  2757. vue.createElementVNode("img", {
  2758. src: __props.comment.avatar,
  2759. alt: ""
  2760. }, null, 8, _hoisted_22$1)
  2761. ], 8, _hoisted_21$1)) : vue.createCommentVNode("", true),
  2762. vue.createElementVNode("div", _hoisted_23$1, [
  2763. vue.createElementVNode("div", _hoisted_24$1, vue.toDisplayString(__props.comment.floor), 1),
  2764. vue.createElementVNode("div", {
  2765. class: "tool jump",
  2766. onClick: jump
  2767. }, _hoisted_26$1)
  2768. ])
  2769. ], 2);
  2770. };
  2771. }
  2772. };
  2773. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-953d8ab1"]]);
  2774. const _sfc_main$6 = {
  2775. name: "detail",
  2776. components: {
  2777. BaseButton,
  2778. SingleComment,
  2779. PopConfirm,
  2780. Comment,
  2781. PostEditor,
  2782. Point,
  2783. Toolbar,
  2784. BaseHtmlRender,
  2785. Tooltip,
  2786. BaseLoading
  2787. },
  2788. inject: ["allReplyUsers", "post", "isMobile", "tags", "isLogin", "config", "pageType", "isNight"],
  2789. provide() {
  2790. return {
  2791. postDetailWidth: vue.computed(() => this.postDetailWidth)
  2792. };
  2793. },
  2794. props: {
  2795. modelValue: {
  2796. type: Boolean,
  2797. default() {
  2798. return false;
  2799. }
  2800. },
  2801. loading: {
  2802. type: Boolean,
  2803. default() {
  2804. return false;
  2805. }
  2806. },
  2807. refreshLoading: {
  2808. type: Boolean,
  2809. default() {
  2810. return false;
  2811. }
  2812. },
  2813. displayType: CommentDisplayType.FloorInFloorNoCallUser
  2814. },
  2815. data() {
  2816. return {
  2817. isSticky: false,
  2818. selectCallIndex: 0,
  2819. postDetailWidth: 0,
  2820. showCallList: false,
  2821. showRelationReply: false,
  2822. replyText: "",
  2823. callStyle: {
  2824. top: 0,
  2825. left: 0
  2826. },
  2827. targetUser: {
  2828. left: [],
  2829. right: "",
  2830. rightFloor: -1
  2831. },
  2832. currentFloor: "",
  2833. showOpTag: false
  2834. };
  2835. },
  2836. computed: {
  2837. isMy() {
  2838. return this.post.member.username === window.user.username;
  2839. },
  2840. myTags() {
  2841. return this.tags[this.post.member.username] ?? [];
  2842. },
  2843. CommentDisplayType() {
  2844. return CommentDisplayType;
  2845. },
  2846. isPost() {
  2847. return this.pageType === PageType.Post;
  2848. },
  2849. filterCallList() {
  2850. if (this.showCallList) {
  2851. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  2852. if (this.replyText)
  2853. return list.filter((i) => i.search(this.replyText) > -1);
  2854. return list;
  2855. }
  2856. return [];
  2857. },
  2858. topReply() {
  2859. return this.post.replyList.filter((v) => v.thankCount >= this.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, this.config.topReplyCount);
  2860. },
  2861. replyList() {
  2862. if ([CommentDisplayType.FloorInFloor, CommentDisplayType.FloorInFloorNoCallUser].includes(this.displayType))
  2863. return this.post.nestedReplies;
  2864. if (this.displayType === CommentDisplayType.Like) {
  2865. return window.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  2866. }
  2867. if (this.displayType === CommentDisplayType.V2exOrigin)
  2868. return this.post.replyList;
  2869. if (this.displayType === CommentDisplayType.FloorInFloorNested)
  2870. return this.post.nestedRedundReplies;
  2871. if (this.displayType === CommentDisplayType.OnlyOp)
  2872. return this.post.replyList.filter((v) => {
  2873. var _a;
  2874. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  2875. });
  2876. return [];
  2877. },
  2878. //关联回复
  2879. relationReply() {
  2880. if (this.targetUser.left.length && this.targetUser.right) {
  2881. return this.post.replyList.filter((v) => {
  2882. if (this.targetUser.left.includes(v.username)) {
  2883. if (v.floor > this.targetUser.rightFloor) {
  2884. if (v.replyUsers.includes(this.targetUser.right)) {
  2885. return true;
  2886. }
  2887. } else {
  2888. return true;
  2889. }
  2890. }
  2891. if (v.username === this.targetUser.right) {
  2892. for (let i = 0; i < this.targetUser.left.length; i++) {
  2893. if (v.replyUsers.includes(this.targetUser.left[i])) {
  2894. return true;
  2895. }
  2896. }
  2897. }
  2898. });
  2899. }
  2900. return [];
  2901. }
  2902. },
  2903. watch: {
  2904. "post.id"(n2, o) {
  2905. if (this.$refs["post-editor"]) {
  2906. this.$refs["post-editor"].content = "";
  2907. vue.nextTick(() => {
  2908. var _a, _b;
  2909. (_b = (_a = this.$refs) == null ? void 0 : _a.detail) == null ? void 0 : _b.scrollTo({ top: 0 });
  2910. });
  2911. }
  2912. },
  2913. "post.headerTemplate"(n2, o) {
  2914. let mountEl = document.querySelector(".main-wrapper .post-wrapper .html-wrapper .header");
  2915. if (mountEl) {
  2916. this.showOpTag = true;
  2917. }
  2918. },
  2919. modelValue: {
  2920. handler(newVal) {
  2921. if (this.isPost) {
  2922. return;
  2923. }
  2924. if (newVal) {
  2925. document.body.style.overflow = "hidden";
  2926. if (!window.history.state) {
  2927. window.history.pushState({}, 0, this.post.href);
  2928. }
  2929. this.currentFloor = "";
  2930. vue.nextTick(() => {
  2931. var _a, _b;
  2932. window.document.title = this.post.title ?? "V2EX";
  2933. (_b = (_a = this.$refs) == null ? void 0 : _a.main) == null ? void 0 : _b.focus();
  2934. });
  2935. } else {
  2936. document.body.style.overflow = "unset";
  2937. window.document.title = "V2EX";
  2938. this.isSticky = false;
  2939. this.showRelationReply = false;
  2940. if (window.history.state) {
  2941. window.history.back();
  2942. }
  2943. }
  2944. }
  2945. }
  2946. },
  2947. mounted() {
  2948. setTimeout(() => {
  2949. var _a;
  2950. this.postDetailWidth = ((_a = this.$refs.mainWrapper) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
  2951. });
  2952. if (this.isLogin) {
  2953. const observer = new IntersectionObserver(
  2954. ([e2]) => e2.target.toggleAttribute("stuck", e2.intersectionRatio < 1),
  2955. { threshold: [1] }
  2956. );
  2957. observer.observe(this.$refs.replyBox);
  2958. window.addEventListener("keydown", this.onKeyDown);
  2959. }
  2960. eventBus.on(CMD.SHOW_CALL, (val) => {
  2961. if (val.show) {
  2962. this.showCallList = true;
  2963. this.replyText = val.text;
  2964. if (this.isPost) {
  2965. this.callStyle.top = val.top + $(window.win()).scrollTop() + -40 + "px";
  2966. } else {
  2967. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  2968. }
  2969. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  2970. if (this.selectCallIndex >= this.filterCallList.length) {
  2971. this.selectCallIndex = 0;
  2972. }
  2973. } else {
  2974. this.replyText = "";
  2975. this.showCallList = false;
  2976. this.selectCallIndex = 0;
  2977. }
  2978. });
  2979. eventBus.on(CMD.RELATION_REPLY, (val) => {
  2980. this.targetUser = val;
  2981. this.showRelationReply = true;
  2982. });
  2983. eventBus.on(CMD.JUMP, this.jump);
  2984. if (this.isPost) {
  2985. window.addEventListener("scroll", this.debounceScroll);
  2986. }
  2987. },
  2988. beforeUnmount() {
  2989. window.removeEventListener("keydown", this.onKeyDown);
  2990. eventBus.off(CMD.SHOW_CALL);
  2991. },
  2992. methods: {
  2993. addTag() {
  2994. eventBus.emit(CMD.ADD_TAG, this.post.member.username);
  2995. },
  2996. removeTag(tag) {
  2997. eventBus.emit(CMD.REMOVE_TAG, { username: this.post.member.username, tag });
  2998. },
  2999. stop(e2) {
  3000. },
  3001. jump(floor) {
  3002. let lastItem = this.replyList[this.replyList.length - 1];
  3003. if (floor === "") {
  3004. floor = lastItem.floor;
  3005. } else {
  3006. try {
  3007. floor = Number(floor);
  3008. } catch (e2) {
  3009. floor = lastItem.floor;
  3010. }
  3011. if (floor === 0) {
  3012. floor = 1;
  3013. }
  3014. if (floor > lastItem.floor)
  3015. floor = lastItem.floor;
  3016. }
  3017. if (!this.post.replyList.length) {
  3018. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  3019. return;
  3020. }
  3021. if (floor > this.post.replyList.length) {
  3022. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  3023. return;
  3024. }
  3025. let comment = $(`.c_${floor}`);
  3026. if (!comment.length) {
  3027. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  3028. return;
  3029. }
  3030. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  3031. comment.addClass("ding");
  3032. this.currentFloor = floor + 1;
  3033. setTimeout(() => {
  3034. comment.removeClass("ding");
  3035. }, 2e3);
  3036. },
  3037. collapseTopReplyList() {
  3038. $(this.$refs.topReply).slideToggle("fast");
  3039. },
  3040. goBottom() {
  3041. this.isSticky = false;
  3042. setTimeout(() => {
  3043. if (this.isPost) {
  3044. let body = $("body , html");
  3045. let scrollHeight = body.prop("scrollHeight");
  3046. body.animate({ scrollTop: scrollHeight - 850 }, 300);
  3047. } else {
  3048. this.$refs.detail.scrollTo({ top: this.$refs.detail.scrollHeight, behavior: "smooth" });
  3049. }
  3050. });
  3051. },
  3052. close(from) {
  3053. if (this.isPost)
  3054. return;
  3055. if (from === "space") {
  3056. if (this.config.closePostDetailBySpace) {
  3057. this.$emit("update:modelValue", false);
  3058. }
  3059. } else {
  3060. this.$emit("update:modelValue", false);
  3061. }
  3062. },
  3063. setCall(e2) {
  3064. eventBus.emit(CMD.SET_CALL, e2);
  3065. this.showCallList = false;
  3066. },
  3067. onKeyDown(e2) {
  3068. if (!this.modelValue)
  3069. return;
  3070. if (!this.showCallList)
  3071. return;
  3072. let length = this.filterCallList.slice(0, 10).length;
  3073. if (e2.keyCode === 13) {
  3074. this.setCall(this.filterCallList[this.selectCallIndex]);
  3075. e2.preventDefault();
  3076. }
  3077. if (e2.keyCode === 38) {
  3078. this.selectCallIndex--;
  3079. if (this.selectCallIndex < 0) {
  3080. this.selectCallIndex = length - 1;
  3081. }
  3082. e2.preventDefault();
  3083. }
  3084. if (e2.keyCode === 40) {
  3085. this.selectCallIndex++;
  3086. if (this.selectCallIndex > length - 1) {
  3087. this.selectCallIndex = 0;
  3088. }
  3089. e2.preventDefault();
  3090. }
  3091. },
  3092. changeOption(item) {
  3093. this.$emit("update:displayType", item);
  3094. },
  3095. addThank() {
  3096. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "add" });
  3097. },
  3098. recallThank() {
  3099. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "recall" });
  3100. },
  3101. scrollTop() {
  3102. if (this.isPost) {
  3103. $("body , html").animate({ scrollTop: 0 }, 300);
  3104. } else {
  3105. this.$refs.detail.scrollTo({ top: 0, behavior: "smooth" });
  3106. }
  3107. }
  3108. }
  3109. };
  3110. const _withScopeId$5 = (n2) => (vue.pushScopeId("data-v-88f5644d"), n2 = n2(), vue.popScopeId(), n2);
  3111. const _hoisted_1$6 = { class: "my-box post-wrapper" };
  3112. const _hoisted_2$5 = { class: "header" };
  3113. const _hoisted_3$4 = { class: "fr" };
  3114. const _hoisted_4$3 = ["href"];
  3115. const _hoisted_5$2 = ["src", "alt"];
  3116. const _hoisted_6$2 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "/" }, "V2EX", -1));
  3117. const _hoisted_7$1 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "chevron" }, "  ›  ", -1));
  3118. const _hoisted_8$1 = ["href"];
  3119. const _hoisted_9$1 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep10" }, null, -1));
  3120. const _hoisted_10 = ["id"];
  3121. const _hoisted_11 = ["onclick"];
  3122. const _hoisted_12 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-up" }, null, -1));
  3123. const _hoisted_13 = ["onclick"];
  3124. const _hoisted_14 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-down" }, null, -1));
  3125. const _hoisted_15 = [
  3126. _hoisted_14
  3127. ];
  3128. const _hoisted_16 = { class: "gray" };
  3129. const _hoisted_17 = ["href"];
  3130. const _hoisted_18 = ["title"];
  3131. const _hoisted_19 = ["href"];
  3132. const _hoisted_20 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-info-circle" }, null, -1));
  3133. const _hoisted_21 = [
  3134. _hoisted_20
  3135. ];
  3136. const _hoisted_22 = ["href"];
  3137. const _hoisted_23 = { class: "my-tag" };
  3138. const _hoisted_24 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  3139. const _hoisted_25 = ["onClick"];
  3140. const _hoisted_26 = {
  3141. key: 0,
  3142. class: "my-box"
  3143. };
  3144. const _hoisted_27 = { class: "my-cell flex" };
  3145. const _hoisted_28 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "" }, "高赞回复", -1));
  3146. const _hoisted_29 = { class: "top-reply" };
  3147. const _hoisted_30 = { ref: "topReply" };
  3148. const _hoisted_31 = {
  3149. key: 1,
  3150. class: "my-box my-cell"
  3151. };
  3152. const _hoisted_32 = ["innerHTML"];
  3153. const _hoisted_33 = { class: "my-box comment-wrapper" };
  3154. const _hoisted_34 = {
  3155. key: 0,
  3156. class: "my-cell flex"
  3157. };
  3158. const _hoisted_35 = { class: "radio-group2" };
  3159. const _hoisted_36 = { class: "my-cell flex" };
  3160. const _hoisted_37 = { key: 0 };
  3161. const _hoisted_38 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("strong", { class: "snow" }, "•", -1));
  3162. const _hoisted_39 = ["innerHTML"];
  3163. const _hoisted_40 = {
  3164. key: 0,
  3165. class: "loading-wrapper"
  3166. };
  3167. const _hoisted_41 = {
  3168. key: 1,
  3169. class: "comments"
  3170. };
  3171. const _hoisted_42 = {
  3172. key: 2,
  3173. id: "no-comments-yet"
  3174. };
  3175. const _hoisted_43 = { class: "my-cell flex" };
  3176. const _hoisted_44 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "添加一条新回复", -1));
  3177. const _hoisted_45 = { class: "notice-right gray" };
  3178. const _hoisted_46 = { class: "p1" };
  3179. const _hoisted_47 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "上下文", -1));
  3180. const _hoisted_48 = { class: "top-reply" };
  3181. const _hoisted_49 = ["onClick"];
  3182. const _hoisted_50 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("i", {
  3183. class: "fa fa-times",
  3184. "aria-hidden": "true"
  3185. }, null, -1));
  3186. const _hoisted_51 = [
  3187. _hoisted_50
  3188. ];
  3189. const _hoisted_52 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("i", {
  3190. class: "fa fa-long-arrow-up",
  3191. "aria-hidden": "true"
  3192. }, null, -1));
  3193. const _hoisted_53 = [
  3194. _hoisted_52
  3195. ];
  3196. const _hoisted_54 = {
  3197. key: 1,
  3198. class: "fa fa-refresh",
  3199. "aria-hidden": "true"
  3200. };
  3201. const _hoisted_55 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-long-arrow-down" }, null, -1));
  3202. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  3203. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  3204. const _component_Point = vue.resolveComponent("Point");
  3205. const _component_Toolbar = vue.resolveComponent("Toolbar");
  3206. const _component_Tooltip = vue.resolveComponent("Tooltip");
  3207. const _component_Comment = vue.resolveComponent("Comment");
  3208. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  3209. const _component_PostEditor = vue.resolveComponent("PostEditor");
  3210. const _component_SingleComment = vue.resolveComponent("SingleComment");
  3211. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  3212. class: vue.normalizeClass(["post-detail", [$options.isNight ? "isNight" : "", $options.pageType, $options.isMobile ? "mobile" : ""]]),
  3213. ref: "detail",
  3214. onKeydown: _cache[24] || (_cache[24] = vue.withKeys(($event) => $options.close(), ["esc"])),
  3215. onScroll: _cache[25] || (_cache[25] = (...args) => _ctx.debounceScroll && _ctx.debounceScroll(...args)),
  3216. onClick: _cache[26] || (_cache[26] = ($event) => $options.close("space"))
  3217. }, [
  3218. vue.createElementVNode("div", {
  3219. ref: "main",
  3220. class: "main",
  3221. tabindex: "1",
  3222. onClick: _cache[23] || (_cache[23] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3223. }, [
  3224. vue.createElementVNode("div", {
  3225. class: "main-wrapper",
  3226. ref: "mainWrapper",
  3227. style: vue.normalizeStyle({ width: $options.config.postWidth })
  3228. }, [
  3229. vue.createElementVNode("div", _hoisted_1$6, [
  3230. vue.createElementVNode("div", _hoisted_2$5, [
  3231. vue.createElementVNode("div", _hoisted_3$4, [
  3232. vue.createElementVNode("a", {
  3233. href: `/member/${$options.post.member.username}`,
  3234. style: { "width": "73px", "height": "73px", "display": "inline-block" }
  3235. }, [
  3236. $options.post.member.avatar_large ? (vue.openBlock(), vue.createElementBlock("img", {
  3237. key: 0,
  3238. src: $options.post.member.avatar_large,
  3239. class: "avatar",
  3240. style: { "width": "73px", "height": "73px" },
  3241. border: "0",
  3242. align: "default",
  3243. alt: $options.post.member.username
  3244. }, null, 8, _hoisted_5$2)) : vue.createCommentVNode("", true)
  3245. ], 8, _hoisted_4$3)
  3246. ]),
  3247. _hoisted_6$2,
  3248. _hoisted_7$1,
  3249. vue.createElementVNode("a", {
  3250. href: $options.post.node.url
  3251. }, vue.toDisplayString($options.post.node.title), 9, _hoisted_8$1),
  3252. _hoisted_9$1,
  3253. vue.createElementVNode("h1", null, vue.toDisplayString($options.post.title), 1),
  3254. !$options.isMobile ? (vue.openBlock(), vue.createElementBlock("div", {
  3255. key: 0,
  3256. id: `topic_${$options.post.id}_votes`,
  3257. class: "votes"
  3258. }, [
  3259. vue.createElementVNode("a", {
  3260. href: "javascript:",
  3261. onclick: `upVoteTopic(${$options.post.id});`,
  3262. class: "vote"
  3263. }, [
  3264. _hoisted_12,
  3265. vue.createTextVNode("   ")
  3266. ], 8, _hoisted_11),
  3267. vue.createTextVNode("   "),
  3268. vue.createElementVNode("a", {
  3269. href: "javascript:",
  3270. onclick: `downVoteTopic(${$options.post.id});`,
  3271. class: "vote"
  3272. }, _hoisted_15, 8, _hoisted_13)
  3273. ], 8, _hoisted_10)) : vue.createCommentVNode("", true),
  3274. vue.createTextVNode("   "),
  3275. vue.createElementVNode("small", _hoisted_16, [
  3276. vue.createElementVNode("a", {
  3277. href: `/member/${$options.post.member.username}`
  3278. }, vue.toDisplayString($options.post.member.username), 9, _hoisted_17),
  3279. vue.createTextVNode(" · "),
  3280. $options.post.member.createDate ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  3281. vue.createElementVNode("span", {
  3282. class: vue.normalizeClass($options.post.member.isNew && "danger")
  3283. }, vue.toDisplayString($options.post.member.createDate), 3),
  3284. vue.createTextVNode(" · ")
  3285. ], 64)) : vue.createCommentVNode("", true),
  3286. $options.post.createDateAgo ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  3287. vue.createElementVNode("span", {
  3288. title: $options.post.createDate
  3289. }, vue.toDisplayString($options.post.createDateAgo), 9, _hoisted_18),
  3290. vue.createTextVNode(" · ")
  3291. ], 64)) : vue.createCommentVNode("", true),
  3292. vue.createTextVNode(" " + vue.toDisplayString($options.post.clickCount) + " 次点击 ", 1),
  3293. $options.isMy ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  3294. vue.createTextVNode("   "),
  3295. vue.createElementVNode("a", {
  3296. href: `/t/${$options.post.id}/info`
  3297. }, _hoisted_21, 8, _hoisted_19),
  3298. vue.createTextVNode("   "),
  3299. vue.createElementVNode("a", {
  3300. href: `/append/topic/${$options.post.id}`,
  3301. class: "op"
  3302. }, "APPEND", 8, _hoisted_22)
  3303. ], 64)) : vue.createCommentVNode("", true)
  3304. ]),
  3305. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  3306. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  3307. return vue.openBlock(), vue.createElementBlock("span", _hoisted_23, [
  3308. _hoisted_24,
  3309. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  3310. vue.createElementVNode("i", {
  3311. class: "fa fa-trash-o remove",
  3312. onClick: ($event) => $options.removeTag(i)
  3313. }, null, 8, _hoisted_25)
  3314. ]);
  3315. }), 256)),
  3316. vue.createElementVNode("span", {
  3317. class: "add-tag ago",
  3318. onClick: _cache[0] || (_cache[0] = (...args) => $options.addTag && $options.addTag(...args)),
  3319. title: "添加标签"
  3320. }, "+")
  3321. ], 64)) : vue.createCommentVNode("", true)
  3322. ]),
  3323. vue.createVNode(_component_BaseHtmlRender, {
  3324. html: $options.post.headerTemplate
  3325. }, null, 8, ["html"]),
  3326. vue.createVNode(_component_Toolbar, {
  3327. onReply: _cache[1] || (_cache[1] = ($event) => $data.isSticky = !$data.isSticky)
  3328. }, {
  3329. default: vue.withCtx(() => [
  3330. vue.createVNode(_component_Point, {
  3331. onAddThank: $options.addThank,
  3332. onRecallThank: $options.recallThank,
  3333. full: false,
  3334. item: {
  3335. isThanked: $options.post.isThanked,
  3336. thankCount: $options.post.thankCount,
  3337. username: $options.post.username
  3338. },
  3339. "api-url": "topic/" + $options.post.id
  3340. }, null, 8, ["onAddThank", "onRecallThank", "item", "api-url"])
  3341. ]),
  3342. _: 1
  3343. })
  3344. ]),
  3345. $options.topReply.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_26, [
  3346. vue.createElementVNode("div", _hoisted_27, [
  3347. _hoisted_28,
  3348. vue.createElementVNode("div", _hoisted_29, [
  3349. vue.createVNode(_component_Tooltip, { title: "收起高赞回复" }, {
  3350. default: vue.withCtx(() => [
  3351. vue.createElementVNode("i", {
  3352. class: "fa fa-compress",
  3353. onClick: _cache[2] || (_cache[2] = (...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args))
  3354. })
  3355. ]),
  3356. _: 1
  3357. })
  3358. ])
  3359. ]),
  3360. vue.createElementVNode("div", _hoisted_30, [
  3361. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.topReply, (item, index) => {
  3362. return vue.openBlock(), vue.createBlock(_component_Comment, {
  3363. key: item.floor,
  3364. type: "top",
  3365. modelValue: $options.topReply[index],
  3366. "onUpdate:modelValue": ($event) => $options.topReply[index] = $event
  3367. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  3368. }), 128))
  3369. ], 512)
  3370. ])) : vue.createCommentVNode("", true),
  3371. $options.isMobile ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_31, [
  3372. vue.createElementVNode("div", {
  3373. class: "inner",
  3374. innerHTML: $options.post.fr
  3375. }, null, 8, _hoisted_32)
  3376. ])) : vue.createCommentVNode("", true),
  3377. vue.createElementVNode("div", _hoisted_33, [
  3378. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  3379. $options.config.showToolbar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [
  3380. vue.createElementVNode("div", _hoisted_35, [
  3381. vue.createVNode(_component_Tooltip, { title: "不隐藏@用户" }, {
  3382. default: vue.withCtx(() => [
  3383. vue.createElementVNode("div", {
  3384. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.FloorInFloor ? "active" : ""]),
  3385. onClick: _cache[3] || (_cache[3] = ($event) => $options.changeOption($options.CommentDisplayType.FloorInFloor))
  3386. }, "楼中楼(@) ", 2)
  3387. ]),
  3388. _: 1
  3389. }),
  3390. vue.createVNode(_component_Tooltip, { title: "隐藏第一个@用户,双击内容可显示原文" }, {
  3391. default: vue.withCtx(() => [
  3392. vue.createElementVNode("div", {
  3393. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.FloorInFloorNoCallUser ? "active" : ""]),
  3394. onClick: _cache[4] || (_cache[4] = ($event) => $options.changeOption($options.CommentDisplayType.FloorInFloorNoCallUser))
  3395. }, "楼中楼 ", 2)
  3396. ]),
  3397. _: 1
  3398. }),
  3399. vue.createVNode(_component_Tooltip, { title: "重复显示楼中楼的回复" }, {
  3400. default: vue.withCtx(() => [
  3401. vue.createElementVNode("div", {
  3402. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.FloorInFloorNested ? "active" : ""]),
  3403. onClick: _cache[5] || (_cache[5] = ($event) => $options.changeOption($options.CommentDisplayType.FloorInFloorNested))
  3404. }, "冗余楼中楼 ", 2)
  3405. ]),
  3406. _: 1
  3407. }),
  3408. vue.createElementVNode("div", {
  3409. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.Like ? "active" : ""]),
  3410. onClick: _cache[6] || (_cache[6] = ($event) => $options.changeOption($options.CommentDisplayType.Like))
  3411. }, "感谢 ", 2),
  3412. vue.createElementVNode("div", {
  3413. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.OnlyOp ? "active" : ""]),
  3414. onClick: _cache[7] || (_cache[7] = ($event) => $options.changeOption($options.CommentDisplayType.OnlyOp))
  3415. }, "只看楼主 ", 2),
  3416. vue.createElementVNode("div", {
  3417. class: vue.normalizeClass(["radio", $props.displayType === $options.CommentDisplayType.V2exOrigin ? "active" : ""]),
  3418. onClick: _cache[8] || (_cache[8] = ($event) => $options.changeOption($options.CommentDisplayType.V2exOrigin))
  3419. }, "V2原版 ", 2)
  3420. ])
  3421. ])) : vue.createCommentVNode("", true),
  3422. vue.createElementVNode("div", _hoisted_36, [
  3423. vue.createElementVNode("span", null, [
  3424. vue.createTextVNode(vue.toDisplayString($options.post.replyCount) + " 条回复 ", 1),
  3425. $options.post.createDate ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_37, [
  3426. vue.createTextVNode("  "),
  3427. _hoisted_38,
  3428. vue.createTextVNode("  " + vue.toDisplayString($options.post.createDate), 1)
  3429. ])) : vue.createCommentVNode("", true)
  3430. ]),
  3431. !$options.isMobile ? (vue.openBlock(), vue.createElementBlock("div", {
  3432. key: 0,
  3433. class: "fr",
  3434. innerHTML: $options.post.fr
  3435. }, null, 8, _hoisted_39)) : vue.createCommentVNode("", true)
  3436. ])
  3437. ], 64)) : vue.createCommentVNode("", true),
  3438. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  3439. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, [
  3440. vue.createVNode(_component_BaseLoading, { size: "large" })
  3441. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_41, [
  3442. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index) => {
  3443. return vue.openBlock(), vue.createBlock(_component_Comment, {
  3444. key: item.floor,
  3445. modelValue: $options.replyList[index],
  3446. "onUpdate:modelValue": ($event) => $options.replyList[index] = $event
  3447. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  3448. }), 128)) : vue.createCommentVNode("", true)
  3449. ]))
  3450. ], 64)) : vue.createCommentVNode("", true)
  3451. ]),
  3452. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42, "目前尚无回复")) : vue.createCommentVNode("", true),
  3453. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  3454. key: 3,
  3455. class: vue.normalizeClass(["my-box", { "sticky": $data.isSticky }]),
  3456. ref: "replyBox"
  3457. }, [
  3458. vue.createElementVNode("div", _hoisted_43, [
  3459. _hoisted_44,
  3460. vue.createElementVNode("div", _hoisted_45, [
  3461. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  3462. key: 0,
  3463. style: { "margin-right": "2rem" },
  3464. onClick: _cache[9] || (_cache[9] = ($event) => $data.isSticky = false)
  3465. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  3466. vue.createElementVNode("a", {
  3467. onClick: _cache[10] || (_cache[10] = (...args) => $options.scrollTop && $options.scrollTop(...args))
  3468. }, "回到顶部")
  3469. ])
  3470. ]),
  3471. vue.createElementVNode("div", _hoisted_46, [
  3472. vue.createVNode(_component_PostEditor, {
  3473. onClose: $options.goBottom,
  3474. ref: "post-editor",
  3475. useType: "reply-post",
  3476. onClick: _cache[11] || (_cache[11] = ($event) => $data.isSticky = true)
  3477. }, null, 8, ["onClose"])
  3478. ])
  3479. ], 2)) : vue.createCommentVNode("", true)
  3480. ], 4),
  3481. $data.showRelationReply ? (vue.openBlock(), vue.createElementBlock("div", {
  3482. key: 0,
  3483. class: "relationReply",
  3484. onClick: _cache[15] || (_cache[15] = ($event) => $options.close("space"))
  3485. }, [
  3486. vue.createElementVNode("div", {
  3487. class: "my-cell flex",
  3488. onClick: _cache[13] || (_cache[13] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3489. }, [
  3490. _hoisted_47,
  3491. vue.createElementVNode("div", _hoisted_48, [
  3492. vue.createElementVNode("i", {
  3493. class: "fa fa-times",
  3494. onClick: _cache[12] || (_cache[12] = ($event) => $data.showRelationReply = false)
  3495. })
  3496. ])
  3497. ]),
  3498. vue.createElementVNode("div", {
  3499. class: "comments",
  3500. onClick: _cache[14] || (_cache[14] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  3501. }, [
  3502. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.relationReply, (item, index) => {
  3503. return vue.openBlock(), vue.createBlock(_component_SingleComment, {
  3504. "is-right": item.username === $data.targetUser.right,
  3505. key: item.floor,
  3506. comment: item
  3507. }, null, 8, ["is-right", "comment"]);
  3508. }), 128))
  3509. ])
  3510. ])) : vue.createCommentVNode("", true),
  3511. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  3512. key: 1,
  3513. class: "call-list",
  3514. style: vue.normalizeStyle($data.callStyle)
  3515. }, [
  3516. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList, (item, index) => {
  3517. return vue.openBlock(), vue.createElementBlock("div", {
  3518. class: vue.normalizeClass(["call-item", { select: index === $data.selectCallIndex }]),
  3519. onClick: ($event) => $options.setCall(item)
  3520. }, [
  3521. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  3522. ], 10, _hoisted_49);
  3523. }), 256))
  3524. ], 4)) : vue.createCommentVNode("", true),
  3525. vue.createElementVNode("div", {
  3526. class: "close-btn",
  3527. onClick: _cache[16] || (_cache[16] = ($event) => $options.close("btn"))
  3528. }, _hoisted_51),
  3529. vue.createElementVNode("div", {
  3530. class: "scroll-top gray",
  3531. onClick: _cache[17] || (_cache[17] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  3532. }, _hoisted_53),
  3533. vue.createElementVNode("div", {
  3534. class: "refresh gray",
  3535. onClick: _cache[18] || (_cache[18] = vue.withModifiers(($event) => _ctx.$emit("refresh"), ["stop"]))
  3536. }, [
  3537. $props.refreshLoading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createElementBlock("i", _hoisted_54))
  3538. ]),
  3539. vue.createElementVNode("div", {
  3540. class: "scroll-to gray",
  3541. onClick: _cache[22] || (_cache[22] = vue.withModifiers(($event) => $options.jump($data.currentFloor), ["stop"]))
  3542. }, [
  3543. _hoisted_55,
  3544. vue.withDirectives(vue.createElementVNode("input", {
  3545. type: "text",
  3546. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.currentFloor = $event),
  3547. onClick: _cache[20] || (_cache[20] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"])),
  3548. onKeydown: _cache[21] || (_cache[21] = vue.withKeys(($event) => $options.jump($data.currentFloor), ["enter"]))
  3549. }, null, 544), [
  3550. [vue.vModelText, $data.currentFloor]
  3551. ])
  3552. ])
  3553. ], 512)
  3554. ], 34)), [
  3555. [vue.vShow, $props.modelValue]
  3556. ]);
  3557. }
  3558. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$2], ["__scopeId", "data-v-88f5644d"]]);
  3559. const _withScopeId$4 = (n2) => (vue.pushScopeId("data-v-618144eb"), n2 = n2(), vue.popScopeId(), n2);
  3560. const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  3561. width: "24",
  3562. height: "24",
  3563. viewBox: "0 0 48 48",
  3564. fill: "none",
  3565. xmlns: "http://www.w3.org/2000/svg"
  3566. }, [
  3567. /* @__PURE__ */ vue.createElementVNode("path", {
  3568. d: "M17 32L19.1875 27M31 32L28.8125 27M19.1875 27L24 16L28.8125 27M19.1875 27H28.8125",
  3569. stroke: "#929596",
  3570. "stroke-width": "4",
  3571. "stroke-linecap": "round",
  3572. "stroke-linejoin": "round"
  3573. }),
  3574. /* @__PURE__ */ vue.createElementVNode("path", {
  3575. d: "M43.1999 20C41.3468 10.871 33.2758 4 23.5999 4C13.9241 4 5.85308 10.871 4 20L10 18",
  3576. stroke: "#929596",
  3577. "stroke-width": "4",
  3578. "stroke-linecap": "round",
  3579. "stroke-linejoin": "round"
  3580. }),
  3581. /* @__PURE__ */ vue.createElementVNode("path", {
  3582. d: "M4 28C5.85308 37.129 13.9241 44 23.5999 44C33.2758 44 41.3468 37.129 43.1999 28L38 30",
  3583. stroke: "#929596",
  3584. "stroke-width": "4",
  3585. "stroke-linecap": "round",
  3586. "stroke-linejoin": "round"
  3587. })
  3588. ], -1));
  3589. const _hoisted_2$4 = { key: 1 };
  3590. const _sfc_main$5 = {
  3591. __name: "Base64Tooltip",
  3592. setup(__props) {
  3593. const tooltip = vue.ref(null);
  3594. const show = vue.ref(false);
  3595. const originalText = vue.ref("");
  3596. const decodeText = vue.ref("");
  3597. const styleObject = vue.reactive({
  3598. left: "-100vw",
  3599. top: "-100vh"
  3600. });
  3601. vue.onMounted(() => {
  3602. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e: e2 }) => {
  3603. setTimeout(() => show.value = true);
  3604. originalText.value = text;
  3605. decodeText.value = "";
  3606. styleObject.left = e2.clientX + "px";
  3607. styleObject.top = e2.clientY + 20 + "px";
  3608. });
  3609. window.addEventListener("click", (e2) => {
  3610. if (!tooltip.value)
  3611. return;
  3612. if (!tooltip.value.contains(e2.target) && show.value) {
  3613. show.value = false;
  3614. }
  3615. }, { capture: true });
  3616. const fn = () => show.value && (show.value = false);
  3617. $(".post-detail", window.win().doc).on("scroll", fn);
  3618. });
  3619. function copy() {
  3620. if (window.win().navigator.clipboard) {
  3621. window.win().navigator.clipboard.writeText(decodeText.value);
  3622. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  3623. } else {
  3624. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  3625. }
  3626. }
  3627. function base64ToArrayBuffer(base64) {
  3628. let binary_string = window.atob(base64);
  3629. let len = binary_string.length;
  3630. let bytes = new Uint8Array(len);
  3631. for (let i = 0; i < len; i++) {
  3632. bytes[i] = binary_string.charCodeAt(i);
  3633. }
  3634. return bytes.buffer;
  3635. }
  3636. function decode() {
  3637. try {
  3638. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r2) => {
  3639. decodeText.value = r2;
  3640. });
  3641. } catch (e2) {
  3642. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  3643. }
  3644. }
  3645. return (_ctx, _cache) => {
  3646. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  3647. class: "base64_tooltip",
  3648. style: vue.normalizeStyle(styleObject),
  3649. onClick: decode,
  3650. ref_key: "tooltip",
  3651. ref: tooltip
  3652. }, [
  3653. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  3654. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  3655. _hoisted_1$5
  3656. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [
  3657. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  3658. vue.createVNode(BaseButton, {
  3659. class: "btn",
  3660. size: "small",
  3661. onClick: copy
  3662. }, {
  3663. default: vue.withCtx(() => [
  3664. vue.createTextVNode("点击复制")
  3665. ]),
  3666. _: 1
  3667. })
  3668. ]))
  3669. ], 4)), [
  3670. [vue.vShow, show.value]
  3671. ]);
  3672. };
  3673. }
  3674. };
  3675. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-618144eb"]]);
  3676. const _sfc_main$4 = {
  3677. name: "Msg",
  3678. props: {
  3679. type: "",
  3680. text: ""
  3681. },
  3682. created() {
  3683. setTimeout(() => {
  3684. this.$emit("close");
  3685. }, 3e3);
  3686. }
  3687. };
  3688. const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-defce7f2"), n2 = n2(), vue.popScopeId(), n2);
  3689. const _hoisted_1$4 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  3690. width: "24",
  3691. height: "24",
  3692. viewBox: "0 0 48 48",
  3693. fill: "none",
  3694. xmlns: "http://www.w3.org/2000/svg"
  3695. }, [
  3696. /* @__PURE__ */ vue.createElementVNode("path", {
  3697. d: "M14 14L34 34",
  3698. stroke: "#ffffff",
  3699. "stroke-width": "4",
  3700. "stroke-linecap": "round",
  3701. "stroke-linejoin": "round"
  3702. }),
  3703. /* @__PURE__ */ vue.createElementVNode("path", {
  3704. d: "M14 34L34 14",
  3705. stroke: "#ffffff",
  3706. "stroke-width": "4",
  3707. "stroke-linecap": "round",
  3708. "stroke-linejoin": "round"
  3709. })
  3710. ], -1));
  3711. const _hoisted_2$3 = [
  3712. _hoisted_1$4
  3713. ];
  3714. const _hoisted_3$3 = { class: "right" };
  3715. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  3716. return vue.openBlock(), vue.createElementBlock("div", {
  3717. class: vue.normalizeClass(["msg", $props.type])
  3718. }, [
  3719. vue.createElementVNode("div", {
  3720. class: "left",
  3721. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  3722. }, _hoisted_2$3),
  3723. vue.createElementVNode("div", _hoisted_3$3, vue.toDisplayString($props.text), 1)
  3724. ], 2);
  3725. }
  3726. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-defce7f2"]]);
  3727. const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-674b86aa"), n2 = n2(), vue.popScopeId(), n2);
  3728. const _hoisted_1$3 = {
  3729. key: 0,
  3730. class: "tag-modal modal"
  3731. };
  3732. const _hoisted_2$2 = { class: "wrapper" };
  3733. const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  3734. const _hoisted_4$2 = { class: "option" };
  3735. const _hoisted_5$1 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  3736. const _hoisted_6$1 = { class: "btns" };
  3737. const _sfc_main$3 = {
  3738. __name: "TagModal",
  3739. props: ["tags"],
  3740. emits: ["update:tags"],
  3741. setup(__props, { emit: __emit }) {
  3742. const tagModal = vue.reactive({
  3743. show: false,
  3744. currentUsername: "",
  3745. tag: ""
  3746. });
  3747. const props = __props;
  3748. const emit = __emit;
  3749. const inputRef = vue.ref();
  3750. vue.onMounted(() => {
  3751. eventBus.on(CMD.ADD_TAG, (username) => {
  3752. tagModal.currentUsername = username;
  3753. tagModal.show = true;
  3754. vue.nextTick(() => {
  3755. inputRef.value.focus();
  3756. });
  3757. });
  3758. });
  3759. async function addTag() {
  3760. if (!tagModal.tag) {
  3761. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请输入标签" });
  3762. return;
  3763. }
  3764. let oldTag = window.clone(props.tags);
  3765. let tempTag = window.clone(props.tags);
  3766. let userTags = tempTag[tagModal.currentUsername] ?? [];
  3767. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  3768. if (rIndex > -1) {
  3769. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  3770. return;
  3771. } else {
  3772. userTags.push(tagModal.tag);
  3773. }
  3774. tempTag[tagModal.currentUsername] = userTags;
  3775. emit("update:tags", tempTag);
  3776. tagModal.tag = "";
  3777. tagModal.show = false;
  3778. let res = await window.parse.saveTags(tempTag);
  3779. if (!res) {
  3780. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  3781. emit("update:tags", oldTag);
  3782. }
  3783. }
  3784. return (_ctx, _cache) => {
  3785. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3786. default: vue.withCtx(() => [
  3787. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  3788. vue.createElementVNode("div", {
  3789. class: "mask",
  3790. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  3791. }),
  3792. vue.createElementVNode("div", _hoisted_2$2, [
  3793. _hoisted_3$2,
  3794. vue.createElementVNode("div", _hoisted_4$2, [
  3795. _hoisted_5$1,
  3796. vue.createElementVNode("div", null, [
  3797. vue.createElementVNode("b", null, vue.toDisplayString(tagModal.currentUsername), 1)
  3798. ])
  3799. ]),
  3800. vue.withDirectives(vue.createElementVNode("input", {
  3801. type: "text",
  3802. ref_key: "inputRef",
  3803. ref: inputRef,
  3804. style: { "width": "100%" },
  3805. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  3806. onKeydown: vue.withKeys(addTag, ["enter"])
  3807. }, null, 544), [
  3808. [vue.vModelText, tagModal.tag]
  3809. ]),
  3810. vue.createElementVNode("div", _hoisted_6$1, [
  3811. vue.createVNode(BaseButton, {
  3812. type: "link",
  3813. onClick: _cache[2] || (_cache[2] = ($event) => tagModal.show = false)
  3814. }, {
  3815. default: vue.withCtx(() => [
  3816. vue.createTextVNode("取消")
  3817. ]),
  3818. _: 1
  3819. }),
  3820. vue.createVNode(BaseButton, { onClick: addTag }, {
  3821. default: vue.withCtx(() => [
  3822. vue.createTextVNode("确定")
  3823. ]),
  3824. _: 1
  3825. })
  3826. ])
  3827. ])
  3828. ])) : vue.createCommentVNode("", true)
  3829. ]),
  3830. _: 1
  3831. });
  3832. };
  3833. }
  3834. };
  3835. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-674b86aa"]]);
  3836. const _hoisted_1$2 = { class: "msgs" };
  3837. const _sfc_main$2 = {
  3838. __name: "MsgModal",
  3839. setup(__props) {
  3840. const msgList = vue.reactive([
  3841. // {type: 'success', text: '123', id: Date.now()}
  3842. ]);
  3843. vue.onMounted(() => {
  3844. eventBus.on(CMD.SHOW_MSG, (val) => {
  3845. msgList.push({ ...val, id: Date.now() });
  3846. });
  3847. });
  3848. function removeMsg(id) {
  3849. let rIndex = msgList.findIndex((item) => item.id === id);
  3850. if (rIndex > -1) {
  3851. msgList.splice(rIndex, 1);
  3852. }
  3853. }
  3854. return (_ctx, _cache) => {
  3855. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
  3856. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  3857. return vue.openBlock(), vue.createBlock(Msg, {
  3858. key: v.id,
  3859. type: v.type,
  3860. text: v.text,
  3861. onClose: ($event) => removeMsg(v.id)
  3862. }, null, 8, ["type", "text", "onClose"]);
  3863. }), 128))
  3864. ]);
  3865. };
  3866. }
  3867. };
  3868. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b73f4332"]]);
  3869. let u = ".__cf_email__", f = "data-cfemail", d = document.createElement("div");
  3870. function e(e2) {
  3871. console.error(e2);
  3872. }
  3873. function r(e2, t) {
  3874. let r2 = e2.substr(t, 2);
  3875. return parseInt(r2, 16);
  3876. }
  3877. function n(href, index) {
  3878. let o = "", a = r(href, index);
  3879. for (let i = index + 2; i < href.length; i += 2) {
  3880. let l = r(href, i) ^ a;
  3881. o += String.fromCharCode(l);
  3882. }
  3883. try {
  3884. o = decodeURIComponent(escape(o));
  3885. } catch (u2) {
  3886. e(u2);
  3887. }
  3888. d.innerHTML = '<a href="' + o.replace(/"/g, "&quot;") + '"></a>';
  3889. return d.childNodes[0].getAttribute("href") || "";
  3890. }
  3891. function decodeEmail(body) {
  3892. try {
  3893. let as = body.find(u);
  3894. as.each(function() {
  3895. try {
  3896. let o = this, a = o.parentNode, i = o.getAttribute(f);
  3897. if (i) {
  3898. let l = n(i, 0), d2 = document.createTextNode(l);
  3899. a.replaceChild(d2, o);
  3900. }
  3901. } catch (h) {
  3902. e(h);
  3903. }
  3904. });
  3905. } catch (s) {
  3906. e(s);
  3907. }
  3908. }
  3909. const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-882b932b"), n2 = n2(), vue.popScopeId(), n2);
  3910. const _hoisted_1$1 = {
  3911. key: 0,
  3912. class: "tag-modal modal"
  3913. };
  3914. const _hoisted_2$1 = { class: "modal-root" };
  3915. const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 提醒系统 ", -1));
  3916. const _hoisted_4$1 = ["innerHTML"];
  3917. const _sfc_main$1 = {
  3918. __name: "NotificationModal",
  3919. props: ["modelValue", "h"],
  3920. emits: ["update:modelValue"],
  3921. setup(__props, { emit: __emit }) {
  3922. const emit = __emit;
  3923. vue.onMounted(() => {
  3924. });
  3925. function close() {
  3926. emit("update:modelValue", false);
  3927. }
  3928. return (_ctx, _cache) => {
  3929. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3930. default: vue.withCtx(() => [
  3931. __props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  3932. vue.createElementVNode("div", {
  3933. class: "mask",
  3934. onClick: vue.withModifiers(close, ["stop"])
  3935. }),
  3936. vue.createElementVNode("div", _hoisted_2$1, [
  3937. vue.createElementVNode("div", { class: "modal-header" }, [
  3938. _hoisted_3$1,
  3939. vue.createElementVNode("i", {
  3940. class: "fa fa-times",
  3941. onClick: close
  3942. })
  3943. ]),
  3944. vue.createElementVNode("div", {
  3945. innerHTML: __props.h,
  3946. class: "modal-body"
  3947. }, null, 8, _hoisted_4$1)
  3948. ])
  3949. ])) : vue.createCommentVNode("", true)
  3950. ]),
  3951. _: 1
  3952. });
  3953. };
  3954. }
  3955. };
  3956. const NotificationModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-882b932b"]]);
  3957. var _GM_notification = /* @__PURE__ */ (() => typeof GM_notification != "undefined" ? GM_notification : void 0)();
  3958. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  3959. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  3960. const DefaultPost = {
  3961. allReplyUsers: [],
  3962. content_rendered: "",
  3963. createDate: "",
  3964. createDateAgo: "",
  3965. fr: "",
  3966. replyList: [],
  3967. nestedReplies: [],
  3968. nestedRedundReplies: [],
  3969. username: "",
  3970. url: "",
  3971. member: {},
  3972. node: {
  3973. title: "",
  3974. url: ""
  3975. },
  3976. headerTemplate: "",
  3977. title: "",
  3978. id: "",
  3979. type: "post",
  3980. once: "",
  3981. replyCount: 0,
  3982. clickCount: 0,
  3983. thankCount: 0,
  3984. collectCount: 0,
  3985. lastReadFloor: 0,
  3986. isFavorite: false,
  3987. isIgnore: false,
  3988. isThanked: false,
  3989. isReport: false,
  3990. inList: false
  3991. };
  3992. const DefaultUser = {
  3993. tagPrefix: "--用户标签--",
  3994. tags: {},
  3995. tagsId: "",
  3996. username: "",
  3997. avatar: "",
  3998. readPrefix: "--已读楼层--",
  3999. readNoteItemId: "",
  4000. readList: {},
  4001. imgurPrefix: "--imgur图片删除hash--",
  4002. imgurList: {},
  4003. imgurNoteId: ""
  4004. };
  4005. const DefaultConfig = {
  4006. showToolbar: true,
  4007. showPreviewBtn: true,
  4008. autoOpenDetail: true,
  4009. openTag: false,
  4010. //给用户打标签
  4011. clickPostItemOpenDetail: true,
  4012. closePostDetailBySpace: true,
  4013. //点击空白处关闭详情
  4014. contentAutoCollapse: true,
  4015. //正文超长自动折叠
  4016. viewType: "table",
  4017. commentDisplayType: CommentDisplayType.FloorInFloorNoCallUser,
  4018. newTabOpen: false,
  4019. //新标签打开
  4020. base64: true,
  4021. //base功能
  4022. sov2ex: false,
  4023. postWidth: "",
  4024. showTopReply: true,
  4025. topReplyLoveMinCount: 3,
  4026. topReplyCount: 3,
  4027. autoJumpLastReadFloor: false,
  4028. rememberLastReadFloor: false,
  4029. autoSignin: true,
  4030. customBgColor: "",
  4031. version: 1,
  4032. collectBrowserNotice: false,
  4033. fontSizeType: "normal"
  4034. };
  4035. const DefaultVal = {
  4036. pageType: void 0,
  4037. pageData: { pageNo: 1 },
  4038. targetUserName: "",
  4039. currentVersion: 1,
  4040. isNight: false,
  4041. cb: null,
  4042. stopMe: null,
  4043. postList: [],
  4044. git: "https://github.com/zyronon/web-scripts",
  4045. shortGit: "zyronon/web-scripts",
  4046. issue: "https://github.com/zyronon/web-scripts/issues"
  4047. };
  4048. const functions = {
  4049. //获取所有回复
  4050. getAllReply(repliesMap = []) {
  4051. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  4052. pre = pre.concat(i.replyList);
  4053. return pre;
  4054. }, []);
  4055. },
  4056. //查找子回复
  4057. findChildren(item, endList, all) {
  4058. var _a;
  4059. const fn = (child, endList2, parent) => {
  4060. child.level = parent.level + 1;
  4061. let rIndex = all.findIndex((v) => v.floor === child.floor);
  4062. if (rIndex > -1) {
  4063. all[rIndex].isUse = true;
  4064. }
  4065. parent.children.push(this.findChildren(child, endList2, all));
  4066. };
  4067. item.children = [];
  4068. let floorReplyList = [];
  4069. for (let i = 0; i < endList.length; i++) {
  4070. let currentItem = endList[i];
  4071. if (currentItem.isUse)
  4072. continue;
  4073. if (currentItem.replyFloor === item.floor) {
  4074. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  4075. currentItem.isUse = true;
  4076. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  4077. } else {
  4078. currentItem.isWrong = true;
  4079. }
  4080. }
  4081. }
  4082. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  4083. fn(currentItem, endList2, item);
  4084. });
  4085. let nextMeIndex = endList.findIndex((v) => {
  4086. var _a2;
  4087. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  4088. });
  4089. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  4090. for (let i = 0; i < findList.length; i++) {
  4091. let currentItem = findList[i];
  4092. if (currentItem.isUse)
  4093. continue;
  4094. if (currentItem.replyUsers.length === 1) {
  4095. if (currentItem.replyFloor !== -1) {
  4096. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  4097. continue;
  4098. }
  4099. }
  4100. let endList2 = endList.slice(i + 1);
  4101. if (currentItem.username === item.username) {
  4102. if (currentItem.replyUsers[0] === item.username) {
  4103. fn(currentItem, endList2, item);
  4104. }
  4105. break;
  4106. } else {
  4107. if (currentItem.replyUsers[0] === item.username) {
  4108. fn(currentItem, endList2, item);
  4109. }
  4110. }
  4111. } else {
  4112. if (currentItem.username === item.username)
  4113. break;
  4114. }
  4115. }
  4116. item.children = item.children.sort((a, b) => a.floor - b.floor);
  4117. return item;
  4118. },
  4119. //生成嵌套回复
  4120. createNestedList(allList = []) {
  4121. if (!allList.length)
  4122. return [];
  4123. let list = window.clone(allList);
  4124. let nestedList = [];
  4125. list.map((item, index) => {
  4126. let startList = list.slice(0, index);
  4127. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  4128. let endList = list.slice(index + 1);
  4129. if (index === 0) {
  4130. nestedList.push(this.findChildren(item, endList, list));
  4131. } else {
  4132. if (!item.isUse) {
  4133. let isOneLevelReply = false;
  4134. if (item.replyUsers.length) {
  4135. if (item.replyUsers.length > 1) {
  4136. isOneLevelReply = true;
  4137. } else {
  4138. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  4139. }
  4140. } else {
  4141. isOneLevelReply = true;
  4142. }
  4143. if (isOneLevelReply) {
  4144. item.level = 0;
  4145. nestedList.push(this.findChildren(item, endList, list));
  4146. }
  4147. }
  4148. }
  4149. });
  4150. return nestedList;
  4151. },
  4152. //生成嵌套冗余回复
  4153. createNestedRedundantList(allList = []) {
  4154. if (!allList.length)
  4155. return [];
  4156. let list = window.clone(allList);
  4157. let nestedList = [];
  4158. list.map((item, index) => {
  4159. let startList = list.slice(0, index);
  4160. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  4161. let endList = list.slice(index + 1);
  4162. if (index === 0) {
  4163. nestedList.push(this.findChildren(item, endList, list));
  4164. } else {
  4165. if (!item.isUse) {
  4166. let isOneLevelReply = false;
  4167. if (item.replyUsers.length) {
  4168. if (item.replyUsers.length > 1) {
  4169. isOneLevelReply = true;
  4170. } else {
  4171. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  4172. }
  4173. } else {
  4174. isOneLevelReply = true;
  4175. }
  4176. if (isOneLevelReply) {
  4177. item.level = 0;
  4178. nestedList.push(this.findChildren(item, endList, list));
  4179. }
  4180. } else {
  4181. let newItem = window.clone(item);
  4182. newItem.children = [];
  4183. newItem.level = 0;
  4184. newItem.isDup = true;
  4185. nestedList.push(newItem);
  4186. }
  4187. }
  4188. });
  4189. return nestedList;
  4190. },
  4191. //解析A标签
  4192. parseA(a) {
  4193. let href = a.href;
  4194. let id;
  4195. if (href.includes("/t/")) {
  4196. id = a.pathname.substring("/t/".length);
  4197. }
  4198. return { href, id, title: a.innerText };
  4199. },
  4200. //图片链接转Img标签
  4201. checkPhotoLink2Img(str) {
  4202. if (!str)
  4203. return;
  4204. try {
  4205. let imgWebs = [
  4206. /<a((?!<a).)*href="https?:\/\/((?!<a).)*imgur.com((?!<a).)*>(((?!<a).)*)<\/a>/g,
  4207. /<a((?!<a).)*href="https?:\/\/((?!<a).)*\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG) ((?!<a).)*>(((?!<a).)*)<\/a>/g
  4208. ];
  4209. imgWebs.map((v, i) => {
  4210. let has = str.matchAll(v);
  4211. let res2 = [...has];
  4212. res2.map((r2) => {
  4213. let p = i === 0 ? r2[4] : r2[5];
  4214. if (p) {
  4215. let link = p.toLowerCase();
  4216. let src = p;
  4217. if (link.includes(".png") || link.includes(".jpg") || link.includes(".jpeg") || link.includes(".gif")) {
  4218. } else {
  4219. src = p + ".png";
  4220. }
  4221. str = str.replace(r2[0], `<img src="${src}" data-originUrl="${p}" data-notice="此img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`);
  4222. }
  4223. });
  4224. });
  4225. } catch (e2) {
  4226. console.log("正则解析html里面的a标签的图片链接出错了");
  4227. }
  4228. return str;
  4229. },
  4230. //检测帖子回复长度
  4231. async checkPostReplies(id, needOpen = true) {
  4232. return new Promise(async (resolve) => {
  4233. var _a;
  4234. let showJsonUrl = `${location.origin}/api/topics/show.json?id=${id}`;
  4235. let r2 = await fetch(showJsonUrl);
  4236. if (r2) {
  4237. let res = await r2.json();
  4238. if (res) {
  4239. if (((_a = res[0]) == null ? void 0 : _a.replies) > MAX_REPLY_LIMIT) {
  4240. if (needOpen) {
  4241. window.parse.openNewTab(`https://www.v2ex.com/t/${id}?p=1&script=1`);
  4242. }
  4243. return resolve(true);
  4244. }
  4245. }
  4246. }
  4247. resolve(false);
  4248. });
  4249. },
  4250. async sleep(time) {
  4251. return new Promise((resolve) => {
  4252. setTimeout(resolve, time);
  4253. });
  4254. },
  4255. //打开新标签页
  4256. openNewTab(href) {
  4257. _GM_openInTab(href, { active: false });
  4258. },
  4259. async cbChecker(val, count = 0) {
  4260. if (window.cb) {
  4261. window.cb(val);
  4262. } else {
  4263. while (!window.cb && count < 30) {
  4264. await functions.sleep(500);
  4265. count++;
  4266. }
  4267. window.cb && window.cb(val);
  4268. }
  4269. },
  4270. //初始化脚本菜单
  4271. initMonkeyMenu() {
  4272. try {
  4273. _GM_registerMenuCommand("脚本设置", () => {
  4274. functions.cbChecker({ type: "openSetting" });
  4275. });
  4276. _GM_registerMenuCommand("仓库地址", () => {
  4277. functions.openNewTab(window.const.git);
  4278. });
  4279. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  4280. } catch (e2) {
  4281. console.error("无法使用Tampermonkey");
  4282. }
  4283. },
  4284. clone(val) {
  4285. return JSON.parse(JSON.stringify(val));
  4286. },
  4287. feedback() {
  4288. functions.openNewTab(DefaultVal.issue);
  4289. }
  4290. };
  4291. const _sfc_main = {
  4292. components: {
  4293. BaseButton,
  4294. NotificationModal,
  4295. BaseLoading,
  4296. BaseSwitch,
  4297. MsgModal,
  4298. TagModal,
  4299. Tooltip,
  4300. Setting,
  4301. PostDetail,
  4302. Base64Tooltip,
  4303. Msg
  4304. },
  4305. provide() {
  4306. return {
  4307. isMobile: vue.computed(() => window.vals.isMobile),
  4308. isLogin: vue.computed(() => this.isLogin),
  4309. isNight: vue.computed(() => this.isNight),
  4310. pageType: vue.computed(() => this.pageType),
  4311. tags: vue.computed(() => this.tags),
  4312. show: vue.computed(() => this.show),
  4313. post: vue.computed(() => this.current),
  4314. config: vue.computed(() => this.config),
  4315. allReplyUsers: vue.computed(() => {
  4316. var _a, _b, _c;
  4317. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  4318. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  4319. }
  4320. return [];
  4321. }),
  4322. showConfig: this.showConfig
  4323. };
  4324. },
  4325. data() {
  4326. return {
  4327. loading: window.pageType === PageType.Post,
  4328. refreshLoading: false,
  4329. loadMore: false,
  4330. isLogin: !!window.user.username,
  4331. pageType: window.pageType,
  4332. isNight: window.isNight,
  4333. stopMe: window.stopMe,
  4334. //停止使用脚本
  4335. show: false,
  4336. current: window.clone(window.initPost),
  4337. list: [],
  4338. config: window.clone(window.config),
  4339. tags: window.user.tags,
  4340. configModal: {
  4341. show: false
  4342. },
  4343. notificationModal: {
  4344. show: false,
  4345. h: ""
  4346. }
  4347. };
  4348. },
  4349. computed: {
  4350. targetUserTags() {
  4351. return this.tags[window.targetUserName] ?? [];
  4352. },
  4353. isList() {
  4354. return [PageType.Home, PageType.Node].includes(this.pageType);
  4355. },
  4356. isPost() {
  4357. return this.pageType === PageType.Post;
  4358. },
  4359. isMember() {
  4360. return this.pageType === PageType.Member;
  4361. }
  4362. },
  4363. watch: {
  4364. config: {
  4365. handler(newVal) {
  4366. let config2 = { [window.user.username ?? "default"]: newVal };
  4367. localStorage.setItem("v2ex-config", JSON.stringify(config2));
  4368. window.config = newVal;
  4369. },
  4370. deep: true
  4371. },
  4372. tags(newVal) {
  4373. window.user.tags = newVal;
  4374. },
  4375. "config.viewType"(newVal) {
  4376. if (!newVal)
  4377. return;
  4378. if (newVal === "card") {
  4379. $(".post-item").each(function() {
  4380. $(this).addClass("preview");
  4381. });
  4382. } else {
  4383. $(".post-item").each(function() {
  4384. $(this).removeClass("preview");
  4385. });
  4386. }
  4387. }
  4388. },
  4389. created() {
  4390. let that = this;
  4391. this.initEvent();
  4392. window.cb = this.winCb;
  4393. if (!window.canParseV2exPage)
  4394. return;
  4395. $(document).on("click", "a", this.clickA);
  4396. $(document).on("click", ".post-item", function(e2) {
  4397. if (e2.currentTarget.getAttribute("script"))
  4398. return;
  4399. if (that.stopMe)
  4400. return true;
  4401. if (this.classList.contains("preview")) {
  4402. if (e2.target.tagName !== "A" && e2.target.tagName !== "IMG" && !e2.target.classList.contains("toggle")) {
  4403. console.log("点空白处", this);
  4404. let id = this.dataset["id"];
  4405. let href = this.dataset["href"];
  4406. if (id) {
  4407. that.clickPost(e2, id, href);
  4408. } else {
  4409. if (href)
  4410. location.href = href;
  4411. }
  4412. }
  4413. }
  4414. });
  4415. $(document).on("click", ".toggle", (e2) => {
  4416. if (this.stopMe)
  4417. return true;
  4418. let id = e2.currentTarget.dataset["id"];
  4419. let itemDom = window.win().query(`.id_${id}`);
  4420. if (itemDom.classList.contains("preview")) {
  4421. itemDom.classList.remove("preview");
  4422. } else {
  4423. itemDom.classList.add("preview");
  4424. }
  4425. });
  4426. window.onpopstate = (event) => {
  4427. if (event.state) {
  4428. if (!this.show)
  4429. this.show = true;
  4430. } else {
  4431. if (this.show)
  4432. this.show = false;
  4433. }
  4434. };
  4435. window.deleteNotification = (nId, token) => {
  4436. console.log("deleteNotification", nId, token);
  4437. let item = $("#n_" + nId);
  4438. item.slideUp("fast");
  4439. $.post({
  4440. url: "/delete/notification/" + nId + "?once=" + token,
  4441. success() {
  4442. $.get({
  4443. url: "/notifications/below/" + window.notificationBottom,
  4444. success(data, status, request) {
  4445. item.remove();
  4446. $("#notifications").append(data);
  4447. window.notificationBottom = request.getResponseHeader("X-V2EX-New-Notification-Bottom");
  4448. },
  4449. error() {
  4450. item.slideDown("fast");
  4451. }
  4452. });
  4453. },
  4454. error() {
  4455. item.slideDown("fast");
  4456. }
  4457. });
  4458. };
  4459. },
  4460. beforeUnmount() {
  4461. eventBus.clear();
  4462. $(document).off("click", "a", this.clickA);
  4463. },
  4464. methods: {
  4465. async getUnreadMessagesCount() {
  4466. var _a, _b;
  4467. const res = await fetch(`${location.origin}/mission`);
  4468. const htmlText = await res.text();
  4469. const $page = $(htmlText);
  4470. const text = $page.find('#Rightbar a[href^="/notifications"]').text();
  4471. if (text.includes("未读提醒")) {
  4472. const countStr = (_a = text.match(/\d+/)) == null ? void 0 : _a.at(0);
  4473. if (countStr) {
  4474. return Number((_b = text.match(/\d+/)) == null ? void 0 : _b.at(0));
  4475. }
  4476. } else {
  4477. return 0;
  4478. }
  4479. throw new Error("无法获取未读消息数量");
  4480. },
  4481. clickA(e2) {
  4482. let that = this;
  4483. if (e2.currentTarget.getAttribute("script"))
  4484. return;
  4485. if (that.stopMe)
  4486. return true;
  4487. let { href, id, title } = window.parse.parseA(e2.currentTarget);
  4488. if (href.includes("/settings/night/toggle"))
  4489. return;
  4490. if (href.includes("/?tab="))
  4491. return;
  4492. if (href.includes("/go"))
  4493. return;
  4494. if (href === window.origin + "/#;")
  4495. return;
  4496. if (href === window.origin + "/")
  4497. return;
  4498. if (href.includes("/notifications"))
  4499. ;
  4500. if (id) {
  4501. that.clickPost(e2, id, href, title);
  4502. } else {
  4503. if (that.config.newTabOpen) {
  4504. that.stopEvent(e2);
  4505. functions.openNewTab(href);
  4506. }
  4507. }
  4508. },
  4509. stopEvent(e2) {
  4510. e2.preventDefault();
  4511. e2.stopPropagation();
  4512. },
  4513. async clickPost(e2, id, href, title = "") {
  4514. if (id) {
  4515. if (this.config.clickPostItemOpenDetail) {
  4516. this.stopEvent(e2);
  4517. let index = this.list.findIndex((v) => v.id == id);
  4518. let postItem = this.clone(window.initPost);
  4519. if (index > -1) {
  4520. postItem = this.list[index];
  4521. }
  4522. if (!postItem.title)
  4523. postItem.title = title ?? "加载中";
  4524. postItem.id = id;
  4525. postItem.href = href;
  4526. this.getPostDetail(postItem);
  4527. return;
  4528. }
  4529. if (this.config.newTabOpen) {
  4530. this.stopEvent(e2);
  4531. functions.openNewTab(`https://www.v2ex.com/t/${id}?p=1`);
  4532. }
  4533. }
  4534. },
  4535. showPost() {
  4536. this.show = true;
  4537. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  4538. $(this).hide();
  4539. });
  4540. },
  4541. showConfig() {
  4542. this.configModal.show = true;
  4543. },
  4544. async winCb({ type, value }) {
  4545. if (type === "openSetting") {
  4546. this.showConfig();
  4547. }
  4548. if (type === "syncData") {
  4549. this.list = window.postList;
  4550. this.config = window.config;
  4551. this.stopMe = window.stopMe;
  4552. this.tags = window.user.tags;
  4553. }
  4554. if (type === "warningNotice") {
  4555. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: value });
  4556. }
  4557. if (this.stopMe)
  4558. return;
  4559. if (type === "restorePost") {
  4560. this.show = false;
  4561. this.loading = false;
  4562. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  4563. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  4564. $(this).show();
  4565. });
  4566. }
  4567. if (type === "postContent") {
  4568. this.current = Object.assign(this.current, value);
  4569. this.current.inList = true;
  4570. if (this.config.autoOpenDetail) {
  4571. this.showPost();
  4572. }
  4573. }
  4574. if (type === "postReplies") {
  4575. this.current = Object.assign(this.current, value);
  4576. this.list.push(this.clone(this.current));
  4577. this.loading = false;
  4578. }
  4579. },
  4580. clone(val) {
  4581. return window.clone(val);
  4582. },
  4583. regenerateReplyList() {
  4584. if (this.current.replyList.length) {
  4585. this.current.replyCount = this.current.replyList.length;
  4586. let res = window.parse.createNestedList(this.current.replyList);
  4587. if (res) {
  4588. this.current.nestedReplies = res;
  4589. }
  4590. let dup_res = window.parse.createNestedRedundantList(this.current.replyList);
  4591. if (dup_res) {
  4592. this.current.nestedRedundReplies = dup_res;
  4593. }
  4594. } else {
  4595. this.current.replyCount = 0;
  4596. this.current.nestedReplies = [];
  4597. this.current.nestedRedundReplies = [];
  4598. }
  4599. if (this.list.length) {
  4600. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  4601. if (rIndex > -1) {
  4602. this.list[rIndex] = this.clone(this.current);
  4603. }
  4604. }
  4605. },
  4606. initEvent() {
  4607. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  4608. console.log("CHANGE_COMMENT_THANK", val);
  4609. const { id, type } = val;
  4610. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  4611. if (currentI > -1) {
  4612. this.current.replyList[currentI].isThanked = type === "add";
  4613. if (type === "add") {
  4614. this.current.replyList[currentI].thankCount++;
  4615. } else {
  4616. this.current.replyList[currentI].thankCount--;
  4617. }
  4618. this.regenerateReplyList();
  4619. }
  4620. });
  4621. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  4622. const { id, type } = val;
  4623. this.current.isThanked = type === "add";
  4624. if (type === "add") {
  4625. this.current.thankCount++;
  4626. } else {
  4627. this.current.thankCount--;
  4628. }
  4629. let currentI = this.list.findIndex((i) => i.id === id);
  4630. if (currentI > -1) {
  4631. this.list[currentI].isThanked = type === "add";
  4632. if (type === "add") {
  4633. this.list[currentI].thankCount++;
  4634. } else {
  4635. this.list[currentI].thankCount++;
  4636. }
  4637. }
  4638. });
  4639. eventBus.on(CMD.REMOVE, (val) => {
  4640. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  4641. if (removeIndex > -1) {
  4642. this.current.replyList.splice(removeIndex, 1);
  4643. }
  4644. this.regenerateReplyList();
  4645. });
  4646. eventBus.on(CMD.IGNORE, () => {
  4647. this.show = false;
  4648. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  4649. if (rIndex > -1) {
  4650. this.list.splice(rIndex, 1);
  4651. }
  4652. this.current = this.clone(window.initPost);
  4653. });
  4654. eventBus.on(CMD.MERGE, (val) => {
  4655. this.current = Object.assign(this.current, val);
  4656. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  4657. if (rIndex > -1) {
  4658. this.list[rIndex] = this.clone(this.current);
  4659. }
  4660. });
  4661. eventBus.on(CMD.ADD_REPLY, (item) => {
  4662. this.current.replyList.push(item);
  4663. this.regenerateReplyList();
  4664. });
  4665. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  4666. if (once) {
  4667. if (typeof once === "string") {
  4668. let res = once.match(/var once = "([\d]+)";/);
  4669. if (res && res[1]) {
  4670. this.current.once = Number(res[1]);
  4671. return;
  4672. }
  4673. }
  4674. if (typeof once === "number") {
  4675. this.current.once = once;
  4676. return;
  4677. }
  4678. }
  4679. window.fetchOnce().then((r2) => {
  4680. this.current.once = r2;
  4681. });
  4682. });
  4683. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  4684. let oldTag = this.clone(this.tags);
  4685. let tags = this.tags[username] ?? [];
  4686. let rIndex = tags.findIndex((v) => v === tag);
  4687. if (rIndex > -1) {
  4688. tags.splice(rIndex, 1);
  4689. }
  4690. this.tags[username] = tags;
  4691. let res = await window.parse.saveTags(this.tags);
  4692. if (!res) {
  4693. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  4694. this.tags = oldTag;
  4695. }
  4696. });
  4697. eventBus.on(CMD.REFRESH_POST, () => this.getPostDetail(this.current));
  4698. },
  4699. async getPostDetail(post) {
  4700. this.current = post;
  4701. this.show = true;
  4702. let url = window.baseUrl + "/t/" + this.current.id;
  4703. this.current.url = url;
  4704. let alreadyHasReply = this.current.replyList.length;
  4705. if (alreadyHasReply) {
  4706. this.refreshLoading = true;
  4707. } else {
  4708. this.loading = true;
  4709. let showJsonUrl = `${location.origin}/api/topics/show.json?id=${this.current.id}`;
  4710. let r2 = await fetch(showJsonUrl);
  4711. if (r2) {
  4712. let res = await r2.json();
  4713. if (res) {
  4714. let d2 = res[0];
  4715. d2.replyCount = d2.replies;
  4716. this.current = Object.assign(this.current, d2);
  4717. if (this.current.replyCount > MAX_REPLY_LIMIT) {
  4718. functions.openNewTab(`${location.origin}/t/${this.current.id}?p=1&script=1`);
  4719. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "由于回复数量较多,已为您单独打开此主题" });
  4720. this.loading = this.show = false;
  4721. return;
  4722. } else {
  4723. if (!this.current.headerTemplate) {
  4724. this.current.headerTemplate = `
  4725. <div class="cell">
  4726. <div class="topic_content">
  4727. <div class="markdown_body">
  4728. ${(d2 == null ? void 0 : d2.content_rendered) ?? ""}
  4729. </div>
  4730. </div>
  4731. </div>
  4732. `;
  4733. }
  4734. }
  4735. }
  4736. }
  4737. }
  4738. let apiRes = await window.fetch(url + "?p=1");
  4739. if (apiRes.status === 404) {
  4740. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  4741. return this.refreshLoading = this.loading = false;
  4742. }
  4743. if (apiRes.status === 403) {
  4744. this.refreshLoading = this.show = this.loading = false;
  4745. functions.openNewTab(`${location.origin}/t/${post.id}?p=1&script=0`);
  4746. return;
  4747. }
  4748. if (apiRes.redirected) {
  4749. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  4750. return this.refreshLoading = this.loading = false;
  4751. }
  4752. let htmlText = await apiRes.text();
  4753. let hasPermission = htmlText.search("你要查看的页面需要先登录");
  4754. if (hasPermission > -1) {
  4755. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录" });
  4756. return this.refreshLoading = this.loading = false;
  4757. }
  4758. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  4759. let body = $(bodyText[0]);
  4760. decodeEmail(body);
  4761. await window.parse.getPostDetail(this.current, body, htmlText);
  4762. let index = this.list.findIndex((v) => v.id == this.current.id);
  4763. if (index > -1) {
  4764. this.list[index] = this.clone(this.current);
  4765. } else {
  4766. this.list.push(this.clone(this.current));
  4767. }
  4768. this.refreshLoading = this.loading = false;
  4769. await window.parse.parseOp(this.current);
  4770. console.log("当前帖子", this.current);
  4771. },
  4772. addTargetUserTag() {
  4773. eventBus.emit(CMD.ADD_TAG, window.targetUserName);
  4774. },
  4775. removeTargetUserTag(tag) {
  4776. eventBus.emit(CMD.REMOVE_TAG, { username: window.targetUserName, tag });
  4777. }
  4778. }
  4779. };
  4780. const _withScopeId = (n2) => (vue.pushScopeId("data-v-5920e1e4"), n2 = n2(), vue.popScopeId(), n2);
  4781. const _hoisted_1 = {
  4782. key: 0,
  4783. class: "target-user-tags p1"
  4784. };
  4785. const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "标签:", -1));
  4786. const _hoisted_3 = { class: "my-tag" };
  4787. const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  4788. const _hoisted_5 = ["onClick"];
  4789. const _hoisted_6 = {
  4790. key: 1,
  4791. class: "my-box p2",
  4792. style: { "margin-top": "2rem" }
  4793. };
  4794. const _hoisted_7 = {
  4795. key: 0,
  4796. class: "flex flex-center"
  4797. };
  4798. const _hoisted_8 = {
  4799. key: 1,
  4800. class: "loaded"
  4801. };
  4802. const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "楼中楼解析完成", -1));
  4803. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  4804. const _component_Setting = vue.resolveComponent("Setting");
  4805. const _component_TagModal = vue.resolveComponent("TagModal");
  4806. const _component_PostDetail = vue.resolveComponent("PostDetail");
  4807. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  4808. const _component_MsgModal = vue.resolveComponent("MsgModal");
  4809. const _component_NotificationModal = vue.resolveComponent("NotificationModal");
  4810. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  4811. const _component_BaseButton = vue.resolveComponent("BaseButton");
  4812. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  4813. vue.createVNode(_component_Setting, {
  4814. modelValue: $data.config,
  4815. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  4816. show: $data.configModal.show,
  4817. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => $data.configModal.show = $event)
  4818. }, null, 8, ["modelValue", "show"]),
  4819. vue.createVNode(_component_TagModal, {
  4820. tags: $data.tags,
  4821. "onUpdate:tags": _cache[2] || (_cache[2] = ($event) => $data.tags = $event)
  4822. }, null, 8, ["tags"]),
  4823. vue.createVNode(_component_PostDetail, {
  4824. modelValue: $data.show,
  4825. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.show = $event),
  4826. ref: "postDetail",
  4827. displayType: $data.config.commentDisplayType,
  4828. "onUpdate:displayType": _cache[4] || (_cache[4] = ($event) => $data.config.commentDisplayType = $event),
  4829. onRefresh: _cache[5] || (_cache[5] = ($event) => $options.getPostDetail($data.current)),
  4830. loading: $data.loading,
  4831. refreshLoading: $data.refreshLoading
  4832. }, null, 8, ["modelValue", "displayType", "loading", "refreshLoading"]),
  4833. vue.createVNode(_component_Base64Tooltip),
  4834. vue.createVNode(_component_MsgModal),
  4835. vue.createVNode(_component_NotificationModal, {
  4836. modelValue: $data.notificationModal.show,
  4837. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.notificationModal.show = $event),
  4838. h: $data.notificationModal.h
  4839. }, null, 8, ["modelValue", "h"]),
  4840. !$data.stopMe ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  4841. $options.isMember && $data.isLogin && $data.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  4842. _hoisted_2,
  4843. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.targetUserTags, (i) => {
  4844. return vue.openBlock(), vue.createElementBlock("span", _hoisted_3, [
  4845. _hoisted_4,
  4846. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  4847. vue.createElementVNode("i", {
  4848. class: "fa fa-trash-o remove",
  4849. onClick: ($event) => $options.removeTargetUserTag(i)
  4850. }, null, 8, _hoisted_5)
  4851. ]);
  4852. }), 256)),
  4853. vue.createElementVNode("span", {
  4854. class: "add-tag ago",
  4855. onClick: _cache[7] || (_cache[7] = (...args) => $options.addTargetUserTag && $options.addTargetUserTag(...args)),
  4856. title: "添加标签"
  4857. }, "+")
  4858. ])) : vue.createCommentVNode("", true),
  4859. $options.isPost && !$data.show && $data.config.autoOpenDetail ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
  4860. $data.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
  4861. vue.createVNode(_component_BaseLoading)
  4862. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
  4863. _hoisted_9,
  4864. vue.createVNode(_component_BaseButton, {
  4865. size: "small",
  4866. onClick: $options.showPost
  4867. }, {
  4868. default: vue.withCtx(() => [
  4869. vue.createTextVNode("点击显示")
  4870. ]),
  4871. _: 1
  4872. }, 8, ["onClick"])
  4873. ]))
  4874. ])) : vue.createCommentVNode("", true)
  4875. ], 64)) : vue.createCommentVNode("", true)
  4876. ], 64);
  4877. }
  4878. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5920e1e4"]]);
  4879. let isMobile = !document.querySelector("#Rightbar");
  4880. let $section = document.createElement("section");
  4881. $section.id = "app";
  4882. function run() {
  4883. window.baseUrl = location.origin;
  4884. window.initPost = DefaultPost;
  4885. window.win = function() {
  4886. return window;
  4887. };
  4888. window.win().doc = window.win().document;
  4889. window.win().query = (v) => window.win().document.querySelector(v);
  4890. window.query = (v) => window.win().document.querySelector(v);
  4891. window.clone = (val) => JSON.parse(JSON.stringify(val));
  4892. window.user = DefaultUser;
  4893. window.targetUserName = "";
  4894. window.pageType = void 0;
  4895. window.pageData = { pageNo: 1 };
  4896. window.config = DefaultConfig;
  4897. window.const = {
  4898. git: "https://github.com/zyronon/v2ex-script",
  4899. issue: "https://github.com/zyronon/v2ex-script/issues"
  4900. };
  4901. window.currentVersion = 1;
  4902. window.isNight = $(".Night").length === 1;
  4903. window.cb = null;
  4904. window.stopMe = false;
  4905. window.postList = [];
  4906. window.parse = {
  4907. //解析帖子内容
  4908. async parsePostContent(post, body, htmlText) {
  4909. let once = htmlText.match(/var once = "([\d]+)";/);
  4910. if (once && once[1]) {
  4911. post.once = once[1];
  4912. }
  4913. post.isReport = htmlText.includes("你已对本主题进行了报告");
  4914. let wrapper = body.find("#Main");
  4915. if (!post.title || !post.content_rendered) {
  4916. let h1 = wrapper.find("h1");
  4917. if (h1) {
  4918. post.title = h1[0].innerText;
  4919. }
  4920. }
  4921. let as = wrapper.find(".header > a");
  4922. if (as.length) {
  4923. post.node.title = as[1].innerText;
  4924. post.node.url = as[1].href;
  4925. }
  4926. let aName = wrapper.find(".header small.gray a:nth-child(1)");
  4927. if (aName) {
  4928. post.member.username = aName[0].innerText;
  4929. }
  4930. let spanEl = wrapper.find(".header small.gray span");
  4931. if (spanEl) {
  4932. post.createDateAgo = spanEl[0].innerText;
  4933. }
  4934. let avatarEl = wrapper.find(".header .avatar");
  4935. if (avatarEl) {
  4936. post.member.avatar_large = avatarEl[0].src;
  4937. }
  4938. let topic_buttons = body.find(".topic_buttons");
  4939. if (topic_buttons.length) {
  4940. let favoriteNode = topic_buttons.find(".tb:first");
  4941. if (favoriteNode.length) {
  4942. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  4943. }
  4944. let ignoreNode = topic_buttons.find(".tb:nth-child(3)");
  4945. if (ignoreNode.length) {
  4946. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  4947. }
  4948. let thankNode = topic_buttons.find("#topic_thank .tb");
  4949. if (!thankNode.length) {
  4950. post.isThanked = true;
  4951. }
  4952. let topic_stats = topic_buttons.find(".topic_stats");
  4953. if (topic_stats.length) {
  4954. let text = topic_stats[0].innerText;
  4955. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  4956. let collectCountReg = [...reg1];
  4957. if (collectCountReg.length) {
  4958. post.collectCount = Number(collectCountReg[0][1]);
  4959. }
  4960. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  4961. collectCountReg = [...reg1];
  4962. if (collectCountReg.length) {
  4963. post.collectCount = Number(collectCountReg[0][1]);
  4964. }
  4965. let reg2 = text.matchAll(/([\d]+)[\s]*人感谢/g);
  4966. let thankCountReg = [...reg2];
  4967. if (thankCountReg.length) {
  4968. post.thankCount = Number(thankCountReg[0][1]);
  4969. }
  4970. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  4971. let clickCountReg = [...reg3];
  4972. if (clickCountReg.length) {
  4973. post.clickCount = Number(clickCountReg[0][1]);
  4974. }
  4975. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  4976. clickCountReg = [...reg3];
  4977. if (clickCountReg.length) {
  4978. post.clickCount = Number(clickCountReg[0][1]);
  4979. }
  4980. }
  4981. }
  4982. let header = body.find(`#Main .box`).first();
  4983. let temp = header.clone();
  4984. temp.find(".topic_buttons").remove();
  4985. temp.find(".inner").remove();
  4986. temp.find(".header").remove();
  4987. let html = temp.html();
  4988. html = this.checkPhotoLink2Img(html);
  4989. post.headerTemplate = html;
  4990. return post;
  4991. },
  4992. //解析OP信息
  4993. async parseOp(post) {
  4994. if (!post.member.id) {
  4995. let userRes = await fetch(window.baseUrl + "/api/members/show.json?username=" + post.member.username);
  4996. if (userRes.status === 200) {
  4997. post.member = await userRes.json();
  4998. }
  4999. }
  5000. if (post.member.id) {
  5001. let date = new Date(post.member.created * 1e3);
  5002. let createStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
  5003. date.setHours(0);
  5004. date.setMinutes(0);
  5005. date.setSeconds(0);
  5006. date.setMilliseconds(0);
  5007. let now = /* @__PURE__ */ new Date();
  5008. now.setHours(0);
  5009. now.setMinutes(0);
  5010. now.setSeconds(0);
  5011. now.setMilliseconds(0);
  5012. let d2 = now.getTime() - date.getTime();
  5013. let isNew = d2 <= 1e3 * 60 * 60 * 24 * 7;
  5014. post.member.createDate = createStr + " 注册";
  5015. post.member.isNew = isNew;
  5016. } else {
  5017. post.member.createDate = "用户已被注销/封禁";
  5018. post.member.isNew = true;
  5019. }
  5020. return post;
  5021. },
  5022. //获取帖子所有回复
  5023. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  5024. var _a, _b;
  5025. if (body.find("#no-comments-yet").length) {
  5026. return post;
  5027. }
  5028. let boxs = body.find(`#Main .box`);
  5029. let box = boxs[1];
  5030. let cells = box.querySelectorAll(".cell");
  5031. if (cells && cells.length) {
  5032. post.fr = cells[0].querySelector(".cell .fr").innerHTML;
  5033. cells = Array.from(cells);
  5034. let snow = cells[0].querySelector(".snow");
  5035. post.createDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  5036. let repliesMap = [];
  5037. if (cells[1].id) {
  5038. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  5039. let replyList = this.getAllReply(repliesMap);
  5040. post.replyList = replyList;
  5041. post.replyCount = replyList.length;
  5042. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  5043. let nestedList = this.createNestedList(replyList);
  5044. let nestedRedundantList = this.createNestedRedundantList(replyList);
  5045. if (nestedList)
  5046. post.nestedReplies = nestedList;
  5047. if (nestedRedundantList)
  5048. post.nestedRedundReplies = nestedRedundantList;
  5049. return post;
  5050. } else {
  5051. let promiseList = [];
  5052. return new Promise((resolve, reject) => {
  5053. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  5054. let pages = cells[1].querySelectorAll("a.page_normal");
  5055. pages = Array.from(pages);
  5056. let url = window.baseUrl + "/t/" + post.id;
  5057. for (let i = 0; i < pages.length; i++) {
  5058. let currentPageNo = Number(pages[i].innerText);
  5059. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  5060. }
  5061. Promise.allSettled(promiseList).then(
  5062. (results) => {
  5063. results.filter((result) => result.status === "fulfilled").map((v) => repliesMap.push(v.value));
  5064. let replyList = this.getAllReply(repliesMap);
  5065. post.replyList = replyList;
  5066. post.replyCount = replyList.length;
  5067. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  5068. let nestedList = this.createNestedList(replyList);
  5069. let nestedRedundantList = this.createNestedRedundantList(replyList);
  5070. if (nestedList)
  5071. post.nestedReplies = nestedList;
  5072. if (nestedRedundantList)
  5073. post.nestedRedundReplies = nestedRedundantList;
  5074. resolve(post);
  5075. }
  5076. );
  5077. });
  5078. }
  5079. }
  5080. },
  5081. //请求帖子其他页的回复
  5082. fetchPostOtherPageReplies(href, pageNo) {
  5083. return new Promise((resolve) => {
  5084. $.get(href).then((res) => {
  5085. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  5086. let box = $(s[0]).find("#Main .box")[1];
  5087. let cells = box.querySelectorAll(".cell");
  5088. cells = Array.from(cells);
  5089. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  5090. }).catch((r2) => {
  5091. if (r2.status === 403) {
  5092. cbChecker({ type: "restorePost", value: null });
  5093. }
  5094. });
  5095. });
  5096. },
  5097. //解析页面的回复
  5098. parsePageReplies(nodes) {
  5099. let replyList = [];
  5100. nodes.forEach((node, index) => {
  5101. if (!node.id)
  5102. return;
  5103. let item = {
  5104. level: 0,
  5105. thankCount: 0,
  5106. isThanked: false,
  5107. isOp: false,
  5108. isDup: false,
  5109. id: node.id.replace("r_", "")
  5110. };
  5111. let reply_content = node.querySelector(".reply_content");
  5112. item.reply_content = this.checkPhotoLink2Img(reply_content.innerHTML);
  5113. item.reply_text = reply_content.textContent;
  5114. let { users, floor } = this.parseReplyContent(item.reply_content);
  5115. item.hideCallUserReplyContent = item.reply_content;
  5116. if (users.length === 1) {
  5117. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  5118. }
  5119. item.replyUsers = users;
  5120. item.replyFloor = floor;
  5121. let ago = node.querySelector(".ago");
  5122. item.date = ago.textContent;
  5123. let userNode = node.querySelector("strong a");
  5124. item.username = userNode.textContent;
  5125. let avatar = node.querySelector("td img");
  5126. item.avatar = avatar.src;
  5127. let no = node.querySelector(".no");
  5128. item.floor = Number(no.textContent);
  5129. let thank_area = node.querySelector(".thank_area");
  5130. if (thank_area) {
  5131. item.isThanked = thank_area.classList.contains("thanked");
  5132. }
  5133. let small = node.querySelector(".small");
  5134. if (small) {
  5135. item.thankCount = Number(small.textContent);
  5136. }
  5137. let op = node.querySelector(".op");
  5138. if (op) {
  5139. item.isOp = true;
  5140. }
  5141. let mod = node.querySelector(".mod");
  5142. if (mod) {
  5143. item.isMod = true;
  5144. }
  5145. replyList.push(item);
  5146. });
  5147. return replyList;
  5148. },
  5149. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  5150. parseReplyContent(str) {
  5151. if (!str)
  5152. return;
  5153. let users = [];
  5154. let getUsername = (userStr) => {
  5155. let endIndex = userStr.indexOf('">');
  5156. if (endIndex > -1) {
  5157. let user = userStr.substring(0, endIndex);
  5158. if (!users.find((i) => i === user)) {
  5159. users.push(user);
  5160. }
  5161. }
  5162. };
  5163. let userReg = /@<a href="\/member\/([\s\S]+?)<\/a>/g;
  5164. let has = str.matchAll(userReg);
  5165. let res2 = [...has];
  5166. if (res2.length > 1) {
  5167. res2.map((item) => {
  5168. getUsername(item[1]);
  5169. });
  5170. }
  5171. if (res2.length === 1) {
  5172. getUsername(res2[0][1]);
  5173. }
  5174. let floor = -1;
  5175. if (users.length === 1) {
  5176. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>[\s]+#([\d]+)/g;
  5177. let hasFloor = str.matchAll(floorReg);
  5178. let res = [...hasFloor];
  5179. if (res.length) {
  5180. floor = Number(res[0][1]);
  5181. }
  5182. }
  5183. return { users, floor };
  5184. },
  5185. //获取帖子详情
  5186. async getPostDetail(post, body, htmlText, pageNo = 1) {
  5187. post = await this.parsePostContent(post, body, htmlText);
  5188. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  5189. },
  5190. //获取所有回复
  5191. getAllReply(repliesMap = []) {
  5192. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  5193. pre = pre.concat(i.replyList);
  5194. return pre;
  5195. }, []);
  5196. },
  5197. //生成嵌套回复
  5198. createNestedList(allList = []) {
  5199. if (!allList.length)
  5200. return [];
  5201. let list = window.clone(allList);
  5202. let nestedList = [];
  5203. list.map((item, index) => {
  5204. let startList = list.slice(0, index);
  5205. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  5206. let endList = list.slice(index + 1);
  5207. if (index === 0) {
  5208. nestedList.push(this.findChildren(item, endList, list));
  5209. } else {
  5210. if (!item.isUse) {
  5211. let isOneLevelReply = false;
  5212. if (item.replyUsers.length) {
  5213. if (item.replyUsers.length > 1) {
  5214. isOneLevelReply = true;
  5215. } else {
  5216. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  5217. }
  5218. } else {
  5219. isOneLevelReply = true;
  5220. }
  5221. if (isOneLevelReply) {
  5222. item.level = 0;
  5223. nestedList.push(this.findChildren(item, endList, list));
  5224. }
  5225. }
  5226. }
  5227. });
  5228. return nestedList;
  5229. },
  5230. //生成嵌套冗余回复
  5231. createNestedRedundantList(allList = []) {
  5232. if (!allList.length)
  5233. return [];
  5234. let list = window.clone(allList);
  5235. let nestedList = [];
  5236. list.map((item, index) => {
  5237. let startList = list.slice(0, index);
  5238. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  5239. let endList = list.slice(index + 1);
  5240. if (index === 0) {
  5241. nestedList.push(this.findChildren(item, endList, list));
  5242. } else {
  5243. if (!item.isUse) {
  5244. let isOneLevelReply = false;
  5245. if (item.replyUsers.length) {
  5246. if (item.replyUsers.length > 1) {
  5247. isOneLevelReply = true;
  5248. } else {
  5249. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  5250. }
  5251. } else {
  5252. isOneLevelReply = true;
  5253. }
  5254. if (isOneLevelReply) {
  5255. item.level = 0;
  5256. nestedList.push(this.findChildren(item, endList, list));
  5257. }
  5258. } else {
  5259. let newItem = window.clone(item);
  5260. newItem.children = [];
  5261. newItem.level = 0;
  5262. newItem.isDup = true;
  5263. nestedList.push(newItem);
  5264. }
  5265. }
  5266. });
  5267. return nestedList;
  5268. },
  5269. //查找子回复
  5270. findChildren(item, endList, all) {
  5271. var _a;
  5272. const fn = (child, endList2, parent) => {
  5273. child.level = parent.level + 1;
  5274. let rIndex = all.findIndex((v) => v.floor === child.floor);
  5275. if (rIndex > -1) {
  5276. all[rIndex].isUse = true;
  5277. }
  5278. parent.children.push(this.findChildren(child, endList2, all));
  5279. };
  5280. item.children = [];
  5281. let floorReplyList = [];
  5282. for (let i = 0; i < endList.length; i++) {
  5283. let currentItem = endList[i];
  5284. if (currentItem.isUse)
  5285. continue;
  5286. if (currentItem.replyFloor === item.floor) {
  5287. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  5288. currentItem.isUse = true;
  5289. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  5290. } else {
  5291. currentItem.isWrong = true;
  5292. }
  5293. }
  5294. }
  5295. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  5296. fn(currentItem, endList2, item);
  5297. });
  5298. let nextMeIndex = endList.findIndex((v) => {
  5299. var _a2;
  5300. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  5301. });
  5302. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  5303. for (let i = 0; i < findList.length; i++) {
  5304. let currentItem = findList[i];
  5305. if (currentItem.isUse)
  5306. continue;
  5307. if (currentItem.replyUsers.length === 1) {
  5308. if (currentItem.replyFloor !== -1) {
  5309. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  5310. continue;
  5311. }
  5312. }
  5313. let endList2 = endList.slice(i + 1);
  5314. if (currentItem.username === item.username) {
  5315. if (currentItem.replyUsers[0] === item.username) {
  5316. fn(currentItem, endList2, item);
  5317. }
  5318. break;
  5319. } else {
  5320. if (currentItem.replyUsers[0] === item.username) {
  5321. fn(currentItem, endList2, item);
  5322. }
  5323. }
  5324. } else {
  5325. if (currentItem.username === item.username)
  5326. break;
  5327. }
  5328. }
  5329. item.children = item.children.sort((a, b) => a.floor - b.floor);
  5330. return item;
  5331. },
  5332. //解析页面帖子列表
  5333. parsePagePostList(list, box) {
  5334. list.forEach((itemDom) => {
  5335. let item = window.clone(window.initPost);
  5336. let item_title = itemDom.querySelector(".item_title a");
  5337. let { href, id } = window.parse.parseA(item_title);
  5338. item.id = id;
  5339. item.href = href;
  5340. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  5341. itemDom.classList.add("post-item");
  5342. itemDom.classList.add(`id_${id}`);
  5343. itemDom.dataset["href"] = href;
  5344. itemDom.dataset["id"] = id;
  5345. window.postList.push(item);
  5346. });
  5347. Promise.allSettled(window.postList.map((item) => $.get(item.url))).then((res) => {
  5348. let ok = res.filter((r2) => r2.status === "fulfilled").map((v) => v.value[0]);
  5349. box.style.boxShadow = "unset";
  5350. box.style.background = "unset";
  5351. if (window.config.viewType === "card") {
  5352. list.forEach((itemDom) => itemDom.classList.add("preview"));
  5353. }
  5354. ok.map((postItem) => {
  5355. var _a;
  5356. if (postItem == null ? void 0 : postItem.id) {
  5357. let itemDom = box.querySelector(`.id_${postItem.id}`);
  5358. if (window.config.showPreviewBtn) {
  5359. let td = itemDom.querySelector("td:nth-child(4)");
  5360. td.style.position = "relative";
  5361. let toggle = document.createElement("div");
  5362. toggle.dataset["id"] = postItem.id;
  5363. toggle.classList.add("toggle");
  5364. toggle.innerText = "点击展开/收起";
  5365. td.append(toggle);
  5366. }
  5367. let index = window.postList.findIndex((v) => v.id == postItem.id);
  5368. if (index > -1) {
  5369. let obj = window.postList[index];
  5370. postItem.replyCount = postItem.replies;
  5371. window.postList[index] = Object.assign({}, obj, postItem);
  5372. if (postItem.content_rendered) {
  5373. let a = document.createElement("a");
  5374. a.href = obj.href;
  5375. a.classList.add("post-content");
  5376. let div = document.createElement("div");
  5377. div.innerHTML = postItem.content_rendered;
  5378. a.append(div);
  5379. itemDom.append(a);
  5380. if (div.clientHeight < 172) {
  5381. a.classList.add("show-all");
  5382. } else {
  5383. let showMore = document.createElement("div");
  5384. showMore.classList.add("show-more");
  5385. showMore.innerHTML = "显示更多/收起";
  5386. showMore.onclick = function(e2) {
  5387. e2.stopPropagation();
  5388. a.classList.toggle("show-all");
  5389. };
  5390. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  5391. }
  5392. }
  5393. }
  5394. }
  5395. });
  5396. cbChecker({ type: "syncData" });
  5397. });
  5398. },
  5399. //解析A标签
  5400. parseA(a) {
  5401. let href = a.href;
  5402. let id;
  5403. if (href.includes("/t/")) {
  5404. id = a.pathname.substring("/t/".length);
  5405. }
  5406. return { href, id, title: a.innerText };
  5407. },
  5408. //创建记事本子条目
  5409. async createNoteItem(itemName) {
  5410. return;
  5411. },
  5412. //编辑记事本子条目
  5413. async editNoteItem(val, id) {
  5414. return;
  5415. },
  5416. //标签操作
  5417. async saveTags(val) {
  5418. return;
  5419. },
  5420. //已读楼层操作
  5421. async saveReadList(val) {
  5422. return;
  5423. },
  5424. //imgur图片删除hash操作
  5425. async saveImgurList(val) {
  5426. return;
  5427. },
  5428. //图片链接转Img标签
  5429. checkPhotoLink2Img(str) {
  5430. if (!str)
  5431. return;
  5432. try {
  5433. let imgWebs = [
  5434. /<a((?!<a).)*href="https?:\/\/((?!<a).)*imgur.com((?!<a).)*>(((?!<a).)*)<\/a>/g,
  5435. /<a((?!<a).)*href="https?:\/\/((?!<a).)*\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG) ((?!<a).)*>(((?!<a).)*)<\/a>/g
  5436. ];
  5437. imgWebs.map((v, i) => {
  5438. let has = str.matchAll(v);
  5439. let res2 = [...has];
  5440. res2.map((r2) => {
  5441. let p = i === 0 ? r2[4] : r2[5];
  5442. if (p) {
  5443. let link = p.toLowerCase();
  5444. let src = p;
  5445. if (link.includes(".png") || link.includes(".jpg") || link.includes(".jpeg") || link.includes(".gif")) {
  5446. } else {
  5447. src = p + ".png";
  5448. }
  5449. str = str.replace(r2[0], `<img src="${src}" data-originUrl="${p}" data-notice="此img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`);
  5450. }
  5451. });
  5452. });
  5453. } catch (e2) {
  5454. console.log("正则解析html里面的a标签的图片链接出错了");
  5455. }
  5456. return str;
  5457. },
  5458. //检测帖子回复长度
  5459. async checkPostReplies(id, needOpen = true) {
  5460. return new Promise(async (resolve) => {
  5461. var _a;
  5462. let showJsonUrl = `${location.origin}/api/topics/show.json?id=${id}`;
  5463. let r2 = await fetch(showJsonUrl);
  5464. if (r2) {
  5465. let res = await r2.json();
  5466. if (res) {
  5467. if (((_a = res[0]) == null ? void 0 : _a.replies) > MAX_REPLY_LIMIT) {
  5468. if (needOpen) {
  5469. functions.openNewTab(`https://www.v2ex.com/t/${id}?p=1&script=1`);
  5470. }
  5471. return resolve(true);
  5472. }
  5473. }
  5474. }
  5475. resolve(false);
  5476. });
  5477. }
  5478. };
  5479. window.vals = {
  5480. isMobile: !document.querySelector("#Rightbar")
  5481. };
  5482. window.functions = {};
  5483. async function sleep(time) {
  5484. return new Promise((resolve) => {
  5485. setTimeout(resolve, time);
  5486. });
  5487. }
  5488. async function cbChecker(val, count = 0) {
  5489. if (window.cb) {
  5490. window.cb(val);
  5491. } else {
  5492. while (!window.cb && count < 30) {
  5493. await sleep(500);
  5494. count++;
  5495. }
  5496. window.cb && window.cb(val);
  5497. }
  5498. }
  5499. function initMonkeyMenu() {
  5500. try {
  5501. _GM_registerMenuCommand("脚本设置", () => {
  5502. cbChecker({ type: "openSetting" });
  5503. });
  5504. _GM_registerMenuCommand("仓库地址", () => {
  5505. functions.openNewTab(DefaultVal.git);
  5506. });
  5507. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  5508. } catch (e2) {
  5509. console.error("无法使用Tampermonkey");
  5510. }
  5511. }
  5512. function initStyle() {
  5513. let style2 = `
  5514. html, body {
  5515. font-size: 62.5%;
  5516. }
  5517.  
  5518. :root{
  5519. --box-border-radius:8px;
  5520. }
  5521. .box{
  5522. box-shadow:rgba(0, 0, 0, 0.08) 0px 4px 12px;
  5523. }
  5524. #Tabs{
  5525. border-top-left-radius: var(--box-border-radius) !important;
  5526. border-top-right-radius: var(--box-border-radius) !important;
  5527. }
  5528. #Main .cell .count_livid {
  5529. font-size: 14px;
  5530. font-weight: 500;
  5531. padding: 3px 10px;
  5532. border-radius: 5px;
  5533. }
  5534.  
  5535. #Wrapper {
  5536. height: unset !important;
  5537. width: unset !important;
  5538. }
  5539.  
  5540. #Wrapper > .content {
  5541. height: unset !important;
  5542. width: unset !important;
  5543. max-width:1100px !important;
  5544. }
  5545.  
  5546. .post-item {
  5547. background: white;
  5548. }
  5549.  
  5550. .post-item > .post-content {
  5551. height: 0;
  5552. margin-top: 0;
  5553. }
  5554.  
  5555. .post-item:hover .toggle {
  5556. display: flex;
  5557. }
  5558.  
  5559. .toggle {
  5560. position: absolute;
  5561. right: ${window.config.viewType === "simple" ? "5rem" : 0};
  5562. top: 0.5rem;
  5563. width: 9rem;
  5564. height: 100%;
  5565. display: flex;
  5566. justify-content: flex-end;
  5567. align-items: flex-end;
  5568. cursor: pointer;
  5569. font-size: 1.2rem;
  5570. color: #ccc;
  5571. display: none;
  5572. }
  5573.  
  5574. .preview {
  5575. margin: 1rem 0;
  5576. border: 1px solid transparent;
  5577. border-radius: var(--box-border-radius);
  5578. cursor: pointer;
  5579. }
  5580.  
  5581. .preview:hover {
  5582. border: 1px solid #c8c8c8;
  5583. }
  5584.  
  5585. .preview > .post-content {
  5586. height: unset !important;
  5587. margin-top: 0.5rem !important;
  5588. }
  5589.  
  5590. .preview > .post-content.show-all {
  5591. max-height: unset;
  5592. -webkit-mask-image:none;
  5593. }
  5594.  
  5595. .preview .topic-link:link {
  5596. color: black !important;
  5597. }
  5598.  
  5599. .post-content {
  5600. margin-top: 0.5rem;
  5601. display: block;
  5602. max-height: 20rem;
  5603. overflow: hidden;
  5604. text-decoration: unset !important;
  5605. line-break: anywhere;
  5606. -webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);
  5607. }
  5608.  
  5609. .show-more {
  5610. display: none;
  5611. }
  5612.  
  5613. .preview > .show-more {
  5614. font-size: 1.3rem;
  5615. text-align: right;
  5616. height: 3rem;
  5617. display: flex;
  5618. align-items: center;
  5619. justify-content: center;
  5620. position: relative;
  5621. z-index: 9;
  5622. }
  5623.  
  5624. .post-content:visited {
  5625. color: #afb9c1 !important;
  5626. }
  5627.  
  5628. .post-content:link {
  5629. color: #494949;
  5630. }
  5631.  
  5632.  
  5633. .Night .post-item {
  5634. background: #18222d !important;
  5635. }
  5636.  
  5637. .Night .preview {
  5638. border: 1px solid #3b536e;
  5639. }
  5640.  
  5641. .Night .preview > .post-content:link {
  5642. color: #d1d5d9;
  5643. }
  5644.  
  5645. .Night .preview > .post-content:visited {
  5646. color: #393f4e !important;
  5647. }
  5648. .Night .preview .topic-link:link {
  5649. color: #c0dbff !important;
  5650. }
  5651. ${window.config.viewType === "simple" ? `
  5652. ${window.pageType !== PageType.Member ? `
  5653. .item table tr td:first-child{display:none;}
  5654. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  5655. .item table tr td .sep5{display:none;}
  5656. .item table tr td .topic_info{display:none;}
  5657. .item {border-bottom:none;}
  5658. .avatar,#avatar{display:none;}
  5659. ` : ""}
  5660. #Logo {background-image:url('https://i.imgur.com/i9VgUtM.png');}
  5661. .bigger a, .top:nth-last-child(5){color: transparent!important;text-shadow: #b0b0b0 0 0 6px;user-select: none;}
  5662. // .bigger a:before,.top:nth-last-child(5):before{content:'Mona Lisa';position: absolute;background: white;}
  5663. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  5664. ` : ""}
  5665.  
  5666. ${window.config.customBgColor ? `#Wrapper {
  5667. background-color: ${window.config.customBgColor} !important;
  5668. background-image: unset !important;
  5669. }` : ""}
  5670. .top{
  5671. position:relative;
  5672. }
  5673. .new:before{
  5674. content:'new';
  5675. position: absolute;
  5676. background: red;
  5677. font-size: 10px;
  5678. border-radius: 4px;
  5679. padding: 0px 2px;
  5680. color: white;
  5681. right: -9px;
  5682. top: -3px;
  5683. }
  5684. }
  5685.  
  5686. `;
  5687. let addStyle2 = document.createElement("style");
  5688. addStyle2.rel = "stylesheet";
  5689. addStyle2.type = "text/css";
  5690. addStyle2.innerHTML = style2;
  5691. window.document.head.append(addStyle2);
  5692. }
  5693. function qianDao() {
  5694. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  5695. if (window.pageType === PageType.Home) {
  5696. let qiandao = window.query('.box .inner a[href="/mission/daily"]');
  5697. if (qiandao) {
  5698. qianDao_(qiandao, timeNow);
  5699. } else if (window.win().doc.getElementById("gift_v2excellent")) {
  5700. window.win().doc.getElementById("gift_v2excellent").click();
  5701. localStorage.setItem("menu_clockInTime", timeNow);
  5702. console.info("[V2EX - 超级增强] 自动签到完成!");
  5703. } else {
  5704. console.info("[V2EX - 超级增强] 自动签到完成!");
  5705. }
  5706. } else {
  5707. let timeOld = localStorage.getItem("menu_clockInTime");
  5708. if (!timeOld || timeOld != timeNow) {
  5709. qianDaoStatus_(timeNow);
  5710. } else {
  5711. console.info("[V2EX - 超级增强] 自动签到完成!");
  5712. }
  5713. }
  5714. }
  5715. function qianDao_(qiandao, timeNow) {
  5716. let url = window.baseUrl + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  5717. console.log("url", url);
  5718. $.get(url).then((r2) => {
  5719. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  5720. let html = $(bodyText[0]);
  5721. if (html.find("li.fa.fa-ok-sign").length) {
  5722. html = html.find("#Main").text().match(/已连续登录 (\d+?) 天/)[0];
  5723. localStorage.setItem("menu_clockInTime", timeNow);
  5724. console.info("[V2EX - 超级增强] 自动签到完成!");
  5725. if (qiandao) {
  5726. qiandao.textContent = `自动签到完成!${html}`;
  5727. qiandao.href = "javascript:void(0);";
  5728. }
  5729. } else {
  5730. _GM_notification({
  5731. text: "自动签到失败!请关闭其他插件或脚本。\n如果连续几天都签到失败,请联系作者解决!",
  5732. timeout: 4e3,
  5733. onclick() {
  5734. functions.feedback();
  5735. }
  5736. });
  5737. console.warn("[V2EX 增强] 自动签到失败!请关闭其他插件或脚本。如果连续几天都签到失败,请联系作者解决!");
  5738. if (qiandao)
  5739. qiandao.textContent = "自动签到失败!请尝试手动签到!";
  5740. }
  5741. });
  5742. }
  5743. function qianDaoStatus_(timeNow) {
  5744. $.get(window.baseUrl + "/mission/daily").then((r2) => {
  5745. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  5746. let html = $(bodyText[0]);
  5747. if (html.find('input[value^="领取"]').length) {
  5748. qianDao_(null, timeNow);
  5749. } else {
  5750. console.info("[V2EX 增强] 已经签过到了。");
  5751. localStorage.setItem("menu_clockInTime", timeNow);
  5752. }
  5753. });
  5754. }
  5755. function checkPageType() {
  5756. let l = window.location;
  5757. if (l.pathname === "/") {
  5758. window.pageType = PageType.Home;
  5759. } else if (l.href.match(/.com\/?tab=/)) {
  5760. window.pageType = PageType.Home;
  5761. } else if (l.href.match(/.com\/go\//)) {
  5762. if (!l.href.includes("/links")) {
  5763. window.pageType = PageType.Node;
  5764. }
  5765. } else if (l.href.match(/.com\/recent/)) {
  5766. window.pageType = PageType.Home;
  5767. } else if (l.href.match(/.com\/member/)) {
  5768. window.pageType = PageType.Member;
  5769. } else {
  5770. let r2 = l.href.match(/.com\/t\/([\d]+)/);
  5771. if (r2) {
  5772. window.pageType = PageType.Post;
  5773. window.pageData.id = r2[1];
  5774. if (l.search) {
  5775. let pr = l.href.match(/\?p=([\d]+)/);
  5776. if (pr)
  5777. window.pageData.pageNo = Number(pr[1]);
  5778. }
  5779. }
  5780. }
  5781. }
  5782. function initConfig() {
  5783. return new Promise((resolve) => {
  5784. let configStr = window.localStorage.getItem("v2ex-config");
  5785. if (configStr) {
  5786. let configObj = JSON.parse(configStr);
  5787. configObj = configObj[window.user.username ?? "default"];
  5788. if (configObj) {
  5789. window.config = Object.assign(window.config, configObj);
  5790. }
  5791. }
  5792. resolve(window.config);
  5793. });
  5794. }
  5795. function addSettingText() {
  5796. let setting = $(`<a href="javascript:void 0;" class="top ${window.config.version < window.currentVersion ? "new" : ""}">脚本设置</a>`);
  5797. setting.on("click", function() {
  5798. this.classList.remove("new");
  5799. cbChecker({ type: "openSetting" });
  5800. });
  5801. $(".tools").prepend(setting);
  5802. }
  5803. async function init() {
  5804. window.addEventListener("error", (e2) => {
  5805. let dom = e2.target;
  5806. let originImgUrl = dom.getAttribute("data-originurl");
  5807. if (originImgUrl) {
  5808. let a = document.createElement("a");
  5809. a.href = originImgUrl;
  5810. a.setAttribute("notice", "此标签由v2ex超级增强脚本转换图片失败后恢复");
  5811. a.innerText = originImgUrl;
  5812. dom.parentNode.replaceChild(a, dom);
  5813. }
  5814. }, true);
  5815. if (window.isNight) {
  5816. document.documentElement.classList.add("dark");
  5817. }
  5818. checkPageType();
  5819. initMonkeyMenu();
  5820. let top2 = document.querySelector(".tools .top:nth-child(2)");
  5821. if (top2 && top2.textContent !== "注册") {
  5822. window.user.username = top2.textContent;
  5823. window.user.avatar = $("#Rightbar .box .avatar").attr("src");
  5824. }
  5825. initConfig().then((r2) => {
  5826. addSettingText();
  5827. initStyle();
  5828. try {
  5829. if (window.config.autoSignin && window.user.username) {
  5830. qianDao();
  5831. }
  5832. } catch (e2) {
  5833. console.log("签到失败");
  5834. }
  5835. if (window.user.username)
  5836. ;
  5837. });
  5838. let box;
  5839. let list;
  5840. console.log(window.pageType);
  5841. switch (window.pageType) {
  5842. case PageType.Node:
  5843. box = window.win().doc.querySelectorAll("#Wrapper #Main .box");
  5844. let topics = box[1].querySelector("#TopicsNode");
  5845. list = topics.querySelectorAll(".cell");
  5846. list[0].before($section);
  5847. break;
  5848. case PageType.Home:
  5849. box = document.querySelector("#Wrapper #Main .box");
  5850. list = box.querySelectorAll(".item");
  5851. list[0].before($section);
  5852. break;
  5853. case PageType.Post:
  5854. box = document.querySelector("#Wrapper #Main .box");
  5855. box.after($section);
  5856. if (window.config.postWidth) {
  5857. let Main = $("#Main");
  5858. Main.css({
  5859. "width": window.config.postWidth,
  5860. margin: "unset"
  5861. });
  5862. $("#Wrapper > .content").css({
  5863. "max-width": "unset",
  5864. display: "flex",
  5865. "justify-content": "center",
  5866. gap: "20px"
  5867. });
  5868. Main.after($("#Rightbar"));
  5869. }
  5870. let post = window.clone(window.initPost);
  5871. post.id = window.pageData.id;
  5872. let body = $(window.document.body);
  5873. let htmlText = window.document.documentElement.outerHTML;
  5874. window.parse.parsePostContent(
  5875. post,
  5876. body,
  5877. htmlText
  5878. ).then(async (res) => {
  5879. await functions.cbChecker({ type: "postContent", value: res });
  5880. await window.parse.parseOp(res);
  5881. });
  5882. window.parse.getPostAllReplies(
  5883. post,
  5884. body,
  5885. htmlText,
  5886. window.pageData.pageNo
  5887. ).then(async (res1) => {
  5888. await functions.cbChecker({ type: "postReplies", value: res1 });
  5889. });
  5890. break;
  5891. case PageType.Member:
  5892. box = document.querySelector("#Wrapper #Main .box");
  5893. window.targetUserName = box[0].querySelector("h1").textContent;
  5894. if (window.config.openTag) {
  5895. box[0].style.borderBottom = "none";
  5896. box[0].style["border-bottom-left-radius"] = "0";
  5897. box[0].style["border-bottom-right-radius"] = "0";
  5898. }
  5899. list = box[1].querySelectorAll(".cell");
  5900. box[0].after($section);
  5901. break;
  5902. default:
  5903. window.stopMe = true;
  5904. cbChecker({ type: "syncData" });
  5905. console.error("未知页面");
  5906. break;
  5907. }
  5908. }
  5909. window.canParseV2exPage = !window.location.search.includes("script");
  5910. if (window.canParseV2exPage) {
  5911. init();
  5912. } else {
  5913. let box = document.querySelector("#Wrapper #Main .box");
  5914. box.after($section);
  5915. window.stopMe = true;
  5916. cbChecker({ type: "syncData" });
  5917. if (window.location.search.includes("script=0")) {
  5918. cbChecker({ type: "warningNotice", value: "脚本无法查看此主题,已为您单独打开此主题" });
  5919. }
  5920. if (window.location.search.includes("script=1")) {
  5921. cbChecker({ type: "warningNotice", value: "由于回复数量较多,已为您单独打开此主题并停止解析楼中楼" });
  5922. }
  5923. }
  5924. }
  5925. if (!isMobile) {
  5926. (o=>{if(typeof GM_addStyle=="function"){GM_addStyle(o);return}const r=document.createElement("style");r.textContent=o,document.head.append(r)})(' .tip[data-v-ee672411]{position:fixed;font-size:1.6rem;z-index:9999;max-width:10rem;border-radius:.5rem;padding:1rem;color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.v-enter-active[data-v-e7c0fbef],.v-leave-active[data-v-e7c0fbef]{transition:opacity .3s ease}.v-enter-from[data-v-e7c0fbef],.v-leave-to[data-v-e7c0fbef]{opacity:0}.username[data-v-e7c0fbef]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-e7c0fbef]{font-weight:700;color:var(--color-font-8)}.owner[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-e7c0fbef]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-e7c0fbef]{display:inline}.my-tag .remove[data-v-e7c0fbef]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-e7c0fbef]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-e7c0fbef]{margin-left:1rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-e7c0fbef]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white}html.dark[data-v-e7c0fbef]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}html[data-v-e7c0fbef],body[data-v-e7c0fbef]{font-size:62.5%}[data-v-e7c0fbef]::-webkit-scrollbar{width:1rem;height:1rem}[data-v-e7c0fbef]::-webkit-scrollbar-track{background:transparent;border-radius:.2rem}[data-v-e7c0fbef]::-webkit-scrollbar-thumb{background:var(--color-scrollbar);border-radius:1rem}.flex[data-v-e7c0fbef]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-e7c0fbef]{justify-content:flex-end}.flex-center[data-v-e7c0fbef]{justify-content:center}.p1[data-v-e7c0fbef]{padding:1rem}.p2[data-v-e7c0fbef]{padding:2rem}.p0[data-v-e7c0fbef]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-e7c0fbef]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-e7c0fbef]{text-decoration:none;cursor:pointer}a[data-v-e7c0fbef]:hover{text-decoration:underline}.tool[data-v-e7c0fbef]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-e7c0fbef]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-e7c0fbef]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-e7c0fbef]{cursor:default}.tool.no-hover[data-v-e7c0fbef]:hover{background:unset!important}.tool.disabled[data-v-e7c0fbef]{cursor:not-allowed}.tool.disabled[data-v-e7c0fbef]:hover{background:unset!important}.my-node[data-v-e7c0fbef]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-e7c0fbef]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-e7c0fbef]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-e7c0fbef]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-e7c0fbef]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-e7c0fbef]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-e7c0fbef]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-e7c0fbef]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-e7c0fbef]{position:relative}.modal .mask[data-v-e7c0fbef]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-e7c0fbef]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-e7c0fbef]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-e7c0fbef]:first-child{border-left:none}.radio-group2 .active[data-v-e7c0fbef]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-e7c0fbef]{position:relative;display:inline-flex;justify-content:center}input[data-v-e7c0fbef]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-e7c0fbef]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-e7c0fbef]:focus{border:1px solid var(--color-active)}.danger[data-v-e7c0fbef]{color:red!important}.switch[data-v-e7c0fbef]{width:4.5rem;height:2.2rem;border-radius:2rem;position:relative;display:flex;align-items:center;background:var(--color-swtich-bg);transition:all .3s}.switch.active[data-v-e7c0fbef]{background:var(--color-active)}.switch.active[data-v-e7c0fbef]:before{right:.2rem}.switch[data-v-e7c0fbef]:before{position:absolute;content:" ";transition:all .3s;right:calc(100% - 2rem);width:1.8rem;height:1.8rem;background:white;border-radius:50%}.setting-modal .modal-root[data-v-36f77223]{z-index:9;background:var(--color-main-bg);border-radius:1.6rem;font-size:1.4rem;overflow:hidden;color:var(--color-font-pure)}.setting-modal .modal-root .modal-header[data-v-36f77223]{padding:2.4rem;display:flex;justify-content:space-between}.setting-modal .modal-root .modal-header .title[data-v-36f77223]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.setting-modal .modal-root .modal-header i[data-v-36f77223]{cursor:pointer;font-size:2.2rem}.setting-modal .modal-root .body[data-v-36f77223]{width:45vw;height:70vh;display:flex}.setting-modal .modal-root .body .left[data-v-36f77223]{display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-size:1.8rem}.setting-modal .modal-root .body .left .tabs[data-v-36f77223]{padding:1rem 2rem;display:flex;flex-direction:column;gap:1rem}.setting-modal .modal-root .body .left .tabs .tab[data-v-36f77223]{cursor:pointer;padding:1rem 1.5rem;border-radius:.8rem;display:flex;align-items:center;gap:1rem}.setting-modal .modal-root .body .left .tabs .tab.active[data-v-36f77223]{background:var(--color-item-bg)}.setting-modal .modal-root .body .modal-content[data-v-36f77223]{background:var(--color-second-bg);flex:1;height:100%;box-sizing:border-box;padding:1rem 1rem 1rem 2rem;border-radius:1.6rem;display:flex}.setting-modal .modal-root .body .modal-content .scroll[data-v-36f77223]{flex:1;padding-right:1rem;overflow:auto}.setting-modal .modal-root .body .modal-content .scroll .row[data-v-36f77223]{min-height:5rem;display:flex;justify-content:space-between;align-items:center}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper[data-v-36f77223]{height:3rem;flex:1;display:flex;justify-content:flex-end;align-items:center;gap:var(--space)}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper span[data-v-36f77223]{text-align:right;font-size:1.4rem;color:gray}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper .set-key[data-v-36f77223]{align-items:center}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper .set-key input[data-v-36f77223]{width:15rem;box-sizing:border-box;margin-right:1rem;height:2.8rem;outline:none;font-size:1.6rem;border:1px solid gray;border-radius:.3rem;padding:0 .5rem;background:var(--color-second-bg);color:var(--color-font-1)}.setting-modal .modal-root .body .modal-content .scroll .row .main-title[data-v-36f77223]{font-size:2.2rem;font-weight:700;color:var(--color-font-8)}.setting-modal .modal-root .body .modal-content .scroll .row .item-title[data-v-36f77223]{font-size:1.8rem}.setting-modal .modal-root .body .modal-content .scroll .desc[data-v-36f77223]{margin-bottom:1rem;font-size:1.4rem;text-align:left;color:var(--color-font)}.setting-modal .modal-root .body .modal-content .scroll .project-desc[data-v-36f77223]{text-align:start;font-size:1.6rem;padding-bottom:10rem}.setting-modal .modal-root .body .modal-content .scroll .line[data-v-36f77223]{border-bottom:1px solid #c4c3c3}.loading[data-v-2697baa2]{border:2px solid;border-color:var(--color-loading-2) var(--color-loading-1) var(--color-loading-1) var(--color-loading-1);border-radius:100%;animation:circle-2697baa2 infinite 1s linear;width:2rem;height:2rem}.loading.small[data-v-2697baa2]{width:1.2rem;height:1.2rem}.loading.large[data-v-2697baa2]{width:3rem;height:3rem}@keyframes circle-2697baa2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.base-button[data-v-5a7d79ba]{cursor:pointer;border-radius:.6rem;padding:0 1.5rem;display:inline-flex;align-items:center;justify-content:center;transition:all .3s;height:3.6rem;line-height:1;position:relative}.base-button .loading[data-v-5a7d79ba]{position:absolute}.base-button.disabled[data-v-5a7d79ba]{opacity:.6;cursor:not-allowed;-webkit-user-select:none;user-select:none}.base-button.small[data-v-5a7d79ba]{height:3rem}.base-button.small>span[data-v-5a7d79ba]{font-size:1.3rem}.base-button.large[data-v-5a7d79ba]{height:5rem;font-size:1.8rem;padding:0 2.2rem}.base-button.large>span[data-v-5a7d79ba]{font-size:1.8rem}.base-button[data-v-5a7d79ba]:hover:not(.link){opacity:.7}.base-button.primary[data-v-5a7d79ba]{background:var(--color-active)}.base-button.primary>span[data-v-5a7d79ba]{color:#fff}.base-button.gary[data-v-5a7d79ba]{background:#4b5563}.base-button.link[data-v-5a7d79ba]{border-radius:0;border-bottom:2px solid transparent}.base-button.link>span[data-v-5a7d79ba]{color:var(--color-font-8)}.base-button.link[data-v-5a7d79ba]:hover{border-bottom:2px solid var(--color-font-8)}.base-button.active[data-v-5a7d79ba]{opacity:.4}.key-notice[data-v-5a7d79ba]{margin-left:1rem;display:flex;align-items:center;justify-content:center;font-size:1.2rem;color:#fff}.key-notice .key[data-v-5a7d79ba]{transform:scale(.8)}.pop-confirm-content[data-v-05424197]{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:999}.pop-confirm-content .text[data-v-05424197]{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-05424197]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}.Author[data-v-c450f45f]{display:flex;align-items:center;justify-content:space-between;font-size:1.2rem;position:relative}.Author.expand[data-v-c450f45f]{margin-bottom:0}.Author .Author-left[data-v-c450f45f]{display:flex;align-items:center;max-width:65%;word-break:break-all}.Author .Author-left .username[data-v-c450f45f]{font-size:1.4rem;margin-right:1rem}.Author .Author-left .expand-icon[data-v-c450f45f]{cursor:pointer;margin-right:.8rem;width:2rem;height:2rem;transform:rotate(90deg)}.Author .Author-left .avatar[data-v-c450f45f]{margin-right:1rem;display:flex}.Author .Author-left .avatar img[data-v-c450f45f]{width:2.8rem;height:2.8rem;border-radius:.4rem}.Author .Author-left .texts[data-v-c450f45f]{flex:1}.Author .Author-left .owner[data-v-c450f45f]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.Author .Author-left .dup[data-v-c450f45f]{display:inline-block;background-color:transparent;color:red;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid red;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.Author .Author-left .mod[data-v-c450f45f]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.Author:hover .add-tag[data-v-c450f45f]{display:inline-block}.Author .Author-right[data-v-c450f45f]{position:absolute;right:0;display:flex;align-items:center}.Author .Author-right .toolbar[data-v-c450f45f]{display:flex;align-items:center;color:var(--color-gray);opacity:0;font-weight:700;gap:1rem}.Author .Author-right .toolbar[data-v-c450f45f]:hover{opacity:1}.post-editor-wrapper[data-v-fb753464]{width:100%;box-sizing:border-box;position:relative;overflow:hidden;transition:all .3s;color:var(--color-font)}.post-editor-wrapper.reply-post .post-editor[data-v-fb753464]{border:1px solid var(--color-line)}.post-editor-wrapper.reply-post.isFocus .post-editor[data-v-fb753464]{border:1px solid var(--color-active)}.post-editor-wrapper.reply-comment[data-v-fb753464]{border-radius:var(--box-border-radius);overflow:hidden;border:1px solid var(--color-line)}.post-editor-wrapper.reply-comment.isFocus[data-v-fb753464]{border:1px solid var(--color-active)}.post-editor-wrapper.reply-comment .toolbar[data-v-fb753464]{background:var(--color-editor-toolbar)}.post-editor-wrapper .post-editor[data-v-fb753464]{border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);border:1px solid transparent}.post-editor-wrapper .toolbar[data-v-fb753464]{box-sizing:border-box;padding:.5rem 1rem;width:100%;position:relative;display:flex;justify-content:space-between;align-items:center}.post-editor-wrapper .toolbar .left[data-v-fb753464]{display:flex;gap:1rem}.post-editor-wrapper .toolbar .left svg[data-v-fb753464]{cursor:pointer}.post-editor-wrapper .toolbar .left .upload input[data-v-fb753464]{cursor:pointer;position:absolute;width:20px;height:20px;opacity:0}.post-editor-wrapper .toolbar span[data-v-fb753464]{color:gray;font-size:1.3rem}.post-editor-wrapper .get-cursor[data-v-fb753464]{border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);border:1px solid transparent;position:absolute;top:0;z-index:-100}.post-editor-wrapper .emoticon-pack[data-v-fb753464]{z-index:999999999;border-radius:1rem;padding:1rem;width:31rem;max-width:31rem;height:30rem;max-height:30rem;overflow:auto;background:var(--color-third-bg);border:1px solid var(--color-font-3);box-shadow:0 9px 24px -3px #0000000f,0 4px 8px -1px #0000001f;position:fixed;bottom:11rem;left:14rem}.post-editor-wrapper .emoticon-pack i[data-v-fb753464]{cursor:pointer;position:absolute;right:2rem;font-size:2rem;color:#e2e2e2}.post-editor-wrapper .emoticon-pack .list[data-v-fb753464]{margin:1rem 0}.post-editor-wrapper .emoticon-pack img[data-v-fb753464]{cursor:pointer;width:3rem;height:3rem;padding:.5rem}.post-editor-wrapper .emoticon-pack span[data-v-fb753464]{display:inline-block;cursor:pointer;font-size:2.3rem;padding:.5rem}.v-enter-active[data-v-2c9a538c],.v-leave-active[data-v-2c9a538c]{transition:opacity .3s ease}.v-enter-from[data-v-2c9a538c],.v-leave-to[data-v-2c9a538c]{opacity:0}.username[data-v-2c9a538c]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-2c9a538c]{font-weight:700;color:var(--color-font-8)}.owner[data-v-2c9a538c]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-2c9a538c]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-2c9a538c]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-2c9a538c]{display:inline}.my-tag .remove[data-v-2c9a538c]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-2c9a538c]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-2c9a538c]{margin-left:1rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-2c9a538c]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white}html.dark[data-v-2c9a538c]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}html[data-v-2c9a538c],body[data-v-2c9a538c]{font-size:62.5%}[data-v-2c9a538c]::-webkit-scrollbar{width:1rem;height:1rem}[data-v-2c9a538c]::-webkit-scrollbar-track{background:transparent;border-radius:.2rem}[data-v-2c9a538c]::-webkit-scrollbar-thumb{background:var(--color-scrollbar);border-radius:1rem}.flex[data-v-2c9a538c]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-2c9a538c]{justify-content:flex-end}.flex-center[data-v-2c9a538c]{justify-content:center}.p1[data-v-2c9a538c]{padding:1rem}.p2[data-v-2c9a538c]{padding:2rem}.p0[data-v-2c9a538c]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-2c9a538c]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-2c9a538c]{text-decoration:none;cursor:pointer}a[data-v-2c9a538c]:hover{text-decoration:underline}.tool[data-v-2c9a538c]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-2c9a538c]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-2c9a538c]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-2c9a538c]{cursor:default}.tool.no-hover[data-v-2c9a538c]:hover{background:unset!important}.tool.disabled[data-v-2c9a538c]{cursor:not-allowed}.tool.disabled[data-v-2c9a538c]:hover{background:unset!important}.my-node[data-v-2c9a538c]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-2c9a538c]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-2c9a538c]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-2c9a538c]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-2c9a538c]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-2c9a538c]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-2c9a538c]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-2c9a538c]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-2c9a538c]{position:relative}.modal .mask[data-v-2c9a538c]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-2c9a538c]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-2c9a538c]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-2c9a538c]:first-child{border-left:none}.radio-group2 .active[data-v-2c9a538c]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-2c9a538c]{position:relative;display:inline-flex;justify-content:center}input[data-v-2c9a538c]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-2c9a538c]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-2c9a538c]:focus{border:1px solid var(--color-active)}.danger[data-v-2c9a538c]{color:red!important}.html-wrapper[data-v-2c9a538c]{position:relative}.html-wrapper .mask[data-v-2c9a538c]{max-height:90rem;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,#000 80%,transparent)}.html-wrapper .expand[data-v-2c9a538c]{position:absolute;z-index:1;bottom:2rem;padding:.2rem 1.5rem;border-radius:2rem;border:1px solid gray;background:white;color:gray;left:50%;transform:translate(-50%);cursor:pointer}.comment[data-v-888958af]{width:100%;box-sizing:border-box;margin-top:.6rem}.comment.isLevelOne[data-v-888958af]{border-bottom:1px solid var(--color-line);padding:.8rem 1rem;margin-top:0}.comment.ding[data-v-888958af]{background:rgba(255,255,0,.3)!important}.comment.isSimple .avatar[data-v-888958af],.comment.isSimple .expand-line[data-v-888958af]{display:none}.comment.isSimple .simple-wrapper[data-v-888958af]{padding-left:2.8rem}.comment.isSimple .w[data-v-888958af]{padding-left:0!important;padding-top:.5rem}.comment .comment-content-w .more[data-v-888958af]{text-align:center;margin:2rem 0}.comment .comment-content[data-v-888958af]{display:flex;position:relative}.comment .comment-content .expand-line[data-v-888958af]{cursor:pointer;margin-top:.6rem;width:2.8rem;min-width:2.8rem;position:relative}.comment .comment-content .expand-line[data-v-888958af]:after{position:absolute;left:50%;content:" ";height:100%;width:0;border-right:1px solid var(--color-line)}.comment .comment-content .expand-line[data-v-888958af]:hover:after{border-right:2px solid var(--color-active)}.comment .comment-content .right[data-v-888958af]{flex:1;width:calc(100% - 3rem)}.comment .comment-content .right .w[data-v-888958af]{padding-left:1rem}.comment .comment-content .right .w .post-editor-wrapper[data-v-888958af]{margin-top:1rem}.wrong-wrapper[data-v-888958af]{font-size:1.4rem;margin-bottom:1rem}.wrong-wrapper span[data-v-888958af]{cursor:pointer}.wrong-wrapper .del-line[data-v-888958af]{text-decoration:line-through}.wrong-wrapper .wrong-icon[data-v-888958af]{margin-left:.5rem}.wrong-wrapper .warning[data-v-888958af]{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;padding:1rem 0;margin-top:1rem;font-size:1.2rem;color:red}.toolbar[data-v-c98b8c46]{border-top:1px solid var(--color-line);height:3.8rem;padding-left:.6rem;display:flex;align-items:center;color:var(--color-gray);font-size:1.2rem;font-weight:700;gap:1rem}.comment[data-v-953d8ab1]{width:100%;box-sizing:border-box;display:flex;gap:1rem;padding:1rem;border-bottom:1px solid var(--color-line)}.comment.isSimple .avatar[data-v-953d8ab1]{display:none}.comment.isSimple .reply_content[data-v-953d8ab1]{margin-top:.5rem!important}.comment .avatar[data-v-953d8ab1]{display:flex}.comment .avatar img[data-v-953d8ab1]{width:3.8rem;height:3.8rem;border-radius:.3rem}.comment .comment-body[data-v-953d8ab1]{flex:1;display:flex;flex-direction:column}.comment .comment-body .texts[data-v-953d8ab1]{display:flex;align-items:center}.comment .comment-body .reply_content[data-v-953d8ab1]{margin-top:1rem;max-width:calc(100% - 5rem)}.comment .isRight[data-v-953d8ab1]{align-items:flex-end}.comment .isRight .owner[data-v-953d8ab1],.comment .isRight .mod[data-v-953d8ab1],.comment .isRight .username[data-v-953d8ab1]{margin:0 0 0 1rem}.comment .Author-right[data-v-953d8ab1]{display:flex;flex-direction:column;align-items:center}.comment .Author-right .floor[data-v-953d8ab1]{margin-left:0}.comment .Author-right .jump[data-v-953d8ab1]{color:#929596;margin-top:.4rem;font-size:1.4rem}.comment .point[data-v-953d8ab1]{margin:0 .5rem;font-size:1.4rem;display:flex;gap:.5rem;align-items:center;font-weight:700;color:#000}.sticky{position:sticky;bottom:-2px;z-index:2;background:var(--box-background-hover-color)!important}.sticky[stuck]{box-shadow:0 2px 20px #00000059!important}.v-enter-active[data-v-88f5644d],.v-leave-active[data-v-88f5644d]{transition:opacity .3s ease}.v-enter-from[data-v-88f5644d],.v-leave-to[data-v-88f5644d]{opacity:0}.username[data-v-88f5644d]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-88f5644d]{font-weight:700;color:var(--color-font-8)}.owner[data-v-88f5644d]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-88f5644d]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-88f5644d]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-88f5644d]{display:inline}.my-tag .remove[data-v-88f5644d]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-88f5644d]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-88f5644d]{margin-left:1rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-88f5644d]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white}html.dark[data-v-88f5644d]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}html[data-v-88f5644d],body[data-v-88f5644d]{font-size:62.5%}[data-v-88f5644d]::-webkit-scrollbar{width:1rem;height:1rem}[data-v-88f5644d]::-webkit-scrollbar-track{background:transparent;border-radius:.2rem}[data-v-88f5644d]::-webkit-scrollbar-thumb{background:var(--color-scrollbar);border-radius:1rem}.flex[data-v-88f5644d]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-88f5644d]{justify-content:flex-end}.flex-center[data-v-88f5644d]{justify-content:center}.p1[data-v-88f5644d]{padding:1rem}.p2[data-v-88f5644d]{padding:2rem}.p0[data-v-88f5644d]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-88f5644d]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-88f5644d]{text-decoration:none;cursor:pointer}a[data-v-88f5644d]:hover{text-decoration:underline}.tool[data-v-88f5644d]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-88f5644d]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-88f5644d]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-88f5644d]{cursor:default}.tool.no-hover[data-v-88f5644d]:hover{background:unset!important}.tool.disabled[data-v-88f5644d]{cursor:not-allowed}.tool.disabled[data-v-88f5644d]:hover{background:unset!important}.my-node[data-v-88f5644d]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-88f5644d]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-88f5644d]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-88f5644d]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-88f5644d]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-88f5644d]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-88f5644d]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-88f5644d]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-88f5644d]{position:relative}.modal .mask[data-v-88f5644d]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-88f5644d]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-88f5644d]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-88f5644d]:first-child{border-left:none}.radio-group2 .active[data-v-88f5644d]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-88f5644d]{position:relative;display:inline-flex;justify-content:center}input[data-v-88f5644d]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-88f5644d]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-88f5644d]:focus{border:1px solid var(--color-active)}.danger[data-v-88f5644d]{color:red!important}.Post[data-v-88f5644d]{position:unset!important;background:transparent!important;overflow:unset!important}.Post .main[data-v-88f5644d]{background:transparent!important;padding:unset!important;width:100%!important}.Post .close-btn[data-v-88f5644d]{display:none}.post-detail[data-v-88f5644d]{text-align:start;position:fixed;z-index:99;left:0;right:0;bottom:0;top:0;background:rgba(46,47,48,.8);overflow:auto;font-size:1.4rem;display:flex;justify-content:center;flex-wrap:wrap}.post-detail[data-v-88f5644d] .subtle{background-color:#ecfdf5e6;border-left:4px solid #a7f3d0}.post-detail.isNight[data-v-88f5644d] .subtle{background-color:#1a3332;border-left:4px solid #047857}.post-detail .main[data-v-88f5644d]{display:flex;justify-content:flex-end;padding:3rem 8rem 15rem;background:var(--color-main-bg);position:relative;outline:none}.post-detail .main .main-wrapper[data-v-88f5644d]{width:77rem;padding-bottom:2rem;display:flex;flex-direction:column;align-items:center;position:relative}.post-detail .main .main-wrapper .post-wrapper .header:hover .add-tag[data-v-88f5644d]{display:inline-block}.post-detail .main .main-wrapper .loading-wrapper[data-v-88f5644d]{height:20rem;display:flex;justify-content:center;align-items:center}.post-detail .main .main-wrapper #no-comments-yet[data-v-88f5644d]{color:#a9a9a9;font-weight:700;text-align:center;width:100%;margin-bottom:2rem;box-sizing:border-box}.post-detail .main .relationReply[data-v-88f5644d]{position:fixed;width:25vw;top:6.5rem;bottom:15rem;z-index:100;transform:translate(calc(100% + 2rem));font-size:2rem;overflow:hidden}.post-detail .main .relationReply .my-cell[data-v-88f5644d]{background:var(--color-second-bg);border-radius:var(--box-border-radius) var(--box-border-radius) 0 0}.post-detail .main .relationReply .comments[data-v-88f5644d]{max-height:calc(100% - 4.2rem);overflow:auto;background:var(--color-second-bg);border-radius:0 0 var(--box-border-radius) var(--box-border-radius)}.post-detail .main .call-list[data-v-88f5644d]{z-index:9;position:absolute;top:12rem;border:1px solid var(--color-main-bg);background:var(--color-call-list-bg);box-shadow:0 5px 15px #0000001a;overflow:auto;max-height:30rem;border-radius:var(--box-border-radius);min-width:8rem;box-sizing:content-box}.post-detail .main .call-list .call-item[data-v-88f5644d]{border-top:1px solid var(--color-main-bg);height:3rem;display:flex;padding:0 1rem;align-items:center;cursor:pointer;font-size:14px;box-sizing:border-box}.post-detail .main .call-list .call-item .select[data-v-88f5644d],.post-detail .main .call-list .call-item[data-v-88f5644d]:hover,.post-detail .main .call-list .call-item.select[data-v-88f5644d]{background:var(--color-main-bg);text-decoration:none}.post-detail .main .call-list .call-item[data-v-88f5644d]:nth-child(1){border-top:1px solid transparent}@media screen and (max-width: 1500px){.post-detail .main-wrapper[data-v-88f5644d]{width:65vw!important}}@media screen and (max-width: 1280px){.post-detail .main-wrapper[data-v-88f5644d]{width:75vw!important}}@media screen and (max-width: 960px){.post-detail .main-wrapper[data-v-88f5644d]{width:100vw!important}}.post-detail .scroll-top[data-v-88f5644d]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.5rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg)}.post-detail .refresh[data-v-88f5644d]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.5rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);bottom:23.5rem}.post-detail .scroll-to[data-v-88f5644d]{cursor:pointer;position:fixed;border-radius:.6rem;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.5rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);bottom:15rem;display:flex;flex-direction:column}.post-detail .scroll-to input[data-v-88f5644d]{height:2.6rem;width:3.6rem;font-size:1.4rem;text-align:center;color:gray}.post-detail .close-btn[data-v-88f5644d]{color:#b6b6b6;cursor:pointer;position:fixed;top:3rem;transform:translate(4rem);font-size:2rem}.post-detail .top-reply[data-v-88f5644d]{color:var(--color-font-3);cursor:pointer;font-size:2rem;display:flex}.post-detail .top-reply i[data-v-88f5644d]{padding:0 1rem}.base64_tooltip[data-v-618144eb]{box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;background:var(--color-third-bg);min-height:2.2rem;max-width:20rem;padding:1rem;position:fixed;z-index:9998;display:flex;align-items:center;border-radius:.5rem;cursor:pointer;line-break:anywhere;font-size:1.4rem;color:var(--color-font-8)}.base64_tooltip svg[data-v-618144eb]{margin-left:1rem;min-width:1.8rem}.base64_tooltip[data-v-618144eb] .base-button{margin-left:1rem;margin-top:1rem}.msg[data-v-defce7f2]{cursor:default;margin-bottom:2rem;display:flex;font-size:1.4rem;box-sizing:border-box;border-radius:var(--box-border-radius);color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.msg.success .left[data-v-defce7f2]{background:var(--color-active)}.msg.warning .left[data-v-defce7f2]{background:#c8c002}.msg.error .left[data-v-defce7f2]{background:red}.msg .left[data-v-defce7f2]{border-radius:var(--box-border-radius) 0 0 var(--box-border-radius);display:flex;align-items:center;background:var(--color-active)}.msg .left svg[data-v-defce7f2]{margin:0 .3rem;cursor:pointer}.msg .right[data-v-defce7f2]{flex:1;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center}.tag-modal .wrapper[data-v-674b86aa]{z-index:9;background:var(--color-main-bg);color:var(--color-font-8);border-radius:1.6rem;font-size:1.4rem;padding:2rem 4rem;width:25rem}.tag-modal .wrapper .title[data-v-674b86aa]{font-weight:700}.tag-modal .wrapper .btns[data-v-674b86aa]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1.4rem}.msgs[data-v-b73f4332]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.tag-modal .modal-root[data-v-882b932b]{z-index:9;background:var(--color-second-bg);color:var(--color-font-8);border-radius:1.6rem;font-size:1.4rem;width:50vw;height:70vh;display:flex;flex-direction:column}.tag-modal .modal-root .modal-header[data-v-882b932b]{padding:2.4rem;display:flex;justify-content:space-between}.tag-modal .modal-root .modal-header .title[data-v-882b932b]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.tag-modal .modal-root .modal-header i[data-v-882b932b]{cursor:pointer;font-size:2.2rem}.tag-modal .modal-root .modal-body[data-v-882b932b]{padding:2rem;padding-top:0;flex:1;overflow:auto}.tag-modal .modal-root .modal-body[data-v-882b932b] .cell{padding:2rem}.v-enter-active,.v-leave-active{transition:opacity .3s ease}.v-enter-from,.v-leave-to{opacity:0}.username{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num{font-weight:700;color:var(--color-font-8)}.owner{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove{display:inline}.my-tag .remove{cursor:pointer;margin-left:.5rem;display:none}.add-tag{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor{margin-left:1rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white}html.dark{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}html,body{font-size:62.5%}::-webkit-scrollbar{width:1rem;height:1rem}::-webkit-scrollbar-track{background:transparent;border-radius:.2rem}::-webkit-scrollbar-thumb{background:var(--color-scrollbar);border-radius:1rem}.flex{display:flex;align-items:center;justify-content:space-between}.flex-end{justify-content:flex-end}.flex-center{justify-content:center}.p1{padding:1rem}.p2{padding:2rem}.p0{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a{text-decoration:none;cursor:pointer}a:hover{text-decoration:underline}.tool{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg{width:1.6rem!important;height:1.6rem!important}.tool:hover{background:var(--color-third-bg)}.tool.no-hover{cursor:default}.tool.no-hover:hover{background:unset!important}.tool.disabled{cursor:not-allowed}.tool.disabled:hover{background:unset!important}.my-node{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node:hover{text-decoration:none;background:#e2e2e2}.msgs{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-cell{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option{display:flex;align-items:center;padding:.6rem 0}.modal .option>span{position:relative}.modal .mask{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio:first-child{border-left:none}.radio-group2 .active{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm{position:relative;display:inline-flex;justify-content:center}input{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input:hover{border:1px solid var(--color-input-border-hover)}input:focus{border:1px solid var(--color-active)}.danger{color:red!important}.target-user-tags[data-v-5920e1e4]{background:var(--color-second-bg);color:var(--color-font);word-break:break-all;text-align:start;font-size:1.4rem;box-shadow:0 2px 3px #0000001a;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.target-user-tags .add-tag[data-v-5920e1e4]{display:inline-block}.loaded[data-v-5920e1e4]{font-size:1.4rem;display:flex;align-items:center;gap:1rem} ');
  5927. console.log("V2EX PC端");
  5928. run();
  5929. let vueApp = vue.createApp(App);
  5930. vueApp.config.unwrapInjectedRef = true;
  5931. vueApp.mount($section);
  5932. }
  5933.  
  5934. })(Vue);