linuxdo 增强插件

linux.do 增强插件,功能持续更新,欢迎提出新想法!

当前为 2024-08-30 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name linuxdo 增强插件
  3. // @namespace https://github.com/dlzmoe/linuxdo-scripts
  4. // @version 0.3.7
  5. // @author dlzmoe
  6. // @description linux.do 增强插件,功能持续更新,欢迎提出新想法!
  7. // @license Apache-2.0
  8. // @icon https://cdn.linux.do/uploads/default/optimized/3X/9/d/9dd49731091ce8656e94433a26a3ef36062b3994_2_32x32.png
  9. // @match *://*.linux.do/*
  10. // @require https://unpkg.com/vue@3.4.38/dist/vue.global.prod.js
  11. // @grant GM_addStyle
  12. // @grant GM_xmlhttpRequest
  13. // ==/UserScript==
  14.  
  15. (t=>{if(typeof GM_addStyle=="function"){GM_addStyle(t);return}const i=document.createElement("style");i.textContent=t,document.head.append(i)})(' .item[data-v-c186448b],.item[data-v-4710721f]{border:none!important}input[data-v-b0a388ef]{margin-left:10px;width:60px;border:1px solid #838383;outline:none}a[data-v-f089c8af]{margin-left:10px}a[data-v-f089c8af]:hover{text-decoration:underline}.post-stream.lookopwrapactive .topic-post{display:none!important}.post-stream.lookopwrapactive .topic-post.topic-owner{display:block!important}@keyframes breathAnimation-03f16a8d{0%,to{transform:scale(1);box-shadow:0 0 5px #00000080}50%{transform:scale(1.1);box-shadow:0 0 10px #000000b3}}.breath-animation[data-v-03f16a8d]{animation:breathAnimation-03f16a8d 4s ease-in-out infinite}.minimized[data-v-03f16a8d]{width:50px!important;height:50px!important;border-radius:50%!important;padding:0!important;overflow:hidden;cursor:pointer}.button[data-v-03f16a8d]:hover{background-color:#f0f0f0}#linuxDoLevelPopupContent[data-v-03f16a8d]{line-height:1.6;position:fixed;bottom:20px;right:90px;width:250px;height:auto;background-color:#fff;box-shadow:0 0 10px #00000080;padding:15px;z-index:10000;font-size:14px;border-radius:5px}#linuxDoUserSearch[data-v-03f16a8d]{width:100%;margin-top:10px}.button[data-v-03f16a8d]{margin-top:10px}.minimize-button[data-v-03f16a8d]{position:absolute;top:5px;right:5px;z-index:10001;background:transparent;border:none;cursor:pointer;border-radius:50%;text-align:center;line-height:40px;width:40px;height:40px}.dark-theme #linuxDoLevelPopupContent[data-v-03f16a8d]{background:#535353}.UsageTip[data-v-9fddfa16]{z-index:9999;position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);line-height:2;display:none}.linxudoscripts-tag{background:#29a6a9;color:#fff;font-size:14px!important;padding:0 10px;height:26px;text-align:center;display:inline-flex!important;align-items:center;justify-content:center;border-radius:5px}.menu-table{width:100%}.menu-table td,.menu-table th{padding:10px;font-size:14px}.menu-table .span{cursor:pointer}.menu-table .span+.span{margin-left:10px}.item[data-v-593b8bfe],.item[data-v-9593d75e]{border:none!important}.emojiPicker{top:0;left:100%;position:absolute;display:grid;grid-template-columns:repeat(8,1fr);gap:10px;height:100%;overflow:auto;background-color:#000c;padding:10px;border-radius:5px;z-index:9}.emojiPicker img{cursor:pointer;width:40px;height:40px}.sidebar-section-header-caret.right{transform:rotate(-90deg)}.item select[data-v-3d04f623]{height:28px;border:1px solid #b6b6b6;border-radius:4px;width:180px;margin-left:10px;cursor:pointer}.linuxdoscripts-aidialog{position:fixed;top:0;left:-100%;width:500px;height:100vh;background:#fff;box-shadow:1px 2px 5px #0000003d;z-index:999;padding-top:60px;transition:all .1s linear;opacity:0;visibility:hidden;overflow:hidden}.linuxdoscripts-aidialog.act{left:0;opacity:1;visibility:inherit;overflow:inherit}.item[data-v-4173cfca]{display:flex;align-items:center;justify-content:space-between;border:none}[class*=" el-icon-"],[class^=el-icon-]{display:none}.el-message{z-index:99999999999!important}#linuxdoscripts{font-size:15px}#linuxdoscripts input[type=text]{width:100%}#linuxdoscripts input[type=checkbox]{transform:scale(1.2)}#linuxdoscripts #menu_suspendedball{display:none}#linuxdoscripts img{vertical-align:bottom;max-width:100%;height:auto}#linuxdoscripts .close{position:absolute;right:10px;top:3px;cursor:pointer;font-size:34px;color:#999;transform:rotate(45deg)}#linuxdoscripts .setting-btn{z-index:999;position:fixed;bottom:20px;right:20px}#linuxdoscripts .setting-btn .el-button{margin:15px 0 0;width:50px;height:50px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#919191;color:#fff;font-size:14px;cursor:pointer;transition:all .1s linear;border:none}#linuxdoscripts .setting-btn .el-button svg{margin:0}#linuxdoscripts .setting-btn .el-button:hover{opacity:.9}#linuxdoscripts .hint{margin-top:5px;color:#d94f4f;font-size:14px}#linuxdoscripts dialog{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:700px;background:#fff;color:#333;box-shadow:1px 2px 5px #0003;border-radius:10px;padding:15px;z-index:99999;overflow-x:hidden;box-sizing:border-box;margin:0}#linuxdoscripts dialog .menu-about{padding:5px 0;line-height:2}#linuxdoscripts dialog .menu-about .initialization{color:#999;border-bottom:1px dashed #999;cursor:pointer}#linuxdoscripts dialog .menu-about .initialization:hover{color:#333;border-color:#333}#linuxdoscripts dialog p{margin:0;font-size:14px}#linuxdoscripts .title{font-size:18px;text-align:center;font-weight:600;border-bottom:1px solid #eee;padding-bottom:6px}#linuxdoscripts .btn{border:none;outline:0;min-width:80px;height:32px;display:inline-flex;align-items:center;justify-content:center;background:#1c1c1e;color:#fff;font-size:14px;border-radius:5px;cursor:pointer;transition:all .1s linear}#linuxdoscripts .btn+.btn{margin-left:10px}#linuxdoscripts .btn.saveload{background:#4040b7}#linuxdoscripts .btn:hover{opacity:.9}#linuxdoscripts .menu-nav{display:flex;align-items:center;margin:0;padding:5px 0;border-bottom:1px solid #eee}#linuxdoscripts .menu-nav li{margin-right:10px;border-radius:4px;height:24px;min-width:60px;padding:0 10px;display:inline-flex;align-items:center;justify-content:center;font-size:14px;cursor:pointer}#linuxdoscripts .menu-nav li.act{background:#000;color:#fff}#linuxdoscripts .menu-body{height:480px;overflow-y:auto;padding-right:10px}#linuxdoscripts .menu-body::-webkit-scrollbar{height:8px;width:8px}#linuxdoscripts .menu-body::-webkit-scrollbar-corner{background:none}#linuxdoscripts .menu-body::-webkit-scrollbar-thumb{background:#dee0e1;border-radius:8px}#linuxdoscripts .menu-body .menu-body-item{display:none}#linuxdoscripts .menu-body .menu-body-item.act{display:block}#linuxdoscripts .menu-footer{display:flex;justify-content:space-between;margin-top:10px;padding-top:6px;border-top:1px solid #eee}#linuxdoscripts .menu-footer.hides{opacity:0;visibility:hidden;overflow:hidden}#linuxdoscripts .import{margin-left:auto!important}#linuxdoscripts .import,#linuxdoscripts .export{background:#d1f0ff;color:#559095}#linuxdoscripts .floorlottery{background:#ffb003}#linuxdoscripts .menu-body-item .item{margin-top:12px;border-bottom:1px solid #eee;padding-bottom:10px;display:flex;align-items:center;justify-content:space-between}#linuxdoscripts textarea{font-family:inherit;width:100%;min-height:100px!important;border:1px solid #999;outline:0;padding:5px;font-size:14px;margin:5px 0 0;resize:none;border-radius:0;color:var(--d-input-text-color);background:var(--d-input-bg-color)}#linuxdoscripts textarea:focus{border-color:var(--tertiary);outline:2px solid var(--tertiary);outline-offset:-2px}#linuxdoscripts #floorlotterloading img{width:50px;height:50px}#linuxdoscripts .floorlotterywrap{display:none;width:400px;height:300px;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);margin:0;z-index:999}#linuxdoscripts .floorlotterywrap{width:400px;height:300px}#linuxdoscripts .el-checkbox__inner{border:1px solid #979797}#linuxdoscripts label{margin:0}.linuxdoscripts-opacity{display:none;position:fixed;left:0;top:0;width:100vw;height:100vh;background:#00000080;z-index:9999}.linuxlevel.four{background:linear-gradient(to right,red,#00f);-webkit-background-clip:text;color:transparent}.topic-post{position:relative}.linuxfloor{display:flex;color:#ff8383;width:30px;height:30px;align-items:center;justify-content:center;border-radius:6px;font-size:16px;margin-left:10px}.signature-p{color:#279a36;font-size:14px;word-break:break-word}.topic-list .views{font-weight:400!important;white-space:nowrap!important}.createreply{display:flex;flex-direction:column;max-width:300px}.createreply button{margin-bottom:10px;justify-content:flex-start;text-align:left}.topicpreview-btn{padding:4px 12px!important;font-size:14px!important;opacity:0!important}.topic-list-item:hover .topicpreview-btn{opacity:1!important}.topicpreview{position:fixed;top:0;left:0;z-index:99999;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;display:none}.topicpreview .topicpreview-container{padding:30px 0;border-radius:5px;width:100%;max-width:800px;overflow-y:auto;height:80vh;z-index:10;background:#fafafa;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.topicpreview .topicpreview-container .topicpreview-title{font-size:22px;font-weight:600;padding:0 30px}.topicpreview .topicpreview-container .topicpreview-date{padding:0 30px;color:#666}.topicpreview .topicpreview-container .topicpreview-content>.item{display:flex;align-items:flex-start;padding:20px 30px}.topicpreview .topicpreview-container .topicpreview-content>.item .itemfloor{width:50px;text-align:left;font-size:16px;padding-top:15px;color:#25b4cf}.topicpreview .topicpreview-container .topicpreview-content>.item .itempost{flex:1;background:#fff;padding:15px;border-radius:10px;font-size:15px;color:#666}.topicpreview .topicpreview-container .topicpreview-content>.item .itempost pre code{max-width:620px}.topicpreview .topicpreview-container .topicpreview-content>.item .itempost img{max-width:100%;max-height:100%;height:auto}.topicpreview .topicpreview-container .topicpreview-content>.item .itempost .itemname{font-size:16px;color:#8f3a3a;display:flex;justify-content:space-between;align-items:center}.topicpreview .topicpreview-container .topicpreview-content>.item .itempost .itemname span{color:#9e9e9e;margin-left:20px}.topicpreview .topicpreview-container .topicpreview-content>.item .itempost .itemdate{color:#b9b9b9;font-size:16px;margin-left:auto}.topicpreview-opacity{position:absolute;top:0;left:0;width:100%;height:100%;opacity:1;background:#0009;z-index:9}.body-preview .sidebar-wrapper{display:none!important}body.body-preview #main-outlet-wrapper{display:block!important;padding-left:50px!important}.body-preview .d-header-wrap,.body-preview .menu_suspendedball{display:none!important}.post-activity{white-space:nowrap;display:inline-block;width:100%;text-align:left}.d-header img{height:var(--d-logo-height);width:auto;max-width:100%;object-fit:contain}.aicreated-btn{outline:none;border:1px solid #c5c5c5;background:#eee;display:flex;align-items:center;justify-content:center;line-height:1;font-size:14px;padding:4px 10px;border-radius:3px;margin-bottom:10px}.gpt-summary-wrap{background:#fffbd9;border-radius:5px;padding:10px;font-size:14px;color:#666;margin:0 0 10px;line-height:1.6}.gpt-summary-wrap .airegenerate{display:none;margin-top:6px;outline:none;border:1px solid #eee;background:#ffe27d;color:#626262;padding:4px 10px;cursor:pointer;border-radius:3px}.dark-theme input{background:#999;color:#fff}.dark-theme #linuxdoscripts dialog{background:#333;color:#eee;box-shadow:1px 2px 5px #000;border-color:#737373}.dark-theme #linuxdoscripts dialog .menu-about .initialization:hover{color:#eee;border-color:#eee}.dark-theme #linuxdoscripts .title,.dark-theme #linuxdoscripts .item,.dark-theme #linuxdoscripts .menu-footer{border-color:#4b4b4b}.dark-theme .topicpreview .topicpreview-container{background:#292929}.dark-theme .topicpreview .topicpreview-container .topicpreview-content>.item .itempost{background:#363636;color:#a9a9a9}.dark-theme .topicpreview .topicpreview-container .topicpreview-content>.item .itempost .itemdate,.dark-theme .topicpreview .topicpreview-container .topicpreview-content>.item .itempost .itemname span{color:#6b6b6b}.dark-theme .aicreated-btn{background:#999;color:#fff} ');
  16.  
  17. (function (vue) {
  18. 'use strict';
  19.  
  20. const _export_sfc = (sfc, props) => {
  21. const target = sfc.__vccOpts || sfc;
  22. for (const [key, val] of props) {
  23. target[key] = val;
  24. }
  25. return target;
  26. };
  27. const _sfc_main$z = {
  28. props: ["modelValue", "sort"],
  29. emits: ["update:modelValue"],
  30. data() {
  31. return {
  32. eventListeners: []
  33. };
  34. },
  35. methods: {
  36. init() {
  37. this.removeEventListeners();
  38. $(".topic-list a.title,.topic .search-link").each((index, element) => {
  39. const listener = (event) => {
  40. event.preventDefault();
  41. var url = $(element).attr("href");
  42. window.open(url, "_blank");
  43. };
  44. $(element).on("click", listener);
  45. this.eventListeners.push({ element, listener });
  46. });
  47. },
  48. removeEventListeners() {
  49. this.eventListeners.forEach(({ element, listener }) => {
  50. $(element).off("click", listener);
  51. });
  52. this.eventListeners = [];
  53. }
  54. },
  55. created() {
  56. if (this.modelValue) {
  57. let pollinglength1 = 0;
  58. let pollinglength2 = 0;
  59. setInterval(() => {
  60. if (pollinglength1 != $(".topic-list-body tr").length) {
  61. pollinglength1 = $(".topic-list-body tr").length;
  62. this.init();
  63. }
  64. if (pollinglength2 != $(".post-stream .topic-post").length) {
  65. pollinglength2 = $(".post-stream .topic-post").length;
  66. this.init();
  67. }
  68. }, 1e3);
  69. }
  70. },
  71. beforeDestroy() {
  72. this.removeEventListeners();
  73. }
  74. };
  75. const _hoisted_1$w = { class: "item" };
  76. const _hoisted_2$w = { class: "tit" };
  77. const _hoisted_3$p = ["checked"];
  78. function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
  79. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$w, [
  80. vue.createElementVNode("div", _hoisted_2$w, vue.toDisplayString($props.sort) + ". 是否新标签页打开话题", 1),
  81. vue.createElementVNode("input", {
  82. type: "checkbox",
  83. checked: $props.modelValue,
  84. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  85. }, null, 40, _hoisted_3$p)
  86. ]);
  87. }
  88. const MenuOpenpostblank = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$z]]);
  89. const _sfc_main$y = {
  90. props: ["modelValue", "sort"],
  91. emits: ["update:modelValue"],
  92. methods: {
  93. init() {
  94. if ($("#list-area .show-more").length > 0) {
  95. $("head title").html("【有新话题赶紧来水!!】");
  96. }
  97. }
  98. },
  99. created() {
  100. if (this.modelValue) {
  101. setInterval(() => {
  102. this.init();
  103. }, 1e3);
  104. }
  105. }
  106. };
  107. const _hoisted_1$v = { class: "item" };
  108. const _hoisted_2$v = { class: "tit" };
  109. const _hoisted_3$o = ["checked"];
  110. function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
  111. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$v, [
  112. vue.createElementVNode("div", _hoisted_2$v, vue.toDisplayString($props.sort) + ". 是否开启新话题提醒", 1),
  113. vue.createElementVNode("input", {
  114. type: "checkbox",
  115. checked: $props.modelValue,
  116. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  117. }, null, 40, _hoisted_3$o)
  118. ]);
  119. }
  120. const MenuNewtopicreminder = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$y]]);
  121. const _sfc_main$x = {
  122. props: ["modelValue", "sort"],
  123. emits: ["update:modelValue"],
  124. methods: {
  125. init() {
  126. $("nav.post-controls .show-replies").each(function() {
  127. $(this).click();
  128. });
  129. }
  130. },
  131. created() {
  132. if (this.modelValue) {
  133. let pollinglength2 = 0;
  134. setInterval(() => {
  135. if (pollinglength2 != $(".post-stream .topic-post").length) {
  136. pollinglength2 = $(".post-stream .topic-post").length;
  137. this.init();
  138. }
  139. }, 1e3);
  140. }
  141. }
  142. };
  143. const _hoisted_1$u = { class: "item" };
  144. const _hoisted_2$u = { class: "tit" };
  145. const _hoisted_3$n = ["checked"];
  146. function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
  147. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
  148. vue.createElementVNode("div", _hoisted_2$u, vue.toDisplayString($props.sort) + ". 是否自动展开回复", 1),
  149. vue.createElementVNode("input", {
  150. type: "checkbox",
  151. checked: $props.modelValue,
  152. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  153. }, null, 40, _hoisted_3$n)
  154. ]);
  155. }
  156. const MenuAutoexpandreply = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$x]]);
  157. const _sfc_main$w = {
  158. props: ["modelValue", "sort"],
  159. emits: ["update:modelValue"],
  160. methods: {
  161. formattedDate(time) {
  162. const timestamp = Number(time);
  163. const date = new Date(timestamp);
  164. const now = /* @__PURE__ */ new Date();
  165. const isToday = now.getFullYear() === date.getFullYear() && now.getMonth() === date.getMonth() && now.getDate() === date.getDate();
  166. date.getFullYear();
  167. const month = String(date.getMonth() + 1).padStart(2, "0");
  168. const day = String(date.getDate()).padStart(2, "0");
  169. const hours = String(date.getHours()).padStart(2, "0");
  170. const minutes = String(date.getMinutes()).padStart(2, "0");
  171. return isToday ? `${hours}:${minutes}` : `${month}/${day} ${hours}:${minutes}`;
  172. },
  173. convertToTimestamp(dateStr) {
  174. const datePattern = /(\d{4}) 年 (\d{1,2}) 月 (\d{1,2}) 日 (\d{2}):(\d{2})/;
  175. const dateMatch = dateStr.match(datePattern);
  176. if (dateMatch) {
  177. const year = parseInt(dateMatch[1], 10);
  178. const month = parseInt(dateMatch[2], 10) - 1;
  179. const day = parseInt(dateMatch[3], 10);
  180. const hours = parseInt(dateMatch[4], 10);
  181. const minutes = parseInt(dateMatch[5], 10);
  182. const date = new Date(year, month, day, hours, minutes);
  183. return date.getTime();
  184. }
  185. return null;
  186. },
  187. setInitDate() {
  188. $(".topic-list .age").each((index, element) => {
  189. const str = $(element).attr("title");
  190. const match = str.match(/创建日期:([\s\S]*?)最新:/);
  191. if (match && match[1]) {
  192. const creationDate = match[1].trim();
  193. const timestamp = this.convertToTimestamp(creationDate);
  194. if ($(element).find(".linuxtime").length < 1) {
  195. const now = (/* @__PURE__ */ new Date()).getTime();
  196. const oneDay = 1e3 * 60 * 60 * 24;
  197. const oneWeek = oneDay * 7;
  198. const oneMonth = oneDay * 30;
  199. const threeMonths = oneMonth * 3;
  200. let color;
  201. const timeDiff = now - timestamp;
  202. if (timeDiff < oneDay) {
  203. color = "#45B5AA";
  204. $(element).find(".post-activity").append(
  205. `<span class="linuxtime" style="color:${color}">(${this.formattedDate(
  206. timestamp
  207. )})</span>`
  208. );
  209. } else if (timeDiff < oneWeek) {
  210. color = "#66A586";
  211. $(element).find(".post-activity").append(
  212. `<span class="linuxtime" style="color:${color}">(${this.formattedDate(
  213. timestamp
  214. )})</span>`
  215. );
  216. } else if (timeDiff < oneMonth) {
  217. color = "#CFA94A";
  218. $(element).find(".post-activity").append(
  219. `<span class="linuxtime" style="color:${color}">(${this.formattedDate(
  220. timestamp
  221. )})</span>`
  222. );
  223. } else if (timeDiff < threeMonths) {
  224. color = "#3e8ed2";
  225. $(element).find(".post-activity").append(
  226. `<span class="linuxtime" style="color:${color}">(${this.formattedDate(
  227. timestamp
  228. )})</span>`
  229. );
  230. } else {
  231. color = "#cccccc";
  232. $(element).find(".post-activity").append(
  233. `<span class="linuxtime" style="color:${color}">
  234. (<img style="width:20px;vertical-align:sub;" src="https://linux.do/uploads/default/original/3X/b/d/bdf4a2ff2b3639c4f74462f2da8383f9c5cdb25e.png">${this.formattedDate(
  235. timestamp
  236. )})
  237. </span>`
  238. );
  239. }
  240. }
  241. }
  242. });
  243. },
  244. initDateAndStartPolling() {
  245. setInterval(() => {
  246. this.setInitDate();
  247. this.startPolling();
  248. }, 1e3);
  249. },
  250. startPolling() {
  251. setInterval(() => {
  252. this.setInitDate();
  253. }, 1e4);
  254. }
  255. },
  256. mounted() {
  257. if (this.modelValue) {
  258. this.startPolling();
  259. this.initDateAndStartPolling();
  260. }
  261. }
  262. };
  263. const _hoisted_1$t = { class: "item" };
  264. const _hoisted_2$t = { class: "tit" };
  265. const _hoisted_3$m = ["checked"];
  266. function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
  267. return vue.openBlock(), vue.createElementBlock("div", null, [
  268. vue.createElementVNode("div", _hoisted_1$t, [
  269. vue.createElementVNode("div", _hoisted_2$t, vue.toDisplayString($props.sort) + ". 话题列表显示创建时间", 1),
  270. vue.createElementVNode("input", {
  271. type: "checkbox",
  272. checked: $props.modelValue,
  273. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  274. }, null, 40, _hoisted_3$m)
  275. ])
  276. ]);
  277. }
  278. const MenuShowcreatetime = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w]]);
  279. const _sfc_main$v = {
  280. props: ["modelValue", "sort"],
  281. emits: ["update:modelValue"],
  282. methods: {
  283. formattedDate(time) {
  284. const timestamp = Number(time);
  285. const date = new Date(timestamp);
  286. const now = /* @__PURE__ */ new Date();
  287. const isToday = now.getFullYear() === date.getFullYear() && now.getMonth() === date.getMonth() && now.getDate() === date.getDate();
  288. date.getFullYear();
  289. const month = String(date.getMonth() + 1).padStart(2, "0");
  290. const day = String(date.getDate()).padStart(2, "0");
  291. const hours = String(date.getHours()).padStart(2, "0");
  292. const minutes = String(date.getMinutes()).padStart(2, "0");
  293. return isToday ? `${hours}:${minutes}` : `${month}/${day} ${hours}:${minutes}`;
  294. },
  295. convertToTimestamp(dateStr) {
  296. const datePattern = /(\d{4}) 年 (\d{1,2}) 月 (\d{1,2}) 日 (\d{2}):(\d{2})/;
  297. const dateMatch = dateStr.match(datePattern);
  298. if (dateMatch) {
  299. const year = parseInt(dateMatch[1], 10);
  300. const month = parseInt(dateMatch[2], 10) - 1;
  301. const day = parseInt(dateMatch[3], 10);
  302. const hours = parseInt(dateMatch[4], 10);
  303. const minutes = parseInt(dateMatch[5], 10);
  304. const date = new Date(year, month, day, hours, minutes);
  305. return date.getTime();
  306. }
  307. return null;
  308. },
  309. setInitDate() {
  310. $(".topic-list .age").each((index, element) => {
  311. const str = $(element).attr("title");
  312. const match = str.match(/创建日期:([\s\S]*?)最新:/);
  313. if (match && match[1]) {
  314. const creationDate = match[1].trim();
  315. const timestamp = this.convertToTimestamp(creationDate);
  316. const now = (/* @__PURE__ */ new Date()).getTime();
  317. const oneDay = 1e3 * 60 * 60 * 24;
  318. const oneWeek = oneDay * 7;
  319. const oneMonth = oneDay * 30;
  320. const threeMonths = oneMonth * 3;
  321. let color;
  322. const timeDiff = now - timestamp;
  323. if (timeDiff < oneDay) {
  324. color = "#45B5AA";
  325. $(element).siblings(".views").html(
  326. `<span class="linuxtime" style="color:${color}">${this.formattedDate(
  327. timestamp
  328. )}</span>`
  329. );
  330. } else if (timeDiff < oneWeek) {
  331. color = "#66A586";
  332. $(element).siblings(".views").html(
  333. `<span class="linuxtime" style="color:${color}">${this.formattedDate(
  334. timestamp
  335. )}</span>`
  336. );
  337. } else if (timeDiff < oneMonth) {
  338. color = "#CFA94A";
  339. $(element).siblings(".views").html(
  340. `<span class="linuxtime" style="color:${color}">${this.formattedDate(
  341. timestamp
  342. )}</span>`
  343. );
  344. } else if (timeDiff < threeMonths) {
  345. color = "#3e8ed2";
  346. $(element).siblings(".views").html(
  347. `<span class="linuxtime" style="color:${color}">${this.formattedDate(
  348. timestamp
  349. )}</span>`
  350. );
  351. } else {
  352. color = "#cccccc";
  353. $(element).siblings(".views").html(
  354. `<span class="linuxtime" style="color:${color}">
  355. <img style="width:20px;vertical-align:sub;" src="https://linux.do/uploads/default/original/3X/b/d/bdf4a2ff2b3639c4f74462f2da8383f9c5cdb25e.png">${this.formattedDate(
  356. timestamp
  357. )}
  358. </span>`
  359. );
  360. }
  361. }
  362. });
  363. },
  364. initDateAndStartPolling() {
  365. setInterval(() => {
  366. this.setInitDate();
  367. this.startPolling();
  368. }, 1e3);
  369. },
  370. startPolling() {
  371. setInterval(() => {
  372. this.setInitDate();
  373. }, 1e4);
  374. }
  375. },
  376. mounted() {
  377. if (this.modelValue) {
  378. this.startPolling();
  379. this.initDateAndStartPolling();
  380. }
  381. }
  382. };
  383. const _hoisted_1$s = { class: "item" };
  384. const _hoisted_2$s = { class: "tit" };
  385. const _hoisted_3$l = ["checked"];
  386. function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  387. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$s, [
  388. vue.createElementVNode("div", _hoisted_2$s, vue.toDisplayString($props.sort) + ". 将浏览量替换为创建时间(与 4 互斥,只可选择一个)", 1),
  389. vue.createElementVNode("input", {
  390. type: "checkbox",
  391. checked: $props.modelValue,
  392. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  393. }, null, 40, _hoisted_3$l)
  394. ]);
  395. }
  396. const MenuShowcreatetime1 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v]]);
  397. const _sfc_main$u = {
  398. props: ["modelValue", "sort"],
  399. emits: ["update:modelValue"],
  400. methods: {
  401. init() {
  402. $(".topic-post").each(function() {
  403. const num = $(this).find("article").attr("id").replace(/^post_/, "");
  404. if ($(this).find(".linuxfloor").length < 1) {
  405. $(this).find(".post-infos").append(`<span class="linuxfloor">#${num}</span>`);
  406. }
  407. });
  408. }
  409. },
  410. created() {
  411. if (this.modelValue) {
  412. let pollinglength2 = 0;
  413. setInterval(() => {
  414. if (pollinglength2 != $(".post-stream .topic-post").length) {
  415. pollinglength2 = $(".post-stream .topic-post").length;
  416. this.init();
  417. }
  418. }, 1e3);
  419. }
  420. }
  421. };
  422. const _hoisted_1$r = { class: "item" };
  423. const _hoisted_2$r = { class: "tit" };
  424. const _hoisted_3$k = ["checked"];
  425. function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  426. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$r, [
  427. vue.createElementVNode("div", _hoisted_2$r, vue.toDisplayString($props.sort) + ". 是否显示楼层数", 1),
  428. vue.createElementVNode("input", {
  429. type: "checkbox",
  430. checked: $props.modelValue,
  431. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  432. }, null, 40, _hoisted_3$k)
  433. ]);
  434. }
  435. const MenuShowfloors = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$u]]);
  436. const _sfc_main$t = {
  437. props: ["modelValue", "sort"],
  438. emits: ["update:modelValue"],
  439. created() {
  440. if (this.modelValue) {
  441. $("head").append(`<style>.header-title{display:none!important}</style>`);
  442. }
  443. }
  444. };
  445. const _hoisted_1$q = { class: "item" };
  446. const _hoisted_2$q = { class: "tit" };
  447. const _hoisted_3$j = ["checked"];
  448. function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  449. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$q, [
  450. vue.createElementVNode("div", _hoisted_2$q, vue.toDisplayString($props.sort) + ". 隐藏话题详情顶部大标题", 1),
  451. vue.createElementVNode("input", {
  452. type: "checkbox",
  453. checked: $props.modelValue,
  454. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  455. }, null, 40, _hoisted_3$j)
  456. ]);
  457. }
  458. const MenuHidetopicdetailtitle = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$t]]);
  459. const _sfc_main$s = {
  460. props: ["modelValue", "sort"],
  461. emits: ["update:modelValue"],
  462. methods: {
  463. init() {
  464. if ($(".topicpreview").length < 1) {
  465. $("body").append(`<div class="topicpreview">
  466. <div class="topicpreview-opacity"></div>
  467. <div class="topicpreview-container">
  468. <p style="text-align: center">正在加载中...</p>
  469. </div>
  470. </div>`);
  471. }
  472. $(".topic-list .main-link a.title").each(function() {
  473. const id = $(this).attr("data-topic-id");
  474. if ($(this).parents(".link-top-line").find(".topicpreview-btn").length < 1) {
  475. $(this).parents(".link-top-line").append(
  476. `<button class="btn btn-icon-text btn-default topicpreview-btn" data-id="${id}">预览</button>`
  477. );
  478. }
  479. });
  480. },
  481. setClick() {
  482. $(".topicpreview-btn").each(function() {
  483. $(this).click(function() {
  484. $(".topicpreview").show();
  485. let previewData = {};
  486. let previewurl = $(this).attr("data-id");
  487. fetch(`/t/${previewurl}.json`).then((response) => response.json()).then((data) => {
  488. previewData = data;
  489. function formatDate(isoString) {
  490. const date = new Date(isoString);
  491. const year = date.getFullYear();
  492. const month = String(date.getMonth() + 1).padStart(2, "0");
  493. const day = String(date.getDate()).padStart(2, "0");
  494. const hours = String(date.getHours()).padStart(2, "0");
  495. const minutes = String(date.getMinutes()).padStart(2, "0");
  496. const seconds = String(date.getSeconds()).padStart(2, "0");
  497. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  498. }
  499. $(".topicpreview-container").html(`
  500. <div class="topicpreview-title">${previewData.title}</div>
  501. <p class="topicpreview-date">发帖时间:${formatDate(
  502. previewData.created_at
  503. )}</p>
  504. <div class="topicpreview-content"></div>
  505. <p style="text-align: center;">仅显示前 20 条,<a href="/t/topic/${previewurl}/">查看更多</a></p>
  506. `);
  507. $.each(previewData.post_stream.posts, function(index, post) {
  508. $(".topicpreview .topicpreview-content").append(`
  509. <div class="item">
  510. <span class="itemfloor">${index + 1}楼</span>
  511. <div class="itempost">
  512. <div class="itemname">
  513. ${post.display_username}
  514. <span>${post.username}</span>
  515. <div class="itemdate">${formatDate(post.created_at)}</div>
  516. </div>
  517. ${post.cooked}
  518. </div>
  519. </div>
  520. `);
  521. });
  522. setInterval(() => {
  523. $(".lightbox").attr("href", "javascript:void(0)");
  524. }, 1e3);
  525. });
  526. });
  527. });
  528. $(".topicpreview-opacity").click(function() {
  529. $(".topicpreview").hide();
  530. $(".topicpreview-container").html(
  531. `<p style="text-align: center">正在加载中...</p> `
  532. );
  533. });
  534. }
  535. },
  536. created() {
  537. if (this.modelValue) {
  538. setInterval(() => {
  539. this.init();
  540. }, 1e3);
  541. let pollinglength1 = 0;
  542. let pollinglength2 = 0;
  543. setInterval(() => {
  544. if (pollinglength1 != $(".topic-list-body tr").length) {
  545. pollinglength1 = $(".topic-list-body tr").length;
  546. this.setClick();
  547. }
  548. if (pollinglength2 != $(".post-stream .topic-post").length) {
  549. pollinglength2 = $(".post-stream .topic-post").length;
  550. this.setClick();
  551. }
  552. }, 1e3);
  553. }
  554. }
  555. };
  556. const _hoisted_1$p = { class: "item" };
  557. const _hoisted_2$p = { class: "tit" };
  558. const _hoisted_3$i = ["checked"];
  559. function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  560. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
  561. vue.createElementVNode("div", _hoisted_2$p, vue.toDisplayString($props.sort) + ". 是否开启话题预览功能", 1),
  562. vue.createElementVNode("input", {
  563. type: "checkbox",
  564. checked: $props.modelValue,
  565. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  566. }, null, 40, _hoisted_3$i)
  567. ]);
  568. }
  569. const MenuTopicpreview = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$s]]);
  570. const _sfc_main$r = {
  571. props: {
  572. value: {
  573. type: String,
  574. default: "前排围观,支持一下\n感谢分享,支持一下\n有点厉害,支持一下"
  575. },
  576. sort: {
  577. type: Number,
  578. required: true
  579. }
  580. },
  581. data() {
  582. return {
  583. textarea: this.value
  584. };
  585. },
  586. watch: {
  587. value(newValue) {
  588. this.textarea = newValue;
  589. }
  590. },
  591. methods: {
  592. handleChange() {
  593. this.$emit("update:value", this.textarea);
  594. },
  595. init() {
  596. this.list = this.textarea.split(/\r?\n/) || [];
  597. if ($(".createreply").length < 1) {
  598. $(".timeline-container .topic-timeline").append(
  599. `<div class="createreply" style="margin-top:4rem;"></div>`
  600. );
  601. this.list.forEach(function(item) {
  602. var $li = $(
  603. '<button class="btn btn-default create reply-to-post no-text btn-icon" type="button"></button>'
  604. ).text(item);
  605. $(".createreply").append($li);
  606. });
  607. $(".createreply button").click(function() {
  608. if ($(".timeline-footer-controls button.create").length != 0) {
  609. $(".timeline-footer-controls button.create")[0].click();
  610. }
  611. if ($("#topic-footer-buttons .topic-footer-main-buttons button.create").length != 0) {
  612. $(
  613. "#topic-footer-buttons .topic-footer-main-buttons button.create"
  614. )[0].click();
  615. }
  616. setTimeout(() => {
  617. let $textarea = $(".d-editor-textarea-wrapper textarea");
  618. let text = $(this).html();
  619. $textarea.focus();
  620. for (let i = 0; i < text.length; i++) {
  621. let char = text[i];
  622. $textarea.val($textarea.val() + char);
  623. let inputEvent = new Event("input", {
  624. bubbles: true,
  625. cancelable: true
  626. });
  627. $textarea[0].dispatchEvent(inputEvent);
  628. let keyEvent = new KeyboardEvent("keydown", {
  629. key: char,
  630. char,
  631. keyCode: char.charCodeAt(0),
  632. which: char.charCodeAt(0),
  633. bubbles: true
  634. });
  635. $textarea[0].dispatchEvent(keyEvent);
  636. }
  637. }, 1e3);
  638. });
  639. }
  640. }
  641. },
  642. created() {
  643. if (this.textarea) {
  644. setInterval(() => {
  645. this.init();
  646. }, 1e3);
  647. }
  648. }
  649. };
  650. const _hoisted_1$o = { class: "item" };
  651. const _hoisted_2$o = { class: "tit" };
  652. function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  653. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  654. vue.createElementVNode("div", _hoisted_1$o, [
  655. vue.createElementVNode("div", _hoisted_2$o, vue.toDisplayString($props.sort) + ". 自定义快捷回复(换行分隔)", 1)
  656. ]),
  657. vue.withDirectives(vue.createElementVNode("textarea", {
  658. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.textarea = $event),
  659. onInput: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)),
  660. placeholder: "前排围观支持一下\\n感谢分享大佬厉害啊\\n有点厉害支持~~"
  661. }, "\r\n ", 544), [
  662. [vue.vModelText, $data.textarea]
  663. ])
  664. ], 64);
  665. }
  666. const MenuCreatereply = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$r], ["__scopeId", "data-v-c186448b"]]);
  667. const _sfc_main$q = {
  668. props: {
  669. value: {
  670. type: String,
  671. default: ""
  672. },
  673. sort: {
  674. type: Number,
  675. required: true
  676. }
  677. },
  678. data() {
  679. return {
  680. textarea: this.value
  681. };
  682. },
  683. watch: {
  684. value(newValue) {
  685. this.textarea = newValue;
  686. }
  687. },
  688. methods: {
  689. handleChange() {
  690. this.$emit("update:value", this.textarea);
  691. },
  692. init() {
  693. this.list = this.textarea.split(",") || [];
  694. var self = this;
  695. $(".topic-list .topic-list-data.posters>a:nth-child(1)").filter((index, element) => {
  696. var user = $(element).attr("data-user-card");
  697. return self.list.indexOf(user) !== -1;
  698. }).parents("tr.topic-list-item").remove();
  699. $(".topic-post .full-name a").filter((index, element) => {
  700. var user = $(element).attr("data-user-card");
  701. return self.list.indexOf(user) !== -1;
  702. }).parents(".topic-post").remove();
  703. }
  704. },
  705. created() {
  706. if (this.textarea) {
  707. let pollinglength1 = 0;
  708. let pollinglength2 = 0;
  709. setInterval(() => {
  710. if (pollinglength1 != $(".topic-list-body tr").length) {
  711. pollinglength1 = $(".topic-list-body tr").length;
  712. this.init();
  713. }
  714. if (pollinglength2 != $(".post-stream .topic-post").length) {
  715. pollinglength2 = $(".post-stream .topic-post").length;
  716. this.init();
  717. }
  718. }, 1e3);
  719. }
  720. }
  721. };
  722. const _hoisted_1$n = { class: "item" };
  723. const _hoisted_2$n = { class: "tit" };
  724. function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  725. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  726. vue.createElementVNode("div", _hoisted_1$n, [
  727. vue.createElementVNode("div", _hoisted_2$n, vue.toDisplayString($props.sort) + ". 屏蔽指定用户(使用英文,分隔)", 1)
  728. ]),
  729. vue.withDirectives(vue.createElementVNode("textarea", {
  730. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.textarea = $event),
  731. onInput: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)),
  732. placeholder: "user1,user2,user3"
  733. }, "\r\n ", 544), [
  734. [vue.vModelText, $data.textarea]
  735. ])
  736. ], 64);
  737. }
  738. const MenuBlockuserlist = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-4710721f"]]);
  739. const _sfc_main$p = {
  740. props: ["modelValue", "sort"],
  741. emits: ["update:modelValue"],
  742. computed: {
  743. value1: {
  744. get() {
  745. return this.modelValue.value1;
  746. },
  747. set(newValue) {
  748. this.$emit("update:modelValue", { ...this.modelValue, value1: newValue });
  749. }
  750. },
  751. value2: {
  752. get() {
  753. return this.modelValue.value2;
  754. },
  755. set(newValue) {
  756. this.$emit("update:modelValue", { ...this.modelValue, value2: newValue });
  757. }
  758. }
  759. },
  760. methods: {
  761. updateValue1(newValue) {
  762. this.value1 = newValue;
  763. }
  764. }
  765. };
  766. const _hoisted_1$m = { class: "item" };
  767. const _hoisted_2$m = { class: "tit" };
  768. const _hoisted_3$h = ["checked"];
  769. function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  770. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
  771. vue.createElementVNode("div", _hoisted_2$m, [
  772. vue.createTextVNode(vue.toDisplayString($props.sort) + ". 是否显示自动阅读按钮,可调节速度默认 10 ", 1),
  773. vue.withDirectives(vue.createElementVNode("input", {
  774. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.value2 = $event),
  775. placeholder: "默认速度 10"
  776. }, null, 512), [
  777. [vue.vModelText, $options.value2]
  778. ])
  779. ]),
  780. vue.createElementVNode("input", {
  781. type: "checkbox",
  782. checked: $options.value1,
  783. onChange: _cache[1] || (_cache[1] = ($event) => $options.updateValue1($event.target.checked))
  784. }, null, 40, _hoisted_3$h)
  785. ]);
  786. }
  787. const MenuAutoRead = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__scopeId", "data-v-b0a388ef"]]);
  788. const _sfc_main$o = {
  789. data() {
  790. return {
  791. num: 10,
  792. // 滚动速度
  793. isScrolling: false,
  794. scrollInterval: null
  795. };
  796. },
  797. methods: {
  798. scrollToBottomSlowly(distancePerStep = this.num, delayPerStep = 50) {
  799. if (this.scrollInterval !== null) {
  800. clearInterval(this.scrollInterval);
  801. }
  802. this.scrollInterval = setInterval(() => {
  803. const documentHeight = document.body.scrollHeight;
  804. const windowHeight = window.innerHeight;
  805. const scrollPosition = window.scrollY;
  806. if (scrollPosition + windowHeight >= documentHeight - 1) {
  807. clearInterval(this.scrollInterval);
  808. this.scrollInterval = null;
  809. } else {
  810. window.scrollBy(0, distancePerStep);
  811. }
  812. }, delayPerStep);
  813. },
  814. autoread() {
  815. if (this.isScrolling) {
  816. clearInterval(this.scrollInterval);
  817. this.scrollInterval = null;
  818. this.isScrolling = false;
  819. } else {
  820. this.scrollToBottomSlowly();
  821. this.isScrolling = true;
  822. }
  823. }
  824. },
  825. created() {
  826. let linxudoscriptssetting = localStorage.getItem("linxudoscriptssetting");
  827. if (linxudoscriptssetting) {
  828. linxudoscriptssetting = JSON.parse(linxudoscriptssetting);
  829. this.num = Number(linxudoscriptssetting.checked8.value2);
  830. }
  831. }
  832. };
  833. const _hoisted_1$l = /* @__PURE__ */ vue.createElementVNode("svg", {
  834. xmlns: "http://www.w3.org/2000/svg",
  835. width: "24",
  836. height: "24",
  837. viewBox: "0 0 24 24",
  838. fill: "currentColor"
  839. }, [
  840. /* @__PURE__ */ vue.createElementVNode("path", {
  841. stroke: "none",
  842. d: "M0 0h24v24H0z",
  843. fill: "none"
  844. }),
  845. /* @__PURE__ */ vue.createElementVNode("path", { d: "M12.088 4.82a10 10 0 0 1 9.412 .314a1 1 0 0 1 .493 .748l.007 .118v13a1 1 0 0 1 -1.5 .866a8 8 0 0 0 -8 0a1 1 0 0 1 -1 0a8 8 0 0 0 -7.733 -.148l-.327 .18l-.103 .044l-.049 .016l-.11 .026l-.061 .01l-.117 .006h-.042l-.11 -.012l-.077 -.014l-.108 -.032l-.126 -.056l-.095 -.056l-.089 -.067l-.06 -.056l-.073 -.082l-.064 -.089l-.022 -.036l-.032 -.06l-.044 -.103l-.016 -.049l-.026 -.11l-.01 -.061l-.004 -.049l-.002 -.068v-13a1 1 0 0 1 .5 -.866a10 10 0 0 1 9.412 -.314l.088 .044l.088 -.044z" })
  846. ], -1);
  847. const _hoisted_2$l = [
  848. _hoisted_1$l
  849. ];
  850. function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  851. return vue.openBlock(), vue.createElementBlock("div", {
  852. class: "el-button",
  853. onClick: _cache[0] || (_cache[0] = (...args) => $options.autoread && $options.autoread(...args)),
  854. title: "自动阅读"
  855. }, _hoisted_2$l);
  856. }
  857. const AutoRead = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o]]);
  858. const name = "linuxdo-scripts";
  859. const version = "0.3.7";
  860. const author = "dlzmoe";
  861. const description = "An enhanced script for the linux.do forum";
  862. const type = "module";
  863. const license = "Apache-2.0";
  864. const scripts = {
  865. dev: "vite",
  866. build: "vite build && py build.py",
  867. preview: "vite preview"
  868. };
  869. const dependencies = {
  870. vue: "^3.4.27"
  871. };
  872. const devDependencies = {
  873. "@vitejs/plugin-vue": "^5.0.4",
  874. less: "^4.1.0",
  875. "less-loader": "^8.0.0",
  876. "style-loader": "^2.0.0",
  877. vite: "^5.2.12",
  878. "vite-plugin-monkey": "^4.0.0"
  879. };
  880. const packageJson = {
  881. name,
  882. version,
  883. author,
  884. description,
  885. type,
  886. "private": true,
  887. license,
  888. scripts,
  889. dependencies,
  890. devDependencies
  891. };
  892. const _sfc_main$n = {
  893. data() {
  894. return {
  895. version: packageJson.version
  896. };
  897. }
  898. };
  899. const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-f089c8af"), n = n(), vue.popScopeId(), n);
  900. const _hoisted_1$k = { class: "item" };
  901. const _hoisted_2$k = { class: "tit" };
  902. const _hoisted_3$g = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("a", {
  903. href: "https://github.com/dlzmoe/linuxdo-scripts",
  904. target: "_blank"
  905. }, "Github 源码", -1));
  906. const _hoisted_4$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("a", {
  907. href: "https://linuxdo-scripts-docs.netlify.app/",
  908. target: "_blank"
  909. }, "使用文档", -1));
  910. function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  911. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
  912. vue.createElementVNode("div", _hoisted_2$k, [
  913. vue.createTextVNode(" 当前版本:" + vue.toDisplayString($data.version) + " ", 1),
  914. _hoisted_3$g,
  915. _hoisted_4$4
  916. ])
  917. ]);
  918. }
  919. const Updates = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-f089c8af"]]);
  920. const _sfc_main$m = {
  921. props: ["modelValue", "sort"],
  922. emits: ["update:modelValue"]
  923. };
  924. const _hoisted_1$j = { class: "item" };
  925. const _hoisted_2$j = { class: "tit" };
  926. const _hoisted_3$f = ["checked"];
  927. function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  928. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
  929. vue.createElementVNode("div", _hoisted_2$j, vue.toDisplayString($props.sort) + ". 是否开启只看楼主", 1),
  930. vue.createElementVNode("input", {
  931. type: "checkbox",
  932. checked: $props.modelValue,
  933. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  934. }, null, 40, _hoisted_3$f)
  935. ]);
  936. }
  937. const MenuLookOP = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m]]);
  938. const _sfc_main$l = {
  939. data() {
  940. return {};
  941. },
  942. methods: {
  943. lookop() {
  944. $(".post-stream").toggleClass("lookopwrapactive");
  945. }
  946. }
  947. };
  948. function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  949. return vue.openBlock(), vue.createElementBlock("div", {
  950. class: "el-button",
  951. onClick: _cache[0] || (_cache[0] = (...args) => $options.lookop && $options.lookop(...args)),
  952. title: "只看楼主"
  953. }, "楼主");
  954. }
  955. const LookOP = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$l]]);
  956. const _sfc_main$k = {
  957. data() {
  958. return {
  959. isMinimized: true,
  960. content: "输入用户名查询等级信息",
  961. username: "",
  962. levelDescriptions: {
  963. 0: "游客",
  964. 1: "基本用户",
  965. 2: "成员",
  966. 3: "活跃用户",
  967. 4: "领导者"
  968. },
  969. levelRequirements: {
  970. 0: { topics_entered: 5, posts_read_count: 30, time_read: 600 },
  971. 1: {
  972. days_visited: 15,
  973. likes_given: 1,
  974. likes_received: 1,
  975. post_count: 3,
  976. topics_entered: 20,
  977. posts_read_count: 100,
  978. time_read: 3600
  979. },
  980. 2: {
  981. days_visited: 50,
  982. likes_given: 30,
  983. likes_received: 20,
  984. post_count: 10,
  985. topics_entered: 0,
  986. posts_read_count: 0
  987. }
  988. }
  989. };
  990. },
  991. methods: {
  992. async fetchAboutData() {
  993. try {
  994. const response = await fetch("/about.json", {
  995. headers: {
  996. Accept: "application/json",
  997. "User-Agent": "Mozilla/5.0"
  998. },
  999. method: "GET"
  1000. });
  1001. if (!response.ok) throw new Error(`HTTP 错误!状态:${response.status}`);
  1002. return await response.json();
  1003. } catch (error) {
  1004. console.error("获取关于页面数据失败:", error);
  1005. this.displayError("获取关于页面数据失败");
  1006. return null;
  1007. }
  1008. },
  1009. async fetchUserData(username) {
  1010. try {
  1011. const response = await fetch(`/u/${username}/summary.json`, {
  1012. headers: {
  1013. Accept: "application/json",
  1014. "User-Agent": "Mozilla/5.0"
  1015. },
  1016. method: "GET"
  1017. });
  1018. if (!response.ok) throw new Error(`HTTP 错误!状态:${response.status}`);
  1019. return await response.json();
  1020. } catch (error) {
  1021. console.error("获取用户数据失败:", error);
  1022. this.displayError("获取用户数据失败");
  1023. return null;
  1024. }
  1025. },
  1026. async handleSearch() {
  1027. if (this.username == "") {
  1028. return false;
  1029. }
  1030. this.content = "正在查询中,请稍后...";
  1031. const username = this.username.trim();
  1032. if (username) {
  1033. const aboutData = await this.fetchAboutData();
  1034. const userData = await this.fetchUserData(username);
  1035. if (userData && aboutData) {
  1036. const userSummary = userData.user_summary;
  1037. const user = userData.users[0];
  1038. const status = aboutData.about.stats;
  1039. this.updatePopupContent(userSummary, user, status);
  1040. }
  1041. }
  1042. },
  1043. updatePopupContent(userSummary, user, status) {
  1044. if (userSummary && user) {
  1045. let content = `<strong>信任等级:</strong>${this.levelDescriptions[user.trust_level]}<br><strong>升级进度:</strong><br>`;
  1046. if (user.trust_level === 3) {
  1047. content += `联系管理员以升级到领导者<br>`;
  1048. } else if (user.trust_level === 4) {
  1049. content += `您已是最高信任等级<br>`;
  1050. } else {
  1051. const requirements = this.levelRequirements[user.trust_level];
  1052. if (user.trust_level === 2) {
  1053. requirements.posts_read_count = Math.min(
  1054. Math.floor(status.posts_30_days / 4),
  1055. 2e4
  1056. );
  1057. requirements.topics_entered = Math.min(
  1058. Math.floor(status.topics_30_days / 4),
  1059. 500
  1060. );
  1061. }
  1062. Object.entries(requirements).forEach(([key, val]) => {
  1063. const currentVal = userSummary[key] || 0;
  1064. const color = currentVal >= val ? "green" : "red";
  1065. content += `${this.translateStat(
  1066. key
  1067. )}: <span style="color: ${color};">${currentVal} / ${val}</span><br>`;
  1068. });
  1069. }
  1070. this.content = content;
  1071. }
  1072. },
  1073. togglePopupSize() {
  1074. this.isMinimized = !this.isMinimized;
  1075. },
  1076. displayError(message) {
  1077. this.content = `<strong>错误:</strong>${message}`;
  1078. },
  1079. translateStat(stat) {
  1080. const translations = {
  1081. days_visited: "访问天数",
  1082. likes_given: "给出的赞",
  1083. likes_received: "收到的赞",
  1084. post_count: "帖子数量",
  1085. posts_read_count: "阅读的帖子数",
  1086. topics_entered: "进入的主题数",
  1087. time_read: "阅读时间"
  1088. };
  1089. return translations[stat] || stat;
  1090. }
  1091. },
  1092. created() {
  1093. setInterval(() => {
  1094. if (!this.username) {
  1095. const src = $("#toggle-current-user img.avatar").attr("src");
  1096. const match = src.match(/\/user_avatar\/linux\.do\/([^\/]+)/);
  1097. if (match && match[1]) {
  1098. this.username = match[1];
  1099. }
  1100. }
  1101. }, 1e3);
  1102. }
  1103. };
  1104. const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-03f16a8d"), n = n(), vue.popScopeId(), n);
  1105. const _hoisted_1$i = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", null, "等级", -1));
  1106. const _hoisted_2$i = [
  1107. _hoisted_1$i
  1108. ];
  1109. const _hoisted_3$e = {
  1110. key: 0,
  1111. id: "linuxDoLevelPopupContent"
  1112. };
  1113. const _hoisted_4$3 = ["innerHTML"];
  1114. const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "d-button-label" }, "搜索", -1));
  1115. const _hoisted_6$2 = [
  1116. _hoisted_5$2
  1117. ];
  1118. function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  1119. return vue.openBlock(), vue.createElementBlock("div", null, [
  1120. vue.createElementVNode("div", {
  1121. class: vue.normalizeClass(["el-button", ["linuxDoLevelPopup", $data.isMinimized ? "minimized" : ""]]),
  1122. onClick: _cache[0] || (_cache[0] = (...args) => $options.togglePopupSize && $options.togglePopupSize(...args)),
  1123. title: "等级查询"
  1124. }, _hoisted_2$i, 2),
  1125. !$data.isMinimized ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$e, [
  1126. vue.createElementVNode("div", { innerHTML: $data.content }, null, 8, _hoisted_4$3),
  1127. vue.withDirectives(vue.createElementVNode("input", {
  1128. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.username = $event),
  1129. autocomplete: "off",
  1130. type: "text",
  1131. placeholder: "请输入用户名...",
  1132. id: "linuxDoUserSearch"
  1133. }, null, 512), [
  1134. [vue.vModelText, $data.username]
  1135. ]),
  1136. vue.createElementVNode("button", {
  1137. onClick: _cache[2] || (_cache[2] = (...args) => $options.handleSearch && $options.handleSearch(...args)),
  1138. class: "btn btn-icon-text",
  1139. type: "button"
  1140. }, _hoisted_6$2)
  1141. ])) : vue.createCommentVNode("", true)
  1142. ]);
  1143. }
  1144. const LevelDiglog = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-03f16a8d"]]);
  1145. const _sfc_main$j = {
  1146. data() {
  1147. return {
  1148. countdown: 5,
  1149. countdownInterval: null,
  1150. countdownVisible: false
  1151. };
  1152. },
  1153. methods: {
  1154. startCountdown() {
  1155. this.countdownVisible = true;
  1156. this.countdown = 5;
  1157. this.countdownInterval = setInterval(() => {
  1158. this.countdown--;
  1159. if (this.countdown < 0) {
  1160. clearInterval(this.countdownInterval);
  1161. this.countdownVisible = false;
  1162. this.hide();
  1163. }
  1164. }, 1e3);
  1165. },
  1166. hide() {
  1167. $(".clicktohide").click(function() {
  1168. $(".UsageTip").hide();
  1169. localStorage.setItem("isShowplugininstallationprompts", true);
  1170. $(".linuxdoscripts-opacity").hide();
  1171. });
  1172. }
  1173. },
  1174. beforeDestroy() {
  1175. clearInterval(this.countdownInterval);
  1176. },
  1177. created() {
  1178. setTimeout(() => {
  1179. const isShowplugininstallationprompts = localStorage.getItem(
  1180. "isShowplugininstallationprompts"
  1181. );
  1182. if (isShowplugininstallationprompts == "true") {
  1183. $(".UsageTip").hide();
  1184. } else {
  1185. $(".UsageTip").show();
  1186. $(".linuxdoscripts-opacity").show();
  1187. this.startCountdown();
  1188. }
  1189. }, 100);
  1190. }
  1191. };
  1192. const _hoisted_1$h = {
  1193. open: "",
  1194. class: "UsageTip"
  1195. };
  1196. const _hoisted_2$h = /* @__PURE__ */ vue.createStaticVNode('<div class="title" data-v-9fddfa16>友情提示</div><br data-v-9fddfa16><div data-v-9fddfa16>佬友你好,你已经成功安装 linuxdo 增强插件啦!<a href="https://linuxdo-scripts-docs.netlify.app/" target="_blank" data-v-9fddfa16>使用文档</a></div><div style="text-decoration:underline;" data-v-9fddfa16> 设置按钮在左下角切换主题的旁边哦~ 有个小齿轮,点击它开始配置功能!! </div><div data-v-9fddfa16>如果可以的话欢迎点个 star 支持一下~ </div><div data-v-9fddfa16><a href="https://github.com/dlzmoe/linuxdo-scripts/" target="_blank" data-v-9fddfa16><img src="https://img.shields.io/github/stars/dlzmoe%2Flinuxdo-scripts?style=for-the-badge&amp;labelColor=%235D5D5D&amp;color=%23E97435" alt="icon" data-v-9fddfa16></a></div><br data-v-9fddfa16>', 7);
  1197. const _hoisted_9$1 = { class: "el-button clicktohide" };
  1198. const _hoisted_10$1 = { key: 0 };
  1199. function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  1200. return vue.openBlock(), vue.createElementBlock("dialog", _hoisted_1$h, [
  1201. _hoisted_2$h,
  1202. vue.createElementVNode("button", _hoisted_9$1, [
  1203. vue.createTextVNode(" 点击我,该提示永远不会出现啦 "),
  1204. $data.countdownVisible ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_10$1, "(" + vue.toDisplayString($data.countdown) + "秒)", 1)) : vue.createCommentVNode("", true)
  1205. ])
  1206. ]);
  1207. }
  1208. const UsageTip = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j], ["__scopeId", "data-v-9fddfa16"]]);
  1209. const _sfc_main$i = {
  1210. props: ["modelValue", "sort"],
  1211. emits: ["update:modelValue"],
  1212. created() {
  1213. if (this.modelValue) {
  1214. $("head").append(`<style>
  1215. .topic-body .cooked{max-height:600px!important;overflow-y:auto!important;}
  1216. </style>`);
  1217. }
  1218. }
  1219. };
  1220. const _hoisted_1$g = { class: "item" };
  1221. const _hoisted_2$g = { class: "tit" };
  1222. const _hoisted_3$d = ["checked"];
  1223. function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  1224. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  1225. vue.createElementVNode("div", _hoisted_2$g, vue.toDisplayString($props.sort) + ". 智能限制楼层高度", 1),
  1226. vue.createElementVNode("input", {
  1227. type: "checkbox",
  1228. checked: $props.modelValue,
  1229. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  1230. }, null, 40, _hoisted_3$d)
  1231. ]);
  1232. }
  1233. const MenuFloorHeight = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$i]]);
  1234. const _sfc_main$h = {
  1235. data() {
  1236. return {
  1237. tableData: []
  1238. };
  1239. },
  1240. methods: {
  1241. // 修改标签
  1242. editTags(item) {
  1243. var tags = prompt(`对 @${item.name} 修改标签`, item.tags);
  1244. if (tags == null) {
  1245. return item.tags;
  1246. }
  1247. if (tags != item.tags) {
  1248. var existingPerson = this.tableData.find((items) => items.name === item.name);
  1249. if (existingPerson) {
  1250. existingPerson.tags = tags;
  1251. } else {
  1252. this.tableData.push({ name: person, tags });
  1253. }
  1254. let settingData1 = localStorage.getItem("linxudoscriptssetting");
  1255. settingData1 = JSON.parse(settingData1);
  1256. settingData1.usertags = this.tableData;
  1257. localStorage.setItem("linxudoscriptssetting", JSON.stringify(settingData1));
  1258. }
  1259. },
  1260. delTags(item) {
  1261. var del = confirm("是否确认删除!");
  1262. if (del == true) {
  1263. this.tableData.splice(item, 1);
  1264. let settingData1 = localStorage.getItem("linxudoscriptssetting");
  1265. settingData1 = JSON.parse(settingData1);
  1266. settingData1.usertags = this.tableData;
  1267. localStorage.setItem("linxudoscriptssetting", JSON.stringify(settingData1));
  1268. }
  1269. }
  1270. },
  1271. created() {
  1272. let settingData = localStorage.getItem("linxudoscriptssetting");
  1273. settingData = JSON.parse(settingData);
  1274. if (!settingData.usertags) {
  1275. settingData.usertags = [];
  1276. }
  1277. settingData.usertags = settingData.usertags.filter((user) => user.tags);
  1278. this.tableData = settingData.usertags;
  1279. setInterval(() => {
  1280. if ($(".addusertag").length < 1) {
  1281. $(".usercard-controls").append(
  1282. `<li><button class="btn addusertag" type="button">添加用户标签</button></li>`
  1283. );
  1284. $(".addusertag").click(function() {
  1285. var person2 = $(".user-card .user-profile-link").attr("href").replace("/u/", "");
  1286. var tags = prompt(`对 @${person2} 设置标签(保存后刷新页面)`, "");
  1287. if (tags == null) {
  1288. return false;
  1289. }
  1290. var lowerCasePerson = person2.toLowerCase();
  1291. var existingPerson = settingData.usertags.find(
  1292. (item) => item.name.toLowerCase() === lowerCasePerson
  1293. );
  1294. if (existingPerson) {
  1295. existingPerson.tags = tags;
  1296. } else {
  1297. settingData.usertags.push({ name: person2, tags });
  1298. }
  1299. localStorage.setItem("linxudoscriptssetting", JSON.stringify(settingData));
  1300. });
  1301. }
  1302. $(".topic-post").each(function() {
  1303. const username = $(this).find(".first a").attr("data-user-card").toLowerCase();
  1304. const userTag = settingData.usertags.find((user) => user.name === username);
  1305. if (userTag) {
  1306. if ($(this).find(".linxudoscripts-tag").length < 1) {
  1307. $(this).find(".names").append(`<span class="linxudoscripts-tag"># ${userTag.tags}</span>`);
  1308. }
  1309. }
  1310. });
  1311. }, 1e3);
  1312. }
  1313. };
  1314. const _hoisted_1$f = { class: "menu-table" };
  1315. const _hoisted_2$f = /* @__PURE__ */ vue.createElementVNode("tr", null, [
  1316. /* @__PURE__ */ vue.createElementVNode("th", null, "用户名"),
  1317. /* @__PURE__ */ vue.createElementVNode("th", null, "标签"),
  1318. /* @__PURE__ */ vue.createElementVNode("th", null, "操作")
  1319. ], -1);
  1320. const _hoisted_3$c = ["onClick"];
  1321. const _hoisted_4$2 = ["onClick"];
  1322. function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  1323. return vue.openBlock(), vue.createElementBlock("div", null, [
  1324. vue.createElementVNode("table", _hoisted_1$f, [
  1325. _hoisted_2$f,
  1326. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.tableData, (item) => {
  1327. return vue.openBlock(), vue.createElementBlock("tr", {
  1328. key: item.name
  1329. }, [
  1330. vue.createElementVNode("td", null, vue.toDisplayString(item.name), 1),
  1331. vue.createElementVNode("td", null, vue.toDisplayString(item.tags), 1),
  1332. vue.createElementVNode("td", null, [
  1333. vue.createElementVNode("span", {
  1334. class: "span",
  1335. onClick: ($event) => $options.editTags(item)
  1336. }, "修改", 8, _hoisted_3$c),
  1337. vue.createElementVNode("span", {
  1338. class: "span",
  1339. onClick: ($event) => $options.delTags(item),
  1340. style: { "color": "#e00" }
  1341. }, "删除!", 8, _hoisted_4$2)
  1342. ])
  1343. ]);
  1344. }), 128))
  1345. ])
  1346. ]);
  1347. }
  1348. const UserTags = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h]]);
  1349. const _sfc_main$g = {
  1350. props: {
  1351. value: {
  1352. type: String,
  1353. default: ""
  1354. },
  1355. sort: {
  1356. type: Number,
  1357. required: true
  1358. }
  1359. },
  1360. data() {
  1361. return {
  1362. textarea: this.value
  1363. };
  1364. },
  1365. watch: {
  1366. value(newValue) {
  1367. this.textarea = newValue;
  1368. }
  1369. },
  1370. methods: {
  1371. handleChange() {
  1372. this.$emit("update:value", this.textarea);
  1373. }
  1374. },
  1375. created() {
  1376. if (this.textarea) {
  1377. $("body").prepend(`<style>${this.textarea}</style>`);
  1378. }
  1379. }
  1380. };
  1381. const _hoisted_1$e = { class: "item" };
  1382. const _hoisted_2$e = { class: "tit" };
  1383. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  1384. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  1385. vue.createElementVNode("div", _hoisted_1$e, [
  1386. vue.createElementVNode("div", _hoisted_2$e, vue.toDisplayString($props.sort) + ". 自定义 CSS(支持 import 引入第三方样式文件)", 1)
  1387. ]),
  1388. vue.withDirectives(vue.createElementVNode("textarea", {
  1389. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.textarea = $event),
  1390. onInput: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)),
  1391. placeholder: "body{font-size:16px;}"
  1392. }, "\r\n ", 544), [
  1393. [vue.vModelText, $data.textarea]
  1394. ])
  1395. ], 64);
  1396. }
  1397. const MenuOtherCss = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__scopeId", "data-v-593b8bfe"]]);
  1398. const _sfc_main$f = {
  1399. props: {
  1400. value: {
  1401. type: String,
  1402. default: ""
  1403. },
  1404. sort: {
  1405. type: Number,
  1406. required: true
  1407. }
  1408. },
  1409. data() {
  1410. return {
  1411. textarea: this.value
  1412. };
  1413. },
  1414. watch: {
  1415. value(newValue) {
  1416. this.textarea = newValue;
  1417. }
  1418. },
  1419. methods: {
  1420. handleChange() {
  1421. this.$emit("update:value", this.textarea);
  1422. },
  1423. init() {
  1424. $(".d-header .title a").html(`<img src="${this.textarea}">`);
  1425. }
  1426. },
  1427. created() {
  1428. if (this.textarea && this.textarea != "") {
  1429. this.init();
  1430. }
  1431. }
  1432. };
  1433. const _hoisted_1$d = { class: "item" };
  1434. const _hoisted_2$d = { class: "tit" };
  1435. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  1436. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  1437. vue.createElementVNode("div", _hoisted_1$d, [
  1438. vue.createElementVNode("div", _hoisted_2$d, vue.toDisplayString($props.sort) + ". 自定义论坛 logo", 1)
  1439. ]),
  1440. vue.withDirectives(vue.createElementVNode("input", {
  1441. type: "text",
  1442. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.textarea = $event),
  1443. onInput: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)),
  1444. placeholder: "输入图片链接"
  1445. }, null, 544), [
  1446. [vue.vModelText, $data.textarea]
  1447. ])
  1448. ], 64);
  1449. }
  1450. const MenuLogoUrl = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-9593d75e"]]);
  1451. const emojiSet = [
  1452. {
  1453. size: "40x40",
  1454. name: "tieba_001",
  1455. url: "/uploads/default/original/3X/9/a/9ac368cc8eafad165bbcf61b0263803d3b2dc2a7.png?v=12"
  1456. },
  1457. {
  1458. size: "40x40",
  1459. name: "tieba_002",
  1460. url: "/uploads/default/original/3X/1/6/16baef70ba80d438e4bb1907ec0c354d680e09df.png?v=12"
  1461. },
  1462. {
  1463. size: "40x40",
  1464. name: "tieba_003",
  1465. url: "/uploads/default/original/3X/2/7/27a55a1370c41f0736ba094bdc8866c6c2878c16.png?v=12"
  1466. },
  1467. {
  1468. size: "40x40",
  1469. name: "tieba_004",
  1470. url: "/uploads/default/original/3X/9/e/9eac534efec605f5a1ac3b2f08d768cfbb4c63a9.png?v=12"
  1471. },
  1472. {
  1473. size: "40x40",
  1474. name: "tieba_005",
  1475. url: "/uploads/default/original/3X/7/4/7493e87cae45656ac7997e8c79c852f9abc80454.png?v=12"
  1476. },
  1477. {
  1478. size: "40x40",
  1479. name: "tieba_006",
  1480. url: "/uploads/default/original/3X/5/9/596da26825d2a806bd1952b5231f24d212866c1b.png?v=12"
  1481. },
  1482. {
  1483. size: "40x40",
  1484. name: "tieba_007",
  1485. url: "/uploads/default/original/3X/c/0/c055b564a5b580ddfbf651df9a70feaec2b3b8e4.png?v=12"
  1486. },
  1487. {
  1488. size: "40x40",
  1489. name: "tieba_008",
  1490. url: "/uploads/default/original/3X/9/e/9e137b2c72b77ee75454d737b5ad9d043dd49954.png?v=12"
  1491. },
  1492. {
  1493. size: "40x40",
  1494. name: "tieba_009",
  1495. url: "/uploads/default/original/3X/c/7/c756c0f079d25093ed6c7c2feaaa423ead63411c.png?v=12"
  1496. },
  1497. {
  1498. size: "40x40",
  1499. name: "tieba_125",
  1500. url: "/uploads/default/original/3X/1/3/133688dda7ae38a3ddbc9eda0ca99fa8ddbb2704.png?v=12"
  1501. },
  1502. {
  1503. size: "40x40",
  1504. name: "tieba_010",
  1505. url: "/uploads/default/original/3X/2/b/2b58793c54c273c2d3d40722c4def435543084b4.png?v=12"
  1506. },
  1507. {
  1508. size: "40x40",
  1509. name: "tieba_011",
  1510. url: "/uploads/default/original/3X/0/b/0b73771da5b3dc534ad05f1b5fff24325fc0eff7.png?v=12"
  1511. },
  1512. {
  1513. size: "40x40",
  1514. name: "tieba_012",
  1515. url: "/uploads/default/original/3X/9/d/9d9e539ba33d272a5c6468cdb2fa7615695fa788.png?v=12"
  1516. },
  1517. {
  1518. size: "40x40",
  1519. name: "tieba_013",
  1520. url: "/uploads/default/original/3X/e/1/e1aad11157b14d04bc8056573ecb23b5a219d260.png?v=12"
  1521. },
  1522. {
  1523. size: "40x40",
  1524. name: "tieba_014",
  1525. url: "/uploads/default/original/3X/1/2/123defe5ac241618f3bb5246a727be77d996656d.png?v=12"
  1526. },
  1527. {
  1528. size: "40x40",
  1529. name: "tieba_015",
  1530. url: "/uploads/default/original/3X/d/3/d3347ade2d4baf8092696b33c3523e634923b4fe.png?v=12"
  1531. },
  1532. {
  1533. size: "40x40",
  1534. name: "tieba_016",
  1535. url: "/uploads/default/original/3X/2/1/21158038759f6a8630df8507f782a45a6caee004.png?v=12"
  1536. },
  1537. {
  1538. size: "40x40",
  1539. name: "tieba_017",
  1540. url: "/uploads/default/original/3X/7/7/7732425deb158037a8692c45381de35ca83105e6.png?v=12"
  1541. },
  1542. {
  1543. size: "40x40",
  1544. name: "tieba_018",
  1545. url: "/uploads/default/original/3X/7/1/7101ed3a9c047d318454b4eff91d74c06db5eaab.png?v=12"
  1546. },
  1547. {
  1548. size: "40x40",
  1549. name: "tieba_019",
  1550. url: "/uploads/default/original/3X/e/e/eeccf0c1ccda4a4f3b33b4bb502c14e80c324443.png?v=12"
  1551. },
  1552. {
  1553. size: "40x40",
  1554. name: "tieba_020",
  1555. url: "/uploads/default/original/3X/2/8/286824f9727de34e43b906346c0bdb0f854b1e2b.png?v=12"
  1556. },
  1557. {
  1558. size: "40x40",
  1559. name: "tieba_021",
  1560. url: "/uploads/default/original/3X/0/9/09077d62fc78be7a9c19a8c084a35eac8373d241.png?v=12"
  1561. },
  1562. {
  1563. size: "40x40",
  1564. name: "tieba_022",
  1565. url: "/uploads/default/original/3X/6/2/62e7b0ea68e56cc033f78527e62a825a6d9001f2.png?v=12"
  1566. },
  1567. {
  1568. size: "40x40",
  1569. name: "tieba_023",
  1570. url: "/uploads/default/original/3X/d/4/d4e4c57ba70bd38264f0677cf338fa8af3228fbd.png?v=12"
  1571. },
  1572. {
  1573. size: "40x40",
  1574. name: "tieba_024",
  1575. url: "/uploads/default/original/3X/9/c/9c2f3e1ce5982036af66b951a26231b7590e93d4.png?v=12"
  1576. },
  1577. {
  1578. size: "40x40",
  1579. name: "tieba_025",
  1580. url: "/uploads/default/original/3X/e/4/e415f72201d585ac7ccc869a334048006d2b6b9d.png?v=12"
  1581. },
  1582. {
  1583. size: "40x40",
  1584. name: "tieba_026",
  1585. url: "/uploads/default/original/3X/a/d/ad2d245bbe71a05b0bd7a42f435d25524517c7ac.png?v=12"
  1586. },
  1587. {
  1588. size: "40x40",
  1589. name: "tieba_027",
  1590. url: "/uploads/default/original/3X/7/9/7992e06b38f76d7d55a8bc496fa6dd046ba1f0ad.png?v=12"
  1591. },
  1592. {
  1593. size: "40x40",
  1594. name: "tieba_028",
  1595. url: "/uploads/default/original/3X/4/4/448d0cb933ec8016797faef8c8dcfb8822e43326.png?v=12"
  1596. },
  1597. {
  1598. size: "40x40",
  1599. name: "tieba_029",
  1600. url: "/uploads/default/original/3X/8/4/84cd00fd735f11a57b193d62880f55b4ab835c7e.png?v=12"
  1601. },
  1602. {
  1603. size: "40x40",
  1604. name: "tieba_030",
  1605. url: "/uploads/default/original/3X/6/8/68b3471539dbbe40437b0881916feb2d9d4ad254.png?v=12"
  1606. },
  1607. {
  1608. size: "40x40",
  1609. name: "tieba_031",
  1610. url: "/uploads/default/original/3X/8/9/89870339101e10993ef1e55dd9e96f275a6a99f9.png?v=12"
  1611. },
  1612. {
  1613. size: "40x40",
  1614. name: "tieba_032",
  1615. url: "/uploads/default/original/3X/2/5/25936c19b7808540b4a46eb7aeddced05658ec77.png?v=12"
  1616. },
  1617. {
  1618. size: "40x40",
  1619. name: "tieba_033",
  1620. url: "/uploads/default/original/3X/d/f/dff9a29b33ccc0eeffe6d457cee58307246e28ab.png?v=12"
  1621. },
  1622. {
  1623. size: "40x40",
  1624. name: "tieba_034",
  1625. url: "/uploads/default/original/3X/8/b/8b42b74ab6f63dcd02b923cee5ab8f224f32954e.png?v=12"
  1626. },
  1627. {
  1628. size: "40x40",
  1629. name: "tieba_035",
  1630. url: "/uploads/default/original/3X/a/2/a268ad46209a864548c0439854c562d5a1a852e4.png?v=12"
  1631. },
  1632. {
  1633. size: "40x40",
  1634. name: "tieba_036",
  1635. url: "/uploads/default/original/3X/4/9/49b2eba636dba687d98c4254bb00c682194f3556.png?v=12"
  1636. },
  1637. {
  1638. size: "40x40",
  1639. name: "tieba_037",
  1640. url: "/uploads/default/original/3X/5/3/5359fdcfeb8a92794fdf7e0a9e1b7002ba635765.png?v=12"
  1641. },
  1642. {
  1643. size: "40x40",
  1644. name: "tieba_038",
  1645. url: "/uploads/default/original/3X/5/3/535b871b10c649510280825c98e80ee1122613ec.png?v=12"
  1646. },
  1647. {
  1648. size: "40x40",
  1649. name: "tieba_039",
  1650. url: "/uploads/default/original/3X/9/8/98939cb96a8df85af0efdaf02dcc144265e64703.png?v=12"
  1651. },
  1652. {
  1653. size: "40x40",
  1654. name: "tieba_040",
  1655. url: "/uploads/default/original/3X/3/a/3a5fcb80663d73c1f116527c17de7cad37b72c49.png?v=12"
  1656. },
  1657. {
  1658. size: "40x40",
  1659. name: "tieba_041",
  1660. url: "/uploads/default/original/3X/4/0/40cc7fe068c66b38c5e58ee8b59879f572dcd2ca.png?v=12"
  1661. },
  1662. {
  1663. size: "40x40",
  1664. name: "tieba_042",
  1665. url: "/uploads/default/original/3X/e/6/e69395f0a9f391ca3c296aeddf510d0fb1d28fdf.png?v=12"
  1666. },
  1667. {
  1668. size: "40x40",
  1669. name: "tieba_043",
  1670. url: "/uploads/default/original/3X/1/2/123e2d16a27491073fd90994fcd2820a48b2eb1d.png?v=12"
  1671. },
  1672. {
  1673. size: "40x40",
  1674. name: "tieba_044",
  1675. url: "/uploads/default/original/3X/4/d/4d101bae8975480e4c81969242c6db771ccf29df.png?v=12"
  1676. },
  1677. {
  1678. size: "40x40",
  1679. name: "tieba_045",
  1680. url: "/uploads/default/original/3X/6/8/687dca2210abafbcaaf211e27a013c1c0d7d480c.png?v=12"
  1681. },
  1682. {
  1683. size: "40x40",
  1684. name: "tieba_046",
  1685. url: "/uploads/default/original/3X/1/4/14bca5d4cdaca743d0da8bc7f3b23146b53bc534.png?v=12"
  1686. },
  1687. {
  1688. size: "40x40",
  1689. name: "tieba_047",
  1690. url: "/uploads/default/original/3X/c/d/cd555f2a5f605873e85b12ebf5e20affeb86817b.png?v=12"
  1691. },
  1692. {
  1693. size: "40x40",
  1694. name: "tieba_048",
  1695. url: "/uploads/default/original/3X/7/d/7d5173acb48b6662934d93d15ccf03bc4eb4fe1e.png?v=12"
  1696. },
  1697. {
  1698. size: "40x40",
  1699. name: "tieba_049",
  1700. url: "/uploads/default/original/3X/b/7/b774ed3e1792a0c345c3dc6b405398fc330476c4.png?v=12"
  1701. },
  1702. {
  1703. size: "40x40",
  1704. name: "tieba_050",
  1705. url: "/uploads/default/original/3X/6/3/63c1a091c6a7a3a4ba09f79d3df61b5258d1da14.png?v=12"
  1706. },
  1707. {
  1708. size: "40x40",
  1709. name: "tieba_062",
  1710. url: "/uploads/default/original/3X/6/4/644937964bfb3b7ff9519a8c789fba156bc51493.png?v=12"
  1711. },
  1712. {
  1713. size: "40x40",
  1714. name: "tieba_063",
  1715. url: "/uploads/default/original/3X/9/7/977e25c3bb0bb2ffffd7680ef75de860c9bc8eeb.png?v=12"
  1716. },
  1717. {
  1718. size: "40x40",
  1719. name: "tieba_064",
  1720. url: "/uploads/default/original/3X/f/a/fa08552ff47b7347fe769ea71e251784fe46e9c4.png?v=12"
  1721. },
  1722. {
  1723. size: "40x40",
  1724. name: "tieba_065",
  1725. url: "/uploads/default/original/3X/8/d/8ddf6f88c399106b30f08bc6ae594dba19e8da36.png?v=12"
  1726. },
  1727. {
  1728. size: "40x40",
  1729. name: "tieba_066",
  1730. url: "/uploads/default/original/3X/d/c/dccf34dbec6856992ab133e61a1f35417caf5f94.png?v=12"
  1731. },
  1732. {
  1733. size: "40x40",
  1734. name: "tieba_067",
  1735. url: "/uploads/default/original/3X/1/6/16cd502b6c1d42d6d929788d47a96e50313b361f.png?v=12"
  1736. },
  1737. {
  1738. size: "40x40",
  1739. name: "tieba_068",
  1740. url: "/uploads/default/original/3X/a/7/a79256841becf6fc218cf13ed7c9708d2846f472.png?v=12"
  1741. },
  1742. {
  1743. size: "40x40",
  1744. name: "tieba_069",
  1745. url: "/uploads/default/original/3X/1/b/1b279f1106ef55973ae2df3a41edda04181163f6.png?v=12"
  1746. },
  1747. {
  1748. size: "40x40",
  1749. name: "tieba_070",
  1750. url: "/uploads/default/original/3X/1/e/1e8646c269ac7a1cea631b1a2fe107a4b0137dd4.png?v=12"
  1751. },
  1752. {
  1753. size: "40x40",
  1754. name: "tieba_071",
  1755. url: "/uploads/default/original/3X/4/f/4fcf98aa20e5148d8f0dd1e117d99ad52fe7787a.png?v=12"
  1756. },
  1757. {
  1758. size: "40x40",
  1759. name: "tieba_072",
  1760. url: "/uploads/default/original/3X/f/b/fbdca3a08e2eb36d408a9f723251132a6e1a4a1d.png?v=12"
  1761. },
  1762. {
  1763. size: "40x40",
  1764. name: "tieba_073",
  1765. url: "/uploads/default/original/3X/e/f/efcf23577412c17df6354df84eae836ad324d3fc.png?v=12"
  1766. },
  1767. {
  1768. size: "40x40",
  1769. name: "tieba_074",
  1770. url: "/uploads/default/original/3X/4/0/40f2d01d50e90a29680636aa5b5b6808fe4e496b.png?v=12"
  1771. },
  1772. {
  1773. size: "40x40",
  1774. name: "tieba_075",
  1775. url: "/uploads/default/original/3X/b/2/b29012e6751baac99a0b364978e2ba6c68696bb0.png?v=12"
  1776. },
  1777. {
  1778. size: "40x40",
  1779. name: "tieba_076",
  1780. url: "/uploads/default/original/3X/8/e/8eb5b83342386cac1dcf7ee4de785540eb85b941.png?v=12"
  1781. },
  1782. {
  1783. size: "40x40",
  1784. name: "tieba_077",
  1785. url: "/uploads/default/original/3X/0/d/0d84801a6c000b4724a4f998ae2cebbb75088672.png?v=12"
  1786. },
  1787. {
  1788. size: "40x40",
  1789. name: "tieba_078",
  1790. url: "/uploads/default/original/3X/e/8/e8342efcc78faa5225bc94fdc50d595b35de226a.png?v=12"
  1791. },
  1792. {
  1793. size: "40x40",
  1794. name: "tieba_079",
  1795. url: "/uploads/default/original/3X/0/3/03493b5fee0ad65939b223bcb99256c2ad3f92cf.png?v=12"
  1796. },
  1797. {
  1798. size: "40x40",
  1799. name: "tieba_080",
  1800. url: "/uploads/default/original/3X/6/0/6010085f85bbd33ec476d908a3adedf43bf806d2.png?v=12"
  1801. },
  1802. {
  1803. size: "40x40",
  1804. name: "tieba_081",
  1805. url: "/uploads/default/original/3X/4/7/472396c3c1fdc62031460f52fa57e70656559956.png?v=12"
  1806. },
  1807. {
  1808. size: "40x40",
  1809. name: "tieba_082",
  1810. url: "/uploads/default/original/3X/e/8/e8ed47702a901d932ce0f2c926006c569777acae.png?v=12"
  1811. },
  1812. {
  1813. size: "40x40",
  1814. name: "tieba_083",
  1815. url: "/uploads/default/original/3X/8/3/839487b3bbfe38ea8a6d69115c2b18e336c776aa.png?v=12"
  1816. },
  1817. {
  1818. size: "40x40",
  1819. name: "tieba_084",
  1820. url: "/uploads/default/original/3X/d/a/da2b0f67a66746f0702044254460f5f210159dfe.png?v=12"
  1821. },
  1822. {
  1823. size: "40x40",
  1824. name: "tieba_085",
  1825. url: "/uploads/default/original/3X/4/b/4bfbebdb5da3afb04e73813042a2645dea7895a3.png?v=12"
  1826. },
  1827. {
  1828. size: "40x40",
  1829. name: "tieba_086",
  1830. url: "/uploads/default/original/3X/4/0/4035794fd9995594b024ca6695de918567c5b192.png?v=12"
  1831. },
  1832. {
  1833. size: "40x40",
  1834. name: "tieba_087",
  1835. url: "/uploads/default/original/3X/2/e/2e09f3a3c7b27eacbabe9e9614b06b88d5b06343.png?v=12"
  1836. },
  1837. {
  1838. size: "40x40",
  1839. name: "tieba_088",
  1840. url: "/uploads/default/original/3X/8/8/8842b4bbda39465fefb2a5cee47c8b203463e327.png?v=12"
  1841. },
  1842. {
  1843. size: "40x40",
  1844. name: "tieba_089",
  1845. url: "/uploads/default/original/3X/c/2/c20aca50f9432ad01fdaf454e2013083be11909c.png?v=12"
  1846. },
  1847. {
  1848. size: "40x40",
  1849. name: "tieba_090",
  1850. url: "/uploads/default/original/3X/0/e/0eb0e2df1d8287c00069e1bb906f65a7e6f8ac1f.png?v=12"
  1851. },
  1852. {
  1853. size: "40x40",
  1854. name: "tieba_091",
  1855. url: "/uploads/default/original/3X/f/c/fcb760df48754f55cd9030370300880cddc30aeb.png?v=12"
  1856. },
  1857. {
  1858. size: "40x40",
  1859. name: "tieba_092",
  1860. url: "/uploads/default/original/3X/6/d/6d1bcb4bdba18ec87caac87e5c944d81244c0925.png?v=12"
  1861. },
  1862. {
  1863. size: "40x40",
  1864. name: "tieba_093",
  1865. url: "/uploads/default/original/3X/1/7/17e9f52f1b3f19e5fcf1e30b0bef7154b9cb25e9.png?v=12"
  1866. },
  1867. {
  1868. size: "40x40",
  1869. name: "tieba_094",
  1870. url: "/uploads/default/original/3X/d/8/d84a7737da89e36a682519cc53dc36869dc8324a.png?v=12"
  1871. },
  1872. {
  1873. size: "40x40",
  1874. name: "tieba_095",
  1875. url: "/uploads/default/original/3X/d/6/d687f7716a72d08b5ab44bf515b4b47ddf973a16.png?v=12"
  1876. },
  1877. {
  1878. size: "40x40",
  1879. name: "tieba_096",
  1880. url: "/uploads/default/original/3X/9/1/91c4bdc5b31022de2047b0e326f85aac696a61d8.png?v=12"
  1881. },
  1882. {
  1883. size: "40x40",
  1884. name: "tieba_097",
  1885. url: "/uploads/default/original/3X/9/9/992ffdfd94f164debe2ff1ffd686eb9b6d886c30.png?v=12"
  1886. },
  1887. {
  1888. size: "40x40",
  1889. name: "tieba_098",
  1890. url: "/uploads/default/original/3X/a/b/ab4d09d173fe9d726a7df370527e3bb11b86ac37.png?v=12"
  1891. },
  1892. {
  1893. size: "40x40",
  1894. name: "tieba_099",
  1895. url: "/uploads/default/original/3X/9/e/9e07307cddc9a8e1b17374d688dcd9cac0009b36.png?v=12"
  1896. },
  1897. {
  1898. size: "40x40",
  1899. name: "tieba_100",
  1900. url: "/uploads/default/original/3X/0/8/083d87100f8608832766302d52e90c66bfa7b55e.png?v=12"
  1901. },
  1902. {
  1903. size: "40x40",
  1904. name: "tieba_101",
  1905. url: "/uploads/default/original/3X/d/d/ddf9dab71979b328b8cc99a110961278b31af15f.png?v=12"
  1906. },
  1907. {
  1908. size: "40x40",
  1909. name: "tieba_102",
  1910. url: "/uploads/default/original/3X/c/1/c1e30e625a80f2c4e38d15051adc0fbff0cdac85.png?v=12"
  1911. },
  1912. {
  1913. size: "40x40",
  1914. name: "tieba_103",
  1915. url: "/uploads/default/original/3X/4/9/4932179ffb43027d3482ff0a8e79ad3c9f124675.png?v=12"
  1916. },
  1917. {
  1918. size: "40x40",
  1919. name: "tieba_104",
  1920. url: "/uploads/default/original/3X/e/e/ee4698ca2806e680bf8710a138964433caeec7db.png?v=12"
  1921. },
  1922. {
  1923. size: "40x40",
  1924. name: "tieba_105",
  1925. url: "/uploads/default/original/3X/0/4/04b9b300e3259e61fe2e9b6e1a291112fece7aa5.png?v=12"
  1926. },
  1927. {
  1928. size: "40x40",
  1929. name: "tieba_106",
  1930. url: "/uploads/default/original/3X/4/5/45cf9833729d3f67e4b71327c07bda302ac3f792.png?v=12"
  1931. },
  1932. {
  1933. size: "40x40",
  1934. name: "tieba_107",
  1935. url: "/uploads/default/original/3X/6/c/6c0346f696e90c6f804ade9f9d578c8c79c99aac.png?v=12"
  1936. },
  1937. {
  1938. size: "40x40",
  1939. name: "tieba_108",
  1940. url: "/uploads/default/original/3X/a/1/a1ec5ef51c85ebabebe5102b00a1a4caeb08be63.png?v=12"
  1941. },
  1942. {
  1943. size: "40x40",
  1944. name: "tieba_109",
  1945. url: "/uploads/default/original/3X/b/7/b75001317cf515737019777e8a6ed35b5b46ca6c.png?v=12"
  1946. },
  1947. {
  1948. size: "40x40",
  1949. name: "tieba_110",
  1950. url: "/uploads/default/original/3X/0/1/0194cea00dae49fd82321825b52d96e1f8f47732.png?v=12"
  1951. },
  1952. {
  1953. size: "40x40",
  1954. name: "tieba_111",
  1955. url: "/uploads/default/original/3X/b/5/b52e429fb2a84f8e72169c358f00b20e271d9f83.png?v=12"
  1956. },
  1957. {
  1958. size: "40x40",
  1959. name: "tieba_112",
  1960. url: "/uploads/default/original/3X/c/9/c9aa6ca75dbffd21308721ce156da371e82b47f9.png?v=12"
  1961. },
  1962. {
  1963. size: "40x40",
  1964. name: "tieba_113",
  1965. url: "/uploads/default/original/3X/1/c/1cadebeaf0cd36af11665ffa5802ba1c5b143be9.png?v=12"
  1966. },
  1967. {
  1968. size: "40x40",
  1969. name: "tieba_114",
  1970. url: "/uploads/default/original/3X/d/d/dd93786f2a24352b65e23f81d2c24c1a41439cf0.png?v=12"
  1971. },
  1972. {
  1973. size: "40x40",
  1974. name: "tieba_115",
  1975. url: "/uploads/default/original/3X/1/e/1e79d50d73b1afaeffe39574e92154d5d2878787.png?v=12"
  1976. },
  1977. {
  1978. size: "40x40",
  1979. name: "tieba_116",
  1980. url: "/uploads/default/original/3X/d/a/daf75362acc5e46c813a77d8bd143e4e20dd89e5.png?v=12"
  1981. },
  1982. {
  1983. size: "40x40",
  1984. name: "tieba_117",
  1985. url: "/uploads/default/original/3X/f/c/fcca64230d5d15b933b3b9db491f9d3516909b62.png?v=12"
  1986. },
  1987. {
  1988. size: "40x40",
  1989. name: "tieba_118",
  1990. url: "/uploads/default/original/3X/1/8/189ed0fa3c3c01fdf1a99e836f1fa921f679b286.png?v=12"
  1991. },
  1992. {
  1993. size: "40x40",
  1994. name: "tieba_119",
  1995. url: "/uploads/default/original/3X/1/2/1267794a9888419b4d72a2e92162dcb10c08d740.png?v=12"
  1996. },
  1997. {
  1998. size: "40x40",
  1999. name: "tieba_120",
  2000. url: "/uploads/default/original/3X/2/b/2b20054bfb140ededbc4a5b94d529960ab49522a.png?v=12"
  2001. },
  2002. {
  2003. size: "40x40",
  2004. name: "tieba_121",
  2005. url: "/uploads/default/original/3X/5/4/54c6102be172ff5b326edcff59e4ed6485495218.png?v=12"
  2006. },
  2007. {
  2008. size: "40x40",
  2009. name: "tieba_122",
  2010. url: "/uploads/default/original/3X/f/b/fb9a3fe91bb52c30496dd41c739bd829511498fe.png?v=12"
  2011. },
  2012. {
  2013. size: "40x40",
  2014. name: "tieba_123",
  2015. url: "/uploads/default/original/3X/0/6/069a4f21d927aac0db15bb2304ca29f5bdd0f733.png?v=12"
  2016. },
  2017. {
  2018. size: "40x40",
  2019. name: "tieba_124",
  2020. url: "/uploads/default/original/3X/3/7/372798490ea3b5ca4dac38233413355c6c8175ce.png?v=12"
  2021. }
  2022. ];
  2023. setInterval(() => {
  2024. var editor = document.querySelector(".d-editor-button-bar");
  2025. if (!document.querySelector(".emoji-picker-button") && editor) {
  2026. var emojiButton = document.createElement("button");
  2027. emojiButton.classList.add(
  2028. "btn",
  2029. "no-text",
  2030. "btn-icon",
  2031. "emoji",
  2032. "emoji-picker-button"
  2033. );
  2034. emojiButton.title = "插入贴吧表情包";
  2035. emojiButton.innerHTML = "<svg class='fa d-icon d-icon-far-smile svg-icon svg-string' xmlns='http://www.w3.org/2000/svg'><use href='#far-smile'></use></svg>";
  2036. editor.appendChild(emojiButton);
  2037. emojiButton.addEventListener("click", function() {
  2038. var emojiPicker = document.createElement("div");
  2039. emojiPicker.className = "emojiPicker";
  2040. var emojiSetHtml = emojiSet.map(
  2041. (emo) => `<img src="${emo.url}" name="${emo.name}" url="${emo.url}" alt="${emo.size}" onclick="insertEmoji(event)"/>`
  2042. ).join("");
  2043. emojiPicker.innerHTML = emojiSetHtml;
  2044. emojiPicker.style.position = "absolute";
  2045. emojiPicker.style.background = "#FFF";
  2046. emojiPicker.style.border = "1px solid #ddd";
  2047. emojiPicker.style.padding = "10px";
  2048. if (document.body.contains(document.querySelector(".emojiPicker"))) {
  2049. document.querySelector(".emojiPicker").remove();
  2050. } else {
  2051. emojiButton.after(emojiPicker);
  2052. }
  2053. emojiPicker.addEventListener("click", function(e) {
  2054. if (e.target.tagName === "IMG") {
  2055. var textArea = document.querySelector(".d-editor-input");
  2056. if (!textArea) {
  2057. alert("找不到输入框");
  2058. return;
  2059. }
  2060. var emojiMarkdown = `![${e.target.name}|${e.target.alt}](${e.target.src})`;
  2061. var startPos = textArea.selectionStart;
  2062. var endPos = textArea.selectionEnd;
  2063. textArea.value = textArea.value.substring(0, startPos) + emojiMarkdown + textArea.value.substring(endPos, textArea.value.length);
  2064. var event = new Event("input", {
  2065. bubbles: true,
  2066. cancelable: true
  2067. });
  2068. textArea.dispatchEvent(event);
  2069. emojiPicker.remove();
  2070. }
  2071. });
  2072. });
  2073. }
  2074. }, 100);
  2075. const _sfc_main$e = {};
  2076. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  2077. return null;
  2078. }
  2079. const ReplyTBEnjoy = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e]]);
  2080. const _sfc_main$d = {
  2081. props: ["modelValue", "sort"],
  2082. emits: ["update:modelValue"],
  2083. created() {
  2084. if (this.modelValue) {
  2085. let script = document.createElement("script");
  2086. script.src = "https://cdn.jsdelivr.net/npm/pangu@4.0.7/dist/browser/pangu.min.js";
  2087. document.body.appendChild(script);
  2088. setInterval(() => {
  2089. pangu.spacingElementByTagName("p");
  2090. document.addEventListener("DOMContentLoaded", () => {
  2091. pangu.autoSpacingPage();
  2092. });
  2093. }, 1e3);
  2094. }
  2095. }
  2096. };
  2097. const _hoisted_1$c = { class: "item" };
  2098. const _hoisted_2$c = { class: "tit" };
  2099. const _hoisted_3$b = ["checked"];
  2100. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  2101. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
  2102. vue.createElementVNode("div", _hoisted_2$c, vue.toDisplayString($props.sort) + ". 是否开启中英文混排优化显示", 1),
  2103. vue.createElementVNode("input", {
  2104. type: "checkbox",
  2105. checked: $props.modelValue,
  2106. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2107. }, null, 40, _hoisted_3$b)
  2108. ]);
  2109. }
  2110. const MenuPangu = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d]]);
  2111. const _sfc_main$c = {
  2112. props: ["modelValue", "sort"],
  2113. emits: ["update:modelValue"]
  2114. };
  2115. const _hoisted_1$b = { class: "item" };
  2116. const _hoisted_2$b = { class: "tit" };
  2117. const _hoisted_3$a = ["checked"];
  2118. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  2119. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
  2120. vue.createElementVNode("div", _hoisted_2$b, vue.toDisplayString($props.sort) + ". 是否显示等级查询按钮", 1),
  2121. vue.createElementVNode("input", {
  2122. type: "checkbox",
  2123. checked: $props.modelValue,
  2124. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2125. }, null, 40, _hoisted_3$a)
  2126. ]);
  2127. }
  2128. const MenuLevelSearch = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c]]);
  2129. const _sfc_main$b = {
  2130. props: ["modelValue", "sort"],
  2131. emits: ["update:modelValue"],
  2132. created() {
  2133. if (this.modelValue) {
  2134. $("head").append(`<style>
  2135. .user-menu-dropdown-wrapper .notification.read{display:none!important;}
  2136. .user-menu-dropdown-wrapper .notification.unread{display:list-item!important;}
  2137. </style>`);
  2138. }
  2139. }
  2140. };
  2141. const _hoisted_1$a = { class: "item" };
  2142. const _hoisted_2$a = { class: "tit" };
  2143. const _hoisted_3$9 = ["checked"];
  2144. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  2145. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
  2146. vue.createElementVNode("div", _hoisted_2$a, vue.toDisplayString($props.sort) + ". 消息通知仅显示未读", 1),
  2147. vue.createElementVNode("input", {
  2148. type: "checkbox",
  2149. checked: $props.modelValue,
  2150. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2151. }, null, 40, _hoisted_3$9)
  2152. ]);
  2153. }
  2154. const MenuShowUnread = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b]]);
  2155. const _sfc_main$a = {
  2156. props: ["modelValue", "sort"],
  2157. emits: ["update:modelValue"],
  2158. created() {
  2159. if (this.modelValue) {
  2160. $("head").append(`<style>.spoiled,.spoiled *{filter:none!important;}</style>`);
  2161. }
  2162. }
  2163. };
  2164. const _hoisted_1$9 = { class: "item" };
  2165. const _hoisted_2$9 = { class: "tit" };
  2166. const _hoisted_3$8 = ["checked"];
  2167. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  2168. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
  2169. vue.createElementVNode("div", _hoisted_2$9, vue.toDisplayString($props.sort) + ". 是否屏蔽模糊文字", 1),
  2170. vue.createElementVNode("input", {
  2171. type: "checkbox",
  2172. checked: $props.modelValue,
  2173. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2174. }, null, 40, _hoisted_3$8)
  2175. ]);
  2176. }
  2177. const MenuFilterText = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a]]);
  2178. const _sfc_main$9 = {
  2179. props: ["modelValue", "sort"],
  2180. emits: ["update:modelValue"],
  2181. created() {
  2182. if (this.modelValue) {
  2183. $("head").append(`<style>
  2184. .topic-post .cooked+hr,
  2185. .topic-post .signature-img,
  2186. .topic-post .signature-p{display:none}
  2187.  
  2188. .topic-post.current-user-post .cooked+hr,
  2189. .topic-post.current-user-post .signature-img,
  2190. .topic-post.current-user-post .signature-p{display:block}
  2191. </style>`);
  2192. }
  2193. }
  2194. };
  2195. const _hoisted_1$8 = { class: "item" };
  2196. const _hoisted_2$8 = { class: "tit" };
  2197. const _hoisted_3$7 = ["checked"];
  2198. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  2199. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
  2200. vue.createElementVNode("div", _hoisted_2$8, vue.toDisplayString($props.sort) + ". 只看自己签名尾巴", 1),
  2201. vue.createElementVNode("input", {
  2202. type: "checkbox",
  2203. checked: $props.modelValue,
  2204. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2205. }, null, 40, _hoisted_3$7)
  2206. ]);
  2207. }
  2208. const MenuLookmeSign = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
  2209. const _sfc_main$8 = {
  2210. props: ["modelValue", "sort"],
  2211. emits: ["update:modelValue"],
  2212. methods: {
  2213. init() {
  2214. $(".sidebar-custom-sections>div:nth-child(1)").after(`
  2215. <div data-section-name="快速访问" class=" sidebar-section-wrapper sidebar-section--expanded">
  2216. <div class="sidebar-section-header-wrapper sidebar-row" id="MenuQuickAccess">
  2217. <button class="btn no-text sidebar-section-header sidebar-section-header-collapsable btn-transparent">
  2218. <span class="sidebar-section-header-caret">
  2219. <svg class="fa d-icon d-icon-angle-down svg-icon svg-string" xmlns="http://www.w3.org/2000/svg">
  2220. <use href="#angle-down"></use>
  2221. </svg>
  2222. </span>
  2223. <span class="sidebar-section-header-text">快速访问</span>
  2224. </button>
  2225. </div>
  2226. <ul class="sidebar-section-content">
  2227.  
  2228. <li class="sidebar-section-link-wrapper">
  2229. <a href="/bookmarks" class="sidebar-section-link sidebar-row">
  2230. <span class="sidebar-section-link-prefix icon">
  2231. <svg class="fa d-icon d-icon-bookmark svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#bookmark"></use></svg>
  2232. </span>
  2233. <span class="sidebar-section-link-content-text">我的书签</span>
  2234. </a>
  2235. </li>
  2236.  
  2237. </ul>
  2238. </div>
  2239. `);
  2240. $("#MenuQuickAccess").click(function() {
  2241. $(this).find(".sidebar-section-header-caret").toggleClass("right");
  2242. $(this).siblings(".sidebar-section-content").slideToggle();
  2243. });
  2244. }
  2245. },
  2246. created() {
  2247. if (this.modelValue) {
  2248. setInterval(() => {
  2249. if ($("#MenuQuickAccess").length < 1) {
  2250. this.init();
  2251. }
  2252. }, 1e3);
  2253. }
  2254. }
  2255. };
  2256. const _hoisted_1$7 = { class: "item" };
  2257. const _hoisted_2$7 = { class: "tit" };
  2258. const _hoisted_3$6 = ["checked"];
  2259. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  2260. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
  2261. vue.createElementVNode("div", _hoisted_2$7, vue.toDisplayString($props.sort) + ". 开启左侧快速访问", 1),
  2262. vue.createElementVNode("input", {
  2263. type: "checkbox",
  2264. checked: $props.modelValue,
  2265. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2266. }, null, 40, _hoisted_3$6)
  2267. ]);
  2268. }
  2269. const MenuQuickAccess = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]);
  2270. const _sfc_main$7 = {
  2271. props: ["modelValue", "sort"],
  2272. emits: ["update:modelValue"],
  2273. data() {
  2274. return {
  2275. options: [
  2276. { value: "twitter", label: "twitter" },
  2277. { value: "facebook_messenger", label: "facebook_messenger" },
  2278. { value: "google", label: "google" },
  2279. { value: "google_classic", label: "google_classic" },
  2280. { value: "win10", label: "win10" }
  2281. ]
  2282. };
  2283. },
  2284. computed: {
  2285. value1: {
  2286. get() {
  2287. return this.modelValue.value1;
  2288. },
  2289. set(newValue) {
  2290. this.$emit("update:modelValue", { ...this.modelValue, value1: newValue });
  2291. }
  2292. },
  2293. value2: {
  2294. get() {
  2295. return this.modelValue.value2;
  2296. },
  2297. set(newValue) {
  2298. this.$emit("update:modelValue", { ...this.modelValue, value2: newValue });
  2299. }
  2300. }
  2301. },
  2302. methods: {
  2303. handleChange() {
  2304. this.toggleEmojiStyle();
  2305. },
  2306. toggleEmojiStyle() {
  2307. if (this.value1) {
  2308. this.replaceEmojiStyle();
  2309. this.initObserver();
  2310. } else {
  2311. this.observer && this.observer.disconnect();
  2312. }
  2313. },
  2314. replaceEmojiStyle() {
  2315. const imgs = document.querySelectorAll("img");
  2316. imgs.forEach(this.updateImageSrc);
  2317. },
  2318. updateImageSrc(img) {
  2319. const applePath = "images/emoji/apple";
  2320. if (img.src.includes(applePath)) {
  2321. img.src = img.src.replace(applePath, `images/emoji/${this.value2}`);
  2322. }
  2323. },
  2324. processMutations(mutations) {
  2325. mutations.forEach((mutation) => {
  2326. mutation.addedNodes.forEach((node) => {
  2327. if (node.nodeType === 1) {
  2328. if (node.tagName === "IMG") {
  2329. this.updateImageSrc(node);
  2330. } else if (node.querySelectorAll) {
  2331. node.querySelectorAll("img").forEach(this.updateImageSrc);
  2332. }
  2333. }
  2334. });
  2335. if (mutation.type === "attributes" && mutation.target.tagName === "IMG") {
  2336. this.updateImageSrc(mutation.target);
  2337. }
  2338. });
  2339. },
  2340. initObserver() {
  2341. this.observer = new MutationObserver(this.processMutations);
  2342. this.observer.observe(document.body, {
  2343. childList: true,
  2344. subtree: true,
  2345. attributes: true,
  2346. attributeFilter: ["src"]
  2347. });
  2348. }
  2349. },
  2350. mounted() {
  2351. if (this.value1) {
  2352. this.toggleEmojiStyle();
  2353. }
  2354. },
  2355. beforeDestroy() {
  2356. this.observer && this.observer.disconnect();
  2357. }
  2358. };
  2359. const _hoisted_1$6 = { class: "item" };
  2360. const _hoisted_2$6 = { class: "tit" };
  2361. const _hoisted_3$5 = ["value"];
  2362. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  2363. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
  2364. vue.createElementVNode("div", _hoisted_2$6, [
  2365. vue.createTextVNode(vue.toDisplayString($props.sort) + ". 切换论坛表情风格 ", 1),
  2366. vue.withDirectives(vue.createElementVNode("select", {
  2367. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.value2 = $event)
  2368. }, [
  2369. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.options, (item) => {
  2370. return vue.openBlock(), vue.createElementBlock("option", {
  2371. value: item.value,
  2372. key: item.value
  2373. }, vue.toDisplayString(item.label), 9, _hoisted_3$5);
  2374. }), 128))
  2375. ], 512), [
  2376. [vue.vModelSelect, $options.value2]
  2377. ])
  2378. ]),
  2379. vue.withDirectives(vue.createElementVNode("input", {
  2380. type: "checkbox",
  2381. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $options.value1 = $event),
  2382. onChange: _cache[2] || (_cache[2] = (...args) => $options.handleChange && $options.handleChange(...args))
  2383. }, null, 544), [
  2384. [vue.vModelCheckbox, $options.value1]
  2385. ])
  2386. ]);
  2387. }
  2388. const MenureplaceEmojiStyle = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-3d04f623"]]);
  2389. const _sfc_main$6 = {
  2390. props: ["modelValue", "sort"],
  2391. emits: ["update:modelValue"]
  2392. };
  2393. const _hoisted_1$5 = { class: "item" };
  2394. const _hoisted_2$5 = { class: "tit" };
  2395. const _hoisted_3$4 = ["checked"];
  2396. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  2397. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
  2398. vue.createElementVNode("div", _hoisted_2$5, vue.toDisplayString($props.sort) + ". 快速打开 Shared(需提前解锁 Shared)", 1),
  2399. vue.createElementVNode("input", {
  2400. type: "checkbox",
  2401. checked: $props.modelValue,
  2402. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2403. }, null, 40, _hoisted_3$4)
  2404. ]);
  2405. }
  2406. const MenuShowAI = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
  2407. const _sfc_main$5 = {
  2408. data() {
  2409. return {};
  2410. },
  2411. methods: {
  2412. openai() {
  2413. window.open("https://shared.oaifree.com/?temporary-chat=true", "_blank");
  2414. }
  2415. }
  2416. };
  2417. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  2418. return vue.openBlock(), vue.createElementBlock("div", null, [
  2419. vue.createElementVNode("div", {
  2420. class: "el-button",
  2421. style: { "font-size": "18px" },
  2422. onClick: _cache[0] || (_cache[0] = (...args) => $options.openai && $options.openai(...args)),
  2423. type: "primary",
  2424. title: "AI对话"
  2425. }, " AI ")
  2426. ]);
  2427. }
  2428. const AIDialog = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
  2429. const _sfc_main$4 = {
  2430. props: ["modelValue", "sort"],
  2431. emits: ["update:modelValue"],
  2432. created() {
  2433. if (this.modelValue) {
  2434. setInterval(() => {
  2435. if ($(".replyja").length < 1) {
  2436. $("#reply-control .save-or-cancel .create").after(
  2437. `<button class="btn btn-default replyja" style="margin-left:15px;" type="button">ja 字体</button>`
  2438. );
  2439. $(".replyja").click(function() {
  2440. let $textarea = $(".d-editor-textarea-wrapper textarea");
  2441. let text = `<span lang="ja">
  2442.  
  2443. ${$(".d-editor-input").val()}
  2444.  
  2445. </span>`;
  2446. $(".d-editor-textarea-wrapper textarea").val("");
  2447. $textarea.focus();
  2448. for (let i = 0; i < text.length; i++) {
  2449. let char = text[i];
  2450. $textarea.val($textarea.val() + char);
  2451. let inputEvent = new Event("input", {
  2452. bubbles: true,
  2453. cancelable: true
  2454. });
  2455. $textarea[0].dispatchEvent(inputEvent);
  2456. let keyEvent = new KeyboardEvent("keydown", {
  2457. key: char,
  2458. char,
  2459. keyCode: char.charCodeAt(0),
  2460. which: char.charCodeAt(0),
  2461. bubbles: true
  2462. });
  2463. $textarea[0].dispatchEvent(keyEvent);
  2464. }
  2465. });
  2466. }
  2467. }, 1e3);
  2468. }
  2469. }
  2470. };
  2471. const _hoisted_1$4 = { class: "item" };
  2472. const _hoisted_2$4 = { class: "tit" };
  2473. const _hoisted_3$3 = ["checked"];
  2474. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  2475. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
  2476. vue.createElementVNode("div", _hoisted_2$4, vue.toDisplayString($props.sort) + ". 编辑器切换 ja 字体", 1),
  2477. vue.createElementVNode("input", {
  2478. type: "checkbox",
  2479. checked: $props.modelValue,
  2480. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2481. }, null, 40, _hoisted_3$3)
  2482. ]);
  2483. }
  2484. const MenuEditorJa = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
  2485. const _sfc_main$3 = {
  2486. props: {
  2487. value: {
  2488. type: Boolean,
  2489. default: false
  2490. },
  2491. sort: {
  2492. type: Number,
  2493. required: true
  2494. }
  2495. },
  2496. data() {
  2497. return {
  2498. localChecked: this.value
  2499. };
  2500. },
  2501. watch: {
  2502. value(newValue) {
  2503. this.localChecked = newValue;
  2504. }
  2505. },
  2506. methods: {
  2507. handleChange() {
  2508. this.$emit("update:value", this.localChecked);
  2509. }
  2510. },
  2511. created() {
  2512. if (this.localChecked) {
  2513. setInterval(() => {
  2514. if ($(".created_order").length < 1) {
  2515. $("#navigation-bar").prepend(
  2516. `<li title="最新创建" class="latest ember-view created_order"><a href="/latest?order=created">最新创建</a></li>`
  2517. );
  2518. $(".created_order").click(function() {
  2519. setTimeout(() => {
  2520. $("#navigation-bar>li").removeClass("active");
  2521. $(this).addClass("active");
  2522. }, 500);
  2523. });
  2524. }
  2525. }, 1e3);
  2526. }
  2527. }
  2528. };
  2529. const _hoisted_1$3 = { class: "item" };
  2530. const _hoisted_2$3 = { class: "tit" };
  2531. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  2532. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  2533. vue.createElementVNode("div", _hoisted_2$3, vue.toDisplayString($props.sort) + ". 首页新增按创建时间排序", 1),
  2534. vue.withDirectives(vue.createElementVNode("input", {
  2535. type: "checkbox",
  2536. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
  2537. onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
  2538. }, null, 544), [
  2539. [vue.vModelCheckbox, $data.localChecked]
  2540. ])
  2541. ]);
  2542. }
  2543. const MenuCreatedOrder = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
  2544. const _sfc_main$2 = {
  2545. props: {
  2546. value: {
  2547. type: Object,
  2548. default: {
  2549. value1: false,
  2550. value2: false,
  2551. btn: false,
  2552. apikey: "",
  2553. baseurl: "https://api.openai.com",
  2554. model: "gpt-4o-mini",
  2555. prompt: "根据以下帖子内容进行总结,请使用 text 文本返回回答,字数限制 200 字以内,越精炼越好,语言要求返回简体中文,并且进行中英文混排优化。"
  2556. }
  2557. }
  2558. },
  2559. data() {
  2560. return {
  2561. localChecked: this.value
  2562. };
  2563. },
  2564. watch: {
  2565. value(newValue) {
  2566. this.localChecked = newValue;
  2567. }
  2568. },
  2569. methods: {
  2570. handleChange() {
  2571. this.$emit("update:value", this.localChecked);
  2572. },
  2573. getTopicUrl(url) {
  2574. const regex = /^(https:\/\/linux\.do\/t\/topic\/\d+)(\/\d+)?$/;
  2575. const match = url.match(regex);
  2576. return match ? match[1] : url;
  2577. },
  2578. // 是否开启手动生成
  2579. setCreatedBtn() {
  2580. if (this.localChecked.btn) {
  2581. setInterval(() => {
  2582. if ($(".gpt-summary-wrap").length < 1 && $(".aicreated-btn").length < 1) {
  2583. $("#topic-title").after(
  2584. `<button class="aicreated-btn" type="button">AI 总结</button>`
  2585. );
  2586. $(".aicreated-btn").click(() => {
  2587. $(".aicreated-btn").remove();
  2588. $(".gpt-summary-wrap").remove();
  2589. this.getPostContent();
  2590. });
  2591. }
  2592. }, 1e3);
  2593. }
  2594. },
  2595. // 获取帖子内容
  2596. async getPostContent() {
  2597. $(".post-stream").before(
  2598. `<div class="gpt-summary-wrap">
  2599. <div class="gpt-summary">AI 总结:正在使用 AI 总结内容中,请稍后...</div>
  2600. <button type="button" class="airegenerate" style="display:none">重新生成</button>
  2601. </div>`
  2602. );
  2603. $(".airegenerate").click(() => {
  2604. $(".gpt-summary-wrap").remove();
  2605. this.getPostContent();
  2606. });
  2607. let topicUrl = this.getTopicUrl(window.location.href);
  2608. return new Promise((resolve, reject) => {
  2609. GM_xmlhttpRequest({
  2610. method: "GET",
  2611. url: topicUrl + "/1.json",
  2612. headers: {
  2613. accept: "application/json, text/javascript, */*; q=0.01",
  2614. "accept-language": "zh-CN,zh;q=0.9",
  2615. "x-requested-with": "XMLHttpRequest"
  2616. },
  2617. onload: async function(response) {
  2618. const config = JSON.parse(localStorage.getItem("linxudoscriptssetting")).gptdata;
  2619. if (response.status === 200) {
  2620. try {
  2621. const data = JSON.parse(response.responseText);
  2622. const str = data.post_stream.posts[0].cooked;
  2623. const prompt2 = `${config.prompt}
  2624. 帖子内容如下:
  2625. ${str}`;
  2626. const gptResponse = await fetch(`${config.baseurl}/v1/chat/completions`, {
  2627. method: "POST",
  2628. headers: {
  2629. "Content-Type": "application/json",
  2630. Authorization: `Bearer ${config.apikey}`
  2631. },
  2632. body: JSON.stringify({
  2633. model: config.model,
  2634. messages: [
  2635. {
  2636. role: "user",
  2637. content: prompt2
  2638. }
  2639. ],
  2640. temperature: 0.7
  2641. })
  2642. });
  2643. const gptData = await gptResponse.json();
  2644. $(".gpt-summary").html(`AI 总结:${marked.parse(gptData.choices[0].message.content)}`);
  2645. $(".airegenerate").show();
  2646. let summaryCache = JSON.parse(localStorage.getItem("summaryCacheData")) || [];
  2647. const regex = /^(https:\/\/linux\.do\/t\/topic\/\d+)(\/\d+)?$/;
  2648. const match = window.location.href.match(regex)[0];
  2649. let existingObject = summaryCache.find((item) => item.name == match);
  2650. let newObject = {
  2651. name: topicUrl,
  2652. value: gptData.choices[0].message.content
  2653. };
  2654. if (existingObject) {
  2655. existingObject.value = newObject.value;
  2656. } else {
  2657. summaryCache.push(newObject);
  2658. }
  2659. localStorage.setItem("summaryCacheData", JSON.stringify(summaryCache));
  2660. } catch (error) {
  2661. $(".gpt-summary").html(`生成失败,请检查配置是否正确并刷新重试!`);
  2662. $(".airegenerate").show();
  2663. reject(error);
  2664. }
  2665. } else {
  2666. $(".gpt-summary").html(`生成失败,请检查配置是否正确并刷新重试!`);
  2667. $(".airegenerate").show();
  2668. }
  2669. },
  2670. onerror: function(error) {
  2671. reject(error);
  2672. }
  2673. });
  2674. });
  2675. }
  2676. },
  2677. created() {
  2678. if (this.localChecked.value1) {
  2679. let script = document.createElement("script");
  2680. script.src = "https://cdn.jsdelivr.net/npm/marked/marked.min.js";
  2681. document.body.appendChild(script);
  2682. this.setCreatedBtn();
  2683. setInterval(() => {
  2684. if ($(".post-stream").length > 0) {
  2685. if ($(".gpt-summary-wrap").length < 1) {
  2686. let summaryCache = JSON.parse(localStorage.getItem("summaryCacheData")) || [];
  2687. const regex = /^(https:\/\/linux\.do\/t\/topic\/\d+)(\/\d+)?$/;
  2688. const match = window.location.href.match(regex)[0];
  2689. let existingObject = summaryCache.find((item) => item.name === match);
  2690. if (existingObject) {
  2691. $(".post-stream").before(
  2692. `<div class="gpt-summary-wrap">
  2693. <div class="gpt-summary">AI 总结:${marked.parse(existingObject.value)}</div>
  2694. <button type="button" class="airegenerate" style="display:none">重新生成</button>
  2695. </div>`
  2696. );
  2697. $(".airegenerate").click(() => {
  2698. $(".gpt-summary-wrap").remove();
  2699. this.getPostContent();
  2700. });
  2701. }
  2702. }
  2703. if (!this.localChecked.btn) {
  2704. if ($(".gpt-summary-wrap").length < 1) {
  2705. this.getPostContent();
  2706. }
  2707. }
  2708. $(".topic-list .main-link a.title").click(() => {
  2709. $(".gpt-summary-wrap").remove();
  2710. });
  2711. }
  2712. }, 1e3);
  2713. }
  2714. if (this.localChecked.value2) {
  2715. $("body").append("<style>.airegenerate{display:none!important;}</style>");
  2716. }
  2717. }
  2718. };
  2719. const _withScopeId = (n) => (vue.pushScopeId("data-v-4173cfca"), n = n(), vue.popScopeId(), n);
  2720. const _hoisted_1$2 = { class: "item" };
  2721. const _hoisted_2$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "tit" }, "是否开启 gpt 生成话题总结", -1));
  2722. const _hoisted_3$2 = { class: "item" };
  2723. const _hoisted_4$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "tit" }, "是否开启手动总结按钮,默认自动总结", -1));
  2724. const _hoisted_5$1 = { class: "item" };
  2725. const _hoisted_6$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "tit" }, "是否关闭重新生成按钮", -1));
  2726. const _hoisted_7$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { style: { "margin-top": "10px" } }, "注意:baseurl 不带后缀和 '/'", -1));
  2727. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  2728. return vue.openBlock(), vue.createElementBlock("div", null, [
  2729. vue.createElementVNode("div", _hoisted_1$2, [
  2730. _hoisted_2$2,
  2731. vue.withDirectives(vue.createElementVNode("input", {
  2732. type: "checkbox",
  2733. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked.value1 = $event),
  2734. onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
  2735. }, null, 544), [
  2736. [vue.vModelCheckbox, $data.localChecked.value1]
  2737. ])
  2738. ]),
  2739. vue.createElementVNode("div", _hoisted_3$2, [
  2740. _hoisted_4$1,
  2741. vue.withDirectives(vue.createElementVNode("input", {
  2742. type: "checkbox",
  2743. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.localChecked.btn = $event),
  2744. onChange: _cache[3] || (_cache[3] = (...args) => $options.handleChange && $options.handleChange(...args))
  2745. }, null, 544), [
  2746. [vue.vModelCheckbox, $data.localChecked.btn]
  2747. ])
  2748. ]),
  2749. vue.createElementVNode("div", _hoisted_5$1, [
  2750. _hoisted_6$1,
  2751. vue.withDirectives(vue.createElementVNode("input", {
  2752. type: "checkbox",
  2753. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.localChecked.value2 = $event),
  2754. onChange: _cache[5] || (_cache[5] = (...args) => $options.handleChange && $options.handleChange(...args))
  2755. }, null, 544), [
  2756. [vue.vModelCheckbox, $data.localChecked.value2]
  2757. ])
  2758. ]),
  2759. vue.withDirectives(vue.createElementVNode("input", {
  2760. type: "text",
  2761. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.localChecked.apikey = $event),
  2762. placeholder: "sk-xxxxxxxx"
  2763. }, null, 512), [
  2764. [vue.vModelText, $data.localChecked.apikey]
  2765. ]),
  2766. vue.withDirectives(vue.createElementVNode("input", {
  2767. type: "text",
  2768. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.localChecked.baseurl = $event),
  2769. placeholder: "https://api.openai.com"
  2770. }, null, 512), [
  2771. [vue.vModelText, $data.localChecked.baseurl]
  2772. ]),
  2773. vue.withDirectives(vue.createElementVNode("input", {
  2774. type: "text",
  2775. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.localChecked.model = $event),
  2776. placeholder: "模型,如:gpt-4o-mini"
  2777. }, null, 512), [
  2778. [vue.vModelText, $data.localChecked.model]
  2779. ]),
  2780. vue.withDirectives(vue.createElementVNode("textarea", {
  2781. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.localChecked.prompt = $event),
  2782. placeholder: "提示词 prompt"
  2783. }, null, 512), [
  2784. [vue.vModelText, $data.localChecked.prompt]
  2785. ]),
  2786. _hoisted_7$1
  2787. ]);
  2788. }
  2789. const GPTconfig = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-4173cfca"]]);
  2790. const _sfc_main$1 = {
  2791. props: ["modelValue", "sort"],
  2792. emits: ["update:modelValue"],
  2793. created() {
  2794. if (this.modelValue) {
  2795. $(window).on("scroll", function() {
  2796. if ($(window).scrollTop() >= 250) {
  2797. $(".navigation-container").addClass("is-active");
  2798. } else {
  2799. $(".navigation-container").removeClass("is-active");
  2800. }
  2801. });
  2802. $("head").append(`<style>
  2803. .navigation-container.is-active{position:fixed;top:65px;background:#fff!important;z-index:9;box-shadow:1px 3px 7px 0 rgba(0,0,0,.2);margin-left:-30px;padding-left:30px;border-radius:5px;padding-top:10px;padding-right:20px;min-width:1000px;width:auto}
  2804. .dark-theme .navigation-container.is-active{background:#333!important}
  2805. </style>`);
  2806. }
  2807. }
  2808. };
  2809. const _hoisted_1$1 = { class: "item" };
  2810. const _hoisted_2$1 = { class: "tit" };
  2811. const _hoisted_3$1 = ["checked"];
  2812. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  2813. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  2814. vue.createElementVNode("div", _hoisted_2$1, vue.toDisplayString($props.sort) + ". 开启列表页导航栏浮动", 1),
  2815. vue.createElementVNode("input", {
  2816. type: "checkbox",
  2817. checked: $props.modelValue,
  2818. onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
  2819. }, null, 40, _hoisted_3$1)
  2820. ]);
  2821. }
  2822. const MenuStickyNav = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
  2823. const _sfc_main = {
  2824. components: {
  2825. MenuOpenpostblank,
  2826. MenuNewtopicreminder,
  2827. MenuAutoexpandreply,
  2828. MenuShowcreatetime,
  2829. MenuShowcreatetime1,
  2830. MenuShowfloors,
  2831. MenuHidetopicdetailtitle,
  2832. MenuTopicpreview,
  2833. MenuCreatereply,
  2834. MenuBlockuserlist,
  2835. MenuAutoRead,
  2836. AutoRead,
  2837. Updates,
  2838. MenuLookOP,
  2839. LookOP,
  2840. LevelDiglog,
  2841. UsageTip,
  2842. MenuFloorHeight,
  2843. UserTags,
  2844. MenuOtherCss,
  2845. MenuLogoUrl,
  2846. ReplyTBEnjoy,
  2847. MenuPangu,
  2848. MenuLevelSearch,
  2849. MenuShowUnread,
  2850. MenuFilterText,
  2851. MenuLookmeSign,
  2852. MenuQuickAccess,
  2853. MenureplaceEmojiStyle,
  2854. MenuShowAI,
  2855. AIDialog,
  2856. MenuEditorJa,
  2857. MenuCreatedOrder,
  2858. GPTconfig,
  2859. MenuStickyNav
  2860. },
  2861. data() {
  2862. return {
  2863. opacity: false,
  2864. open: false,
  2865. floorlotteryDialog: false,
  2866. floorlotteryval1: "",
  2867. floorlotteryval2: "",
  2868. floorlotterloading: false,
  2869. floorlotterresult: "",
  2870. // 设置数据
  2871. settingData: {
  2872. checked1: false,
  2873. checked2: false,
  2874. checked3: false,
  2875. checked4: false,
  2876. checked41: false,
  2877. checked5: false,
  2878. checked6: false,
  2879. checked7: false,
  2880. checked8: {
  2881. value1: false,
  2882. value2: 10
  2883. },
  2884. checked9: false,
  2885. QuickReply: "前排围观支持一下\n感谢分享大佬厉害啊\n有点厉害支持~~",
  2886. blockList: "",
  2887. checked10: false,
  2888. othercss: "",
  2889. logourl: "",
  2890. checked11: false,
  2891. checked12: false,
  2892. checked13: false,
  2893. checked14: false,
  2894. checked15: false,
  2895. checked16: false,
  2896. checked17: {
  2897. value1: false,
  2898. value2: "twitter"
  2899. },
  2900. checked18: false,
  2901. checked19: false,
  2902. checked20: false,
  2903. gptdata: {
  2904. value1: false,
  2905. value2: false,
  2906. btn: false,
  2907. apikey: "",
  2908. baseurl: "https://api.openai.com",
  2909. model: "gpt-4o-mini",
  2910. prompt: "根据以下帖子内容进行总结,请使用 text 文本返回回答,字数限制 200 字以内,越精炼越好,语言要求返回简体中文,并且进行中英文混排优化。"
  2911. }
  2912. },
  2913. showautoread: false,
  2914. showlookop: false,
  2915. showlevelsearch: false,
  2916. showaidialog: false
  2917. };
  2918. },
  2919. methods: {
  2920. // 关闭弹窗
  2921. closedialog() {
  2922. $(".linuxdoscripts-opacity").hide();
  2923. $("#menu_suspendedball").hide();
  2924. },
  2925. // 保存设置
  2926. save() {
  2927. localStorage.setItem("linxudoscriptssetting", JSON.stringify(this.settingData));
  2928. $(".linuxdoscripts-opacity").hide();
  2929. $("#menu_suspendedball").hide();
  2930. },
  2931. saveload() {
  2932. this.save();
  2933. location.reload();
  2934. },
  2935. // 导入数据
  2936. triggerFileInput() {
  2937. this.$refs.fileInput.click();
  2938. },
  2939. handleFileUpload(event) {
  2940. const file = event.target.files[0];
  2941. if (file && file.type === "application/json") {
  2942. const reader = new FileReader();
  2943. reader.onload = (e) => {
  2944. try {
  2945. const jsonData = JSON.parse(e.target.result);
  2946. this.importData(jsonData);
  2947. } catch (error) {
  2948. console.error("Error parsing JSON:", error);
  2949. }
  2950. };
  2951. reader.readAsText(file);
  2952. } else {
  2953. console.error("Please select a valid JSON file.");
  2954. }
  2955. },
  2956. importData(data) {
  2957. this.settingData = data;
  2958. },
  2959. // 导出数据
  2960. exportData() {
  2961. const today = /* @__PURE__ */ new Date();
  2962. const year = today.getFullYear();
  2963. const month = String(today.getMonth() + 1).padStart(2, "0");
  2964. const day = String(today.getDate()).padStart(2, "0");
  2965. const formattedDate = year + month + day;
  2966. const dataStr = JSON.stringify(this.settingData, null, 2);
  2967. const blob = new Blob([dataStr], { type: "application/json" });
  2968. const url = URL.createObjectURL(blob);
  2969. const link = document.createElement("a");
  2970. link.href = url;
  2971. link.download = `linuxdo-script-data-${formattedDate}.json`;
  2972. document.body.appendChild(link);
  2973. link.click();
  2974. document.body.removeChild(link);
  2975. URL.revokeObjectURL(url);
  2976. },
  2977. // 打开抽奖弹窗
  2978. openFloorlottery() {
  2979. $("#menu_suspendedball").hide();
  2980. this.floorlotteryDialog = true;
  2981. },
  2982. // 开始抽奖
  2983. drawRandomNumbers() {
  2984. if (this.floorlotteryval1 === "" || this.floorlotteryval2 === "") {
  2985. return false;
  2986. }
  2987. const total = parseInt(this.floorlotteryval1);
  2988. const count = parseInt(this.floorlotteryval2);
  2989. if (isNaN(total) || isNaN(count) || total <= 0 || count <= 0 || count > total) {
  2990. return false;
  2991. }
  2992. this.floorlotterloading = true;
  2993. this.floorlotterresult = "";
  2994. setTimeout(() => {
  2995. const result = this.getRandomNumbers(total, count);
  2996. this.floorlotterresult = result.join(", ");
  2997. this.floorlotterloading = false;
  2998. }, 1e3);
  2999. },
  3000. getRandomNumbers(total, count) {
  3001. const numbers = Array.from({ length: total }, (_, i) => i + 1);
  3002. const result = [];
  3003. for (let i = 0; i < count; i++) {
  3004. const randomIndex = Math.floor(Math.random() * numbers.length);
  3005. result.push(numbers[randomIndex]);
  3006. numbers.splice(randomIndex, 1);
  3007. }
  3008. return result;
  3009. },
  3010. closelotter() {
  3011. this.floorlotteryDialog = false;
  3012. $(".linuxdoscripts-opacity").hide();
  3013. },
  3014. // 默认运行脚本
  3015. runscripts() {
  3016. $(".linuxdoscripts-setting").click(function() {
  3017. $(".linuxdoscripts-opacity").show();
  3018. $("#menu_suspendedball").show();
  3019. });
  3020. const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches;
  3021. if (isDarkMode) {
  3022. $("body").addClass("dark-theme");
  3023. } else {
  3024. $("body").removeClass("dark-theme");
  3025. }
  3026. const discourse_color_scheme_override = localStorage.getItem(
  3027. "discourse_color_scheme_override"
  3028. );
  3029. if (discourse_color_scheme_override) {
  3030. if (discourse_color_scheme_override == "dark") {
  3031. $("body").addClass("dark-theme");
  3032. } else {
  3033. $("body").removeClass("dark-theme");
  3034. }
  3035. }
  3036. $(".signature-img").each(function() {
  3037. var self = $(this);
  3038. if (self.siblings(".signature-p").length < 1) {
  3039. var url = self.attr("src");
  3040. if (url.indexOf("http") < 0) {
  3041. self.after(
  3042. `<p class="signature-p">${url}(该用户签名非图片格式,已自动转文字)</p>`
  3043. );
  3044. self.hide();
  3045. } else {
  3046. url.replace(/\/+$/, "");
  3047. var domainPattern = /\.(com|org|net|edu|gov|co|cn|io|info|biz|me|us|uk|au|de|fr|jp|ru|ch|it|nl|se|no|es|mil|int|arpa|asia|museum|name|pro|coop|aero|cat|jobs|mobi|travel|xxx|idv|tv|cc|ws|bz|nu|tk|fm|ag|am|at|be|bg|cd|cf|cg|ch|cl|cm|cz|dk|dm|ec|ee|es|eu|fi|ga|gd|gf|gg|gl|gp|gr|hm|hr|ht|hu|im|io|is|je|ke|kg|ki|kr|kz|la|lc|li|lt|lu|lv|ma|mc|md|ms|mt|mu|mx|my|nf|ng|nl|no|nz|pa|pe|pf|pg|pl|pm|pn|pr|pt|pw|re|ro|rs|sa|sb|sc|sg|sh|si|sk|sm|sn|so|st|su|sx|tc|tf|tk|tl|tm|to|tr|tt|tw|ua|ug|uy|uz|vc|ve|vg|vn|vu|wf|xyz|yt|za|zm|zw)$/i;
  3048. if (domainPattern.test(url)) {
  3049. self.after(
  3050. `<p class="signature-p">${url}(该用户签名非图片格式,已自动转文字)</p>`
  3051. );
  3052. self.hide();
  3053. } else if (url.indexOf("photos.google.com") !== -1) {
  3054. self.after(
  3055. `<p class="signature-p">${url}(该用户签名非图片格式,已自动转文字)</p>`
  3056. );
  3057. self.hide();
  3058. }
  3059. }
  3060. }
  3061. });
  3062. if ($(".menu-nav").length > 0) {
  3063. $(".menu-nav li").each(function() {
  3064. $(this).click(function() {
  3065. const num = $(this).index();
  3066. $(".menu-nav li").removeClass("act");
  3067. $(this).addClass("act");
  3068. $(".menu-body-item").removeClass("act");
  3069. $(".menu-body-item").eq(num).addClass("act");
  3070. if (num == 2) {
  3071. $(".menu-footer").addClass("hides");
  3072. } else {
  3073. $(".menu-footer").removeClass("hides");
  3074. }
  3075. });
  3076. });
  3077. }
  3078. },
  3079. // 初始化设置
  3080. initialization() {
  3081. localStorage.removeItem("linxudoscriptssetting");
  3082. setTimeout(() => {
  3083. location.reload();
  3084. }, 1e3);
  3085. }
  3086. },
  3087. created() {
  3088. setInterval(() => {
  3089. if ($(".linuxdoscripts-setting").length < 1) {
  3090. $(".sidebar-footer-actions").prepend(`<button class="btn no-text btn-icon color-scheme-toggler btn-flat linuxdoscripts-setting" title="设置" type="button">
  3091. <svg
  3092. class="fa d-icon d-icon-cog svg-icon svg-string"
  3093. xmlns="http://www.w3.org/2000/svg"
  3094. >
  3095. <use href="#cog"></use>
  3096. </svg>
  3097. </button>`);
  3098. }
  3099. }, 1e3);
  3100. const linxudoscriptssetting = localStorage.getItem("linxudoscriptssetting");
  3101. if (linxudoscriptssetting) {
  3102. this.settingData = JSON.parse(linxudoscriptssetting);
  3103. this.showautoread = this.settingData.checked8.value1;
  3104. this.showlookop = this.settingData.checked9;
  3105. this.showlevelsearch = this.settingData.checked12;
  3106. this.showaidialog = this.settingData.checked18;
  3107. } else {
  3108. localStorage.setItem("linxudoscriptssetting", JSON.stringify(this.settingData));
  3109. }
  3110. setInterval(() => {
  3111. this.runscripts();
  3112. }, 1e3);
  3113. }
  3114. };
  3115. const _hoisted_1 = { id: "linuxdoscripts" };
  3116. const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "linuxdoscripts-opacity" }, null, -1);
  3117. const _hoisted_3 = { class: "setting-btn" };
  3118. const _hoisted_4 = {
  3119. open: "",
  3120. id: "menu_suspendedball"
  3121. };
  3122. const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "linuxdo 增强插件设置", -1);
  3123. const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("ul", { class: "menu-nav" }, [
  3124. /* @__PURE__ */ vue.createElementVNode("li", { class: "act" }, "基础设置"),
  3125. /* @__PURE__ */ vue.createElementVNode("li", null, "自定义文字"),
  3126. /* @__PURE__ */ vue.createElementVNode("li", null, "用户标签"),
  3127. /* @__PURE__ */ vue.createElementVNode("li", null, "gpt 配置")
  3128. ], -1);
  3129. const _hoisted_7 = { class: "menu-body" };
  3130. const _hoisted_8 = { class: "menu-body-item act" };
  3131. const _hoisted_9 = { class: "menu-about" };
  3132. const _hoisted_10 = /* @__PURE__ */ vue.createElementVNode("p", null, "请注意,该设置面板数据全部保存在本地浏览器缓存中,注意备份。", -1);
  3133. const _hoisted_11 = { class: "hint" };
  3134. const _hoisted_12 = { class: "menu-body-item" };
  3135. const _hoisted_13 = { class: "menu-body-item" };
  3136. const _hoisted_14 = { class: "menu-body-item" };
  3137. const _hoisted_15 = { class: "menu-footer" };
  3138. const _hoisted_16 = /* @__PURE__ */ vue.createElementVNode("a", {
  3139. class: "btn",
  3140. style: { "background": "#979797" },
  3141. target: "_blank",
  3142. href: "https://greasyfork.org/zh-CN/scripts/501827-linuxdo-%E5%A2%9E%E5%BC%BA%E6%8F%92%E4%BB%B6"
  3143. }, " 检测新版本 ", -1);
  3144. const _hoisted_17 = { open: "" };
  3145. const _hoisted_18 = /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "楼层抽奖", -1);
  3146. const _hoisted_19 = { class: "menu-body" };
  3147. const _hoisted_20 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "height": "20px" } }, null, -1);
  3148. const _hoisted_21 = { key: 0 };
  3149. const _hoisted_22 = {
  3150. key: 1,
  3151. title: "抽奖结果",
  3152. type: "success"
  3153. };
  3154. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  3155. const _component_AIDialog = vue.resolveComponent("AIDialog");
  3156. const _component_LevelDiglog = vue.resolveComponent("LevelDiglog");
  3157. const _component_AutoRead = vue.resolveComponent("AutoRead");
  3158. const _component_LookOP = vue.resolveComponent("LookOP");
  3159. const _component_MenuOpenpostblank = vue.resolveComponent("MenuOpenpostblank");
  3160. const _component_MenuNewtopicreminder = vue.resolveComponent("MenuNewtopicreminder");
  3161. const _component_MenuAutoexpandreply = vue.resolveComponent("MenuAutoexpandreply");
  3162. const _component_MenuShowcreatetime = vue.resolveComponent("MenuShowcreatetime");
  3163. const _component_MenuShowcreatetime1 = vue.resolveComponent("MenuShowcreatetime1");
  3164. const _component_MenuShowfloors = vue.resolveComponent("MenuShowfloors");
  3165. const _component_MenuHidetopicdetailtitle = vue.resolveComponent("MenuHidetopicdetailtitle");
  3166. const _component_MenuTopicpreview = vue.resolveComponent("MenuTopicpreview");
  3167. const _component_MenuAutoRead = vue.resolveComponent("MenuAutoRead");
  3168. const _component_MenuLookOP = vue.resolveComponent("MenuLookOP");
  3169. const _component_MenuFloorHeight = vue.resolveComponent("MenuFloorHeight");
  3170. const _component_MenuPangu = vue.resolveComponent("MenuPangu");
  3171. const _component_MenuLevelSearch = vue.resolveComponent("MenuLevelSearch");
  3172. const _component_MenuShowUnread = vue.resolveComponent("MenuShowUnread");
  3173. const _component_MenuFilterText = vue.resolveComponent("MenuFilterText");
  3174. const _component_MenuLookmeSign = vue.resolveComponent("MenuLookmeSign");
  3175. const _component_MenuQuickAccess = vue.resolveComponent("MenuQuickAccess");
  3176. const _component_MenureplaceEmojiStyle = vue.resolveComponent("MenureplaceEmojiStyle");
  3177. const _component_MenuShowAI = vue.resolveComponent("MenuShowAI");
  3178. const _component_MenuEditorJa = vue.resolveComponent("MenuEditorJa");
  3179. const _component_MenuStickyNav = vue.resolveComponent("MenuStickyNav");
  3180. const _component_Updates = vue.resolveComponent("Updates");
  3181. const _component_MenuLogoUrl = vue.resolveComponent("MenuLogoUrl");
  3182. const _component_MenuCreatereply = vue.resolveComponent("MenuCreatereply");
  3183. const _component_MenuBlockuserlist = vue.resolveComponent("MenuBlockuserlist");
  3184. const _component_MenuOtherCss = vue.resolveComponent("MenuOtherCss");
  3185. const _component_UserTags = vue.resolveComponent("UserTags");
  3186. const _component_GPTconfig = vue.resolveComponent("GPTconfig");
  3187. const _component_UsageTip = vue.resolveComponent("UsageTip");
  3188. const _component_ReplyTBEnjoy = vue.resolveComponent("ReplyTBEnjoy");
  3189. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  3190. _hoisted_2,
  3191. vue.createElementVNode("div", _hoisted_3, [
  3192. vue.withDirectives(vue.createVNode(_component_AIDialog, null, null, 512), [
  3193. [vue.vShow, $data.showaidialog]
  3194. ]),
  3195. vue.withDirectives(vue.createVNode(_component_LevelDiglog, null, null, 512), [
  3196. [vue.vShow, $data.showlevelsearch]
  3197. ]),
  3198. vue.withDirectives(vue.createVNode(_component_AutoRead, null, null, 512), [
  3199. [vue.vShow, $data.showautoread]
  3200. ]),
  3201. vue.withDirectives(vue.createVNode(_component_LookOP, null, null, 512), [
  3202. [vue.vShow, $data.showlookop]
  3203. ])
  3204. ]),
  3205. vue.createElementVNode("dialog", _hoisted_4, [
  3206. _hoisted_5,
  3207. vue.createElementVNode("div", {
  3208. class: "close",
  3209. onClick: _cache[0] || (_cache[0] = (...args) => $options.closedialog && $options.closedialog(...args))
  3210. }, "+"),
  3211. _hoisted_6,
  3212. vue.createElementVNode("div", _hoisted_7, [
  3213. vue.createElementVNode("div", _hoisted_8, [
  3214. vue.createElementVNode("div", _hoisted_9, [
  3215. _hoisted_10,
  3216. vue.createElementVNode("p", _hoisted_11, [
  3217. vue.createTextVNode(" 如果感觉哪里不太对劲,点我"),
  3218. vue.createElementVNode("span", {
  3219. class: "initialization",
  3220. onClick: _cache[1] || (_cache[1] = (...args) => $options.initialization && $options.initialization(...args))
  3221. }, "初始化设置"),
  3222. vue.createTextVNode(",会清除全部所有的设置数据并初始化,慎重使用! ")
  3223. ])
  3224. ]),
  3225. vue.createVNode(_component_MenuOpenpostblank, {
  3226. sort: 1,
  3227. modelValue: $data.settingData.checked1,
  3228. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.settingData.checked1 = $event)
  3229. }, null, 8, ["modelValue"]),
  3230. vue.createVNode(_component_MenuNewtopicreminder, {
  3231. sort: 2,
  3232. modelValue: $data.settingData.checked2,
  3233. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.settingData.checked2 = $event)
  3234. }, null, 8, ["modelValue"]),
  3235. vue.createVNode(_component_MenuAutoexpandreply, {
  3236. sort: 3,
  3237. modelValue: $data.settingData.checked3,
  3238. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.settingData.checked3 = $event)
  3239. }, null, 8, ["modelValue"]),
  3240. vue.createVNode(_component_MenuShowcreatetime, {
  3241. sort: 4,
  3242. modelValue: $data.settingData.checked4,
  3243. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.settingData.checked4 = $event)
  3244. }, null, 8, ["modelValue"]),
  3245. vue.createVNode(_component_MenuShowcreatetime1, {
  3246. sort: 4.1,
  3247. modelValue: $data.settingData.checked41,
  3248. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.settingData.checked41 = $event)
  3249. }, null, 8, ["modelValue"]),
  3250. vue.createVNode(_component_MenuShowfloors, {
  3251. sort: 5,
  3252. modelValue: $data.settingData.checked5,
  3253. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.settingData.checked5 = $event)
  3254. }, null, 8, ["modelValue"]),
  3255. vue.createVNode(_component_MenuHidetopicdetailtitle, {
  3256. sort: 6,
  3257. modelValue: $data.settingData.checked6,
  3258. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.settingData.checked6 = $event)
  3259. }, null, 8, ["modelValue"]),
  3260. vue.createVNode(_component_MenuTopicpreview, {
  3261. sort: 7,
  3262. modelValue: $data.settingData.checked7,
  3263. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.settingData.checked7 = $event)
  3264. }, null, 8, ["modelValue"]),
  3265. vue.createVNode(_component_MenuAutoRead, {
  3266. sort: 8,
  3267. modelValue: $data.settingData.checked8,
  3268. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.settingData.checked8 = $event)
  3269. }, null, 8, ["modelValue"]),
  3270. vue.createVNode(_component_MenuLookOP, {
  3271. sort: 9,
  3272. modelValue: $data.settingData.checked9,
  3273. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.settingData.checked9 = $event)
  3274. }, null, 8, ["modelValue"]),
  3275. vue.createVNode(_component_MenuFloorHeight, {
  3276. sort: 10,
  3277. modelValue: $data.settingData.checked10,
  3278. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.settingData.checked10 = $event)
  3279. }, null, 8, ["modelValue"]),
  3280. vue.createVNode(_component_MenuPangu, {
  3281. sort: 11,
  3282. modelValue: $data.settingData.checked11,
  3283. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.settingData.checked11 = $event)
  3284. }, null, 8, ["modelValue"]),
  3285. vue.createVNode(_component_MenuLevelSearch, {
  3286. sort: 12,
  3287. modelValue: $data.settingData.checked12,
  3288. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.settingData.checked12 = $event)
  3289. }, null, 8, ["modelValue"]),
  3290. vue.createVNode(_component_MenuShowUnread, {
  3291. sort: 13,
  3292. modelValue: $data.settingData.checked13,
  3293. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.settingData.checked13 = $event)
  3294. }, null, 8, ["modelValue"]),
  3295. vue.createVNode(_component_MenuFilterText, {
  3296. sort: 14,
  3297. modelValue: $data.settingData.checked14,
  3298. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.settingData.checked14 = $event)
  3299. }, null, 8, ["modelValue"]),
  3300. vue.createVNode(_component_MenuLookmeSign, {
  3301. sort: 15,
  3302. modelValue: $data.settingData.checked15,
  3303. "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.settingData.checked15 = $event)
  3304. }, null, 8, ["modelValue"]),
  3305. vue.createVNode(_component_MenuQuickAccess, {
  3306. sort: 16,
  3307. modelValue: $data.settingData.checked16,
  3308. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.settingData.checked16 = $event)
  3309. }, null, 8, ["modelValue"]),
  3310. vue.createVNode(_component_MenureplaceEmojiStyle, {
  3311. sort: 17,
  3312. modelValue: $data.settingData.checked17,
  3313. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.settingData.checked17 = $event)
  3314. }, null, 8, ["modelValue"]),
  3315. vue.createVNode(_component_MenuShowAI, {
  3316. sort: 18,
  3317. modelValue: $data.settingData.checked18,
  3318. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.settingData.checked18 = $event)
  3319. }, null, 8, ["modelValue"]),
  3320. vue.createVNode(_component_MenuEditorJa, {
  3321. sort: 19,
  3322. modelValue: $data.settingData.checked19,
  3323. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.settingData.checked19 = $event)
  3324. }, null, 8, ["modelValue"]),
  3325. vue.createVNode(_component_MenuStickyNav, {
  3326. sort: 20,
  3327. modelValue: $data.settingData.checked20,
  3328. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.settingData.checked20 = $event)
  3329. }, null, 8, ["modelValue"]),
  3330. vue.createVNode(_component_Updates)
  3331. ]),
  3332. vue.createElementVNode("div", _hoisted_12, [
  3333. vue.createVNode(_component_MenuLogoUrl, {
  3334. sort: 1,
  3335. value: $data.settingData.logourl,
  3336. "onUpdate:value": _cache[23] || (_cache[23] = ($event) => $data.settingData.logourl = $event)
  3337. }, null, 8, ["value"]),
  3338. vue.createVNode(_component_MenuCreatereply, {
  3339. sort: 2,
  3340. value: $data.settingData.QuickReply,
  3341. "onUpdate:value": _cache[24] || (_cache[24] = ($event) => $data.settingData.QuickReply = $event)
  3342. }, null, 8, ["value"]),
  3343. vue.createVNode(_component_MenuBlockuserlist, {
  3344. sort: 3,
  3345. value: $data.settingData.blockList,
  3346. "onUpdate:value": _cache[25] || (_cache[25] = ($event) => $data.settingData.blockList = $event)
  3347. }, null, 8, ["value"]),
  3348. vue.createVNode(_component_MenuOtherCss, {
  3349. sort: 4,
  3350. value: $data.settingData.othercss,
  3351. "onUpdate:value": _cache[26] || (_cache[26] = ($event) => $data.settingData.othercss = $event)
  3352. }, null, 8, ["value"])
  3353. ]),
  3354. vue.createElementVNode("div", _hoisted_13, [
  3355. vue.createVNode(_component_UserTags)
  3356. ]),
  3357. vue.createElementVNode("div", _hoisted_14, [
  3358. vue.createVNode(_component_GPTconfig, {
  3359. value: $data.settingData.gptdata,
  3360. "onUpdate:value": _cache[27] || (_cache[27] = ($event) => $data.settingData.gptdata = $event)
  3361. }, null, 8, ["value"])
  3362. ])
  3363. ]),
  3364. vue.createElementVNode("div", _hoisted_15, [
  3365. vue.createElementVNode("input", {
  3366. type: "file",
  3367. id: "fileInput",
  3368. ref: "fileInput",
  3369. style: { "display": "none" },
  3370. accept: ".json",
  3371. onChange: _cache[28] || (_cache[28] = (...args) => $options.handleFileUpload && $options.handleFileUpload(...args))
  3372. }, null, 544),
  3373. vue.createElementVNode("button", {
  3374. class: "btn save",
  3375. onClick: _cache[29] || (_cache[29] = (...args) => $options.save && $options.save(...args))
  3376. }, "保存"),
  3377. vue.createElementVNode("button", {
  3378. class: "btn saveload",
  3379. onClick: _cache[30] || (_cache[30] = (...args) => $options.saveload && $options.saveload(...args))
  3380. }, "保存并刷新"),
  3381. vue.createElementVNode("button", {
  3382. class: "btn floorlottery",
  3383. onClick: _cache[31] || (_cache[31] = (...args) => $options.openFloorlottery && $options.openFloorlottery(...args))
  3384. }, "楼层抽奖"),
  3385. _hoisted_16,
  3386. vue.createElementVNode("button", {
  3387. class: "btn import",
  3388. onClick: _cache[32] || (_cache[32] = (...args) => $options.triggerFileInput && $options.triggerFileInput(...args))
  3389. }, "导入"),
  3390. vue.createElementVNode("button", {
  3391. class: "btn export",
  3392. onClick: _cache[33] || (_cache[33] = (...args) => $options.exportData && $options.exportData(...args))
  3393. }, "导出")
  3394. ])
  3395. ]),
  3396. vue.withDirectives(vue.createElementVNode("dialog", _hoisted_17, [
  3397. _hoisted_18,
  3398. vue.createElementVNode("div", _hoisted_19, [
  3399. vue.withDirectives(vue.createElementVNode("input", {
  3400. type: "text",
  3401. "onUpdate:modelValue": _cache[34] || (_cache[34] = ($event) => $data.floorlotteryval1 = $event),
  3402. placeholder: "请输入总数"
  3403. }, null, 512), [
  3404. [vue.vModelText, $data.floorlotteryval1]
  3405. ]),
  3406. vue.withDirectives(vue.createElementVNode("input", {
  3407. type: "text",
  3408. "onUpdate:modelValue": _cache[35] || (_cache[35] = ($event) => $data.floorlotteryval2 = $event),
  3409. placeholder: "请输入抽取的数量"
  3410. }, null, 512), [
  3411. [vue.vModelText, $data.floorlotteryval2]
  3412. ]),
  3413. vue.createElementVNode("button", {
  3414. type: "primary",
  3415. onClick: _cache[36] || (_cache[36] = (...args) => $options.drawRandomNumbers && $options.drawRandomNumbers(...args))
  3416. }, "开始抽奖"),
  3417. vue.createElementVNode("button", {
  3418. type: "primary",
  3419. plain: "",
  3420. onClick: _cache[37] || (_cache[37] = (...args) => $options.closelotter && $options.closelotter(...args))
  3421. }, "关闭弹窗"),
  3422. _hoisted_20,
  3423. $data.floorlotterloading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, "正在抽奖...")) : vue.createCommentVNode("", true),
  3424. $data.floorlotterresult ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22, " 抽奖结果:" + vue.toDisplayString($data.floorlotterresult), 1)) : vue.createCommentVNode("", true)
  3425. ])
  3426. ], 512), [
  3427. [vue.vShow, $data.floorlotteryDialog]
  3428. ]),
  3429. vue.createVNode(_component_UsageTip),
  3430. vue.createVNode(_component_ReplyTBEnjoy)
  3431. ]);
  3432. }
  3433. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
  3434. const app = vue.createApp(App);
  3435. app.mount(
  3436. (() => {
  3437. const appDiv = document.createElement("div");
  3438. document.body.append(appDiv);
  3439. return appDiv;
  3440. })()
  3441. );
  3442.  
  3443. })(Vue);