// ==UserScript==
// @name linuxdo 增强插件
// @namespace https://github.com/dlzmoe/linuxdo-scripts
// @version 0.3.2
// @author dlzmoe
// @description linux.do 增强插件,话题列表显示创建时间,显示楼层数,新标签页打开话题,强制 block(拉黑屏蔽)某人的话题,话题快捷回复(支持自定义),优化签名图显示防止图裂,在话题列表可直接预览详情及评论,功能设置面板导入导出,楼层抽奖,用户自定义标签,只看楼主,自动滚动阅读,支持自定义 css 样式,中英文混排优化,等级信息查询,AI 总结话题功能等,功能持续更新,欢迎提出新想法!
// @license Apache-2.0
// @icon https://cdn.linux.do/uploads/default/optimized/3X/9/d/9dd49731091ce8656e94433a26a3ef36062b3994_2_32x32.png
// @match *://*.linux.do/*
// @require https://unpkg.com/vue@3.4.38/dist/vue.global.prod.js
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @downloadURL none
// ==/UserScript==
(t=>{if(typeof GM_addStyle=="function"){GM_addStyle(t);return}const e=document.createElement("style");e.textContent=t,document.head.append(e)})(' .item[data-v-2813056e],.item[data-v-32a30929],.item[data-v-6eaf369f],.item[data-v-472a5072],.item[data-v-7412ed9b],.item[data-v-fb2dc595],.item[data-v-3b311953],.item[data-v-0573003c],.item[data-v-3bad948d]{display:flex;align-items:center;justify-content:space-between}.item .tit[data-v-3bad948d]{display:inline-flex;align-items:center;white-space:nowrap}.item .tit input[data-v-3bad948d]{margin-left:20px;width:90px;height:20px!important;outline:none;border:1px solid #7f7f7f;border-radius:3px}a[data-v-f69e48bb]:hover{text-decoration:underline}.item[data-v-2287508a]{display:flex;align-items:center;justify-content:space-between}.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}.item[data-v-8f89370f]{display:flex;align-items:center;justify-content:space-between}.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}.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}.item[data-v-57d68a0c],.item[data-v-77cd9d37],.item[data-v-bc3b01be],.item[data-v-485a1c18],.item[data-v-a78f4725],.item[data-v-5e1b51e3]{display:flex;align-items:center;justify-content:space-between}.sidebar-section-header-caret.right{transform:rotate(-90deg)}.item[data-v-d042d66d]{display:flex;align-items:center;justify-content:space-between}.item select[data-v-d042d66d]{height:28px;border:1px solid #b6b6b6;border-radius:4px;width:180px;margin-left:10px;cursor:pointer}.item[data-v-0b5afcc1]{display:flex;align-items:center;justify-content:space-between}.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-18de2904],.item[data-v-561d2e2e]{display:flex;align-items:center;justify-content:space-between}.item[data-v-1b566ad2]{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 .item{margin-top:12px;border-bottom:1px solid #eee;padding-bottom:10px}#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:#000000b3;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} ');
(function (vue) {
'use strict';
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _sfc_main$y = {
props: {
value: {
type: Boolean,
default: false
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value,
eventListeners: []
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
console.log(this.localChecked);
},
init() {
this.removeEventListeners();
$(".topic-list a.title,.topic .search-link").each((index, element) => {
const listener = (event) => {
event.preventDefault();
var url = $(element).attr("href");
window.open(url, "_blank");
};
$(element).on("click", listener);
this.eventListeners.push({ element, listener });
});
},
removeEventListeners() {
this.eventListeners.forEach(({ element, listener }) => {
$(element).off("click", listener);
});
this.eventListeners = [];
}
},
created() {
if (this.localChecked) {
let pollinglength1 = 0;
let pollinglength2 = 0;
setInterval(() => {
if (pollinglength1 != $(".topic-list-body tr").length) {
pollinglength1 = $(".topic-list-body tr").length;
this.init();
}
if (pollinglength2 != $(".post-stream .topic-post").length) {
pollinglength2 = $(".post-stream .topic-post").length;
this.init();
}
}, 1e3);
}
},
beforeDestroy() {
this.removeEventListeners();
}
};
const _hoisted_1$v = { class: "item" };
const _hoisted_2$v = { class: "tit" };
function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$v, [
vue.createElementVNode("div", _hoisted_2$v, vue.toDisplayString($props.sort) + ". 是否新标签页打开话题", 1),
vue.withDirectives(vue.createElementVNode("input", {
type: "checkbox",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
}, null, 544), [
[vue.vModelCheckbox, $data.localChecked]
])
]);
}
const MenuOpenpostblank = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$y], ["__scopeId", "data-v-2813056e"]]);
const _sfc_main$x = {
props: {
value: {
type: Object,
default: {
value: false
}
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
},
init() {
if ($("#list-area .show-more").length > 0) {
$("head title").html("【有新话题赶紧来水!!】");
}
}
},
created() {
if (this.localChecked) {
setInterval(() => {
this.init();
}, 1e3);
}
}
};
const _hoisted_1$u = { class: "item" };
const _hoisted_2$u = { class: "tit" };
function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
vue.createElementVNode("div", _hoisted_2$u, vue.toDisplayString($props.sort) + ". 是否开启新话题提醒", 1),
vue.withDirectives(vue.createElementVNode("input", {
type: "checkbox",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
}, null, 544), [
[vue.vModelCheckbox, $data.localChecked]
])
]);
}
const MenuNewtopicreminder = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$x], ["__scopeId", "data-v-32a30929"]]);
const _sfc_main$w = {
props: {
value: {
type: Object,
default: {
value: false
}
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
},
init() {
$("nav.post-controls .show-replies").each(function() {
$(this).click();
});
}
},
created() {
if (this.localChecked) {
let pollinglength2 = 0;
setInterval(() => {
if (pollinglength2 != $(".post-stream .topic-post").length) {
pollinglength2 = $(".post-stream .topic-post").length;
this.init();
}
}, 1e3);
}
}
};
const _hoisted_1$t = { class: "item" };
const _hoisted_2$t = { class: "tit" };
function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, [
vue.createElementVNode("div", _hoisted_2$t, vue.toDisplayString($props.sort) + ". 是否自动展开回复", 1),
vue.withDirectives(vue.createElementVNode("input", {
type: "checkbox",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
}, null, 544), [
[vue.vModelCheckbox, $data.localChecked]
])
]);
}
const MenuAutoexpandreply = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w], ["__scopeId", "data-v-6eaf369f"]]);
const _sfc_main$v = {
props: {
value: {
type: Object,
default: {
value: false
}
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
if (this.localChecked) {
this.setInitDate();
}
},
formattedDate(time) {
const timestamp = Number(time);
const date = new Date(timestamp);
const now = /* @__PURE__ */ new Date();
const isToday = now.getFullYear() === date.getFullYear() && now.getMonth() === date.getMonth() && now.getDate() === date.getDate();
date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
return isToday ? `${hours}:${minutes}` : `${month}/${day} ${hours}:${minutes}`;
},
convertToTimestamp(dateStr) {
const datePattern = /(\d{4}) 年 (\d{1,2}) 月 (\d{1,2}) 日 (\d{2}):(\d{2})/;
const dateMatch = dateStr.match(datePattern);
if (dateMatch) {
const year = parseInt(dateMatch[1], 10);
const month = parseInt(dateMatch[2], 10) - 1;
const day = parseInt(dateMatch[3], 10);
const hours = parseInt(dateMatch[4], 10);
const minutes = parseInt(dateMatch[5], 10);
const date = new Date(year, month, day, hours, minutes);
return date.getTime();
}
return null;
},
setInitDate() {
$(".topic-list .age").each((index, element) => {
const str = $(element).attr("title");
const match = str.match(/创建日期:([\s\S]*?)最新:/);
if (match && match[1]) {
const creationDate = match[1].trim();
const timestamp = this.convertToTimestamp(creationDate);
if ($(element).find(".linuxtime").length < 1) {
const now = (/* @__PURE__ */ new Date()).getTime();
const oneDay = 1e3 * 60 * 60 * 24;
const oneWeek = oneDay * 7;
const oneMonth = oneDay * 30;
const threeMonths = oneMonth * 3;
let color;
const timeDiff = now - timestamp;
if (timeDiff < oneDay) {
color = "#45B5AA";
$(element).find(".post-activity").append(`(${this.formattedDate(timestamp)})`);
} else if (timeDiff < oneWeek) {
color = "#66A586";
$(element).find(".post-activity").append(`(${this.formattedDate(timestamp)})`);
} else if (timeDiff < oneMonth) {
color = "#CFA94A";
$(element).find(".post-activity").append(`(${this.formattedDate(timestamp)})`);
} else if (timeDiff < threeMonths) {
color = "#3e8ed2";
$(element).find(".post-activity").append(`(${this.formattedDate(timestamp)})`);
} else {
color = "#cccccc";
$(element).find(".post-activity").append(
`
(${this.formattedDate(timestamp)})
`
);
}
}
}
});
},
initDateAndStartPolling() {
setInterval(() => {
this.setInitDate();
this.startPolling();
}, 1e3);
},
startPolling() {
setInterval(() => {
this.setInitDate();
}, 1e4);
}
},
mounted() {
if (this.localChecked) {
this.startPolling();
this.initDateAndStartPolling();
}
}
};
const _hoisted_1$s = { class: "item" };
const _hoisted_2$s = { class: "tit" };
function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", null, [
vue.createElementVNode("div", _hoisted_1$s, [
vue.createElementVNode("div", _hoisted_2$s, vue.toDisplayString($props.sort) + ". 话题列表显示创建时间", 1),
vue.withDirectives(vue.createElementVNode("input", {
type: "checkbox",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
}, null, 544), [
[vue.vModelCheckbox, $data.localChecked]
])
])
]);
}
const MenuShowcreatetime = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v], ["__scopeId", "data-v-472a5072"]]);
const _sfc_main$u = {
props: {
value: {
type: Object,
default: {
value: false
}
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
if (this.localChecked) {
this.setInitDate();
}
},
formattedDate(time) {
const timestamp = Number(time);
const date = new Date(timestamp);
const now = /* @__PURE__ */ new Date();
const isToday = now.getFullYear() === date.getFullYear() && now.getMonth() === date.getMonth() && now.getDate() === date.getDate();
date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
return isToday ? `${hours}:${minutes}` : `${month}/${day} ${hours}:${minutes}`;
},
convertToTimestamp(dateStr) {
const datePattern = /(\d{4}) 年 (\d{1,2}) 月 (\d{1,2}) 日 (\d{2}):(\d{2})/;
const dateMatch = dateStr.match(datePattern);
if (dateMatch) {
const year = parseInt(dateMatch[1], 10);
const month = parseInt(dateMatch[2], 10) - 1;
const day = parseInt(dateMatch[3], 10);
const hours = parseInt(dateMatch[4], 10);
const minutes = parseInt(dateMatch[5], 10);
const date = new Date(year, month, day, hours, minutes);
return date.getTime();
}
return null;
},
setInitDate() {
$(".topic-list .age").each((index, element) => {
const str = $(element).attr("title");
const match = str.match(/创建日期:([\s\S]*?)最新:/);
if (match && match[1]) {
const creationDate = match[1].trim();
const timestamp = this.convertToTimestamp(creationDate);
const now = (/* @__PURE__ */ new Date()).getTime();
const oneDay = 1e3 * 60 * 60 * 24;
const oneWeek = oneDay * 7;
const oneMonth = oneDay * 30;
const threeMonths = oneMonth * 3;
let color;
const timeDiff = now - timestamp;
if (timeDiff < oneDay) {
color = "#45B5AA";
$(element).siblings(".views").html(`${this.formattedDate(timestamp)}`);
} else if (timeDiff < oneWeek) {
color = "#66A586";
$(element).siblings(".views").html(`${this.formattedDate(timestamp)}`);
} else if (timeDiff < oneMonth) {
color = "#CFA94A";
$(element).siblings(".views").html(`${this.formattedDate(timestamp)}`);
} else if (timeDiff < threeMonths) {
color = "#3e8ed2";
$(element).siblings(".views").html(`${this.formattedDate(timestamp)}`);
} else {
color = "#cccccc";
$(element).siblings(".views").html(
`
${this.formattedDate(timestamp)}
`
);
}
}
});
},
initDateAndStartPolling() {
setInterval(() => {
this.setInitDate();
this.startPolling();
}, 1e3);
},
startPolling() {
setInterval(() => {
this.setInitDate();
}, 1e4);
}
},
mounted() {
if (this.localChecked) {
this.startPolling();
this.initDateAndStartPolling();
}
}
};
const _hoisted_1$r = { class: "item" };
const _hoisted_2$r = { class: "tit" };
function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$r, [
vue.createElementVNode("div", _hoisted_2$r, vue.toDisplayString($props.sort) + ". 将浏览量替换为创建时间(与 4 互斥,只可选择一个)", 1),
vue.withDirectives(vue.createElementVNode("input", {
type: "checkbox",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
}, null, 544), [
[vue.vModelCheckbox, $data.localChecked]
])
]);
}
const MenuShowcreatetime1 = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$u], ["__scopeId", "data-v-7412ed9b"]]);
const _sfc_main$t = {
props: {
value: {
type: Object,
default: {
value: false
}
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
},
init() {
$(".topic-post").each(function() {
const num = $(this).find("article").attr("id").replace(/^post_/, "");
if ($(this).find(".linuxfloor").length < 1) {
$(this).find(".post-infos").append(`#${num}`);
}
});
}
},
created() {
if (this.localChecked) {
let pollinglength2 = 0;
setInterval(() => {
if (pollinglength2 != $(".post-stream .topic-post").length) {
pollinglength2 = $(".post-stream .topic-post").length;
this.init();
}
}, 1e3);
}
}
};
const _hoisted_1$q = { class: "item" };
const _hoisted_2$q = { class: "tit" };
function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$q, [
vue.createElementVNode("div", _hoisted_2$q, vue.toDisplayString($props.sort) + ". 是否显示楼层数", 1),
vue.withDirectives(vue.createElementVNode("input", {
type: "checkbox",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
}, null, 544), [
[vue.vModelCheckbox, $data.localChecked]
])
]);
}
const MenuShowfloors = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$t], ["__scopeId", "data-v-fb2dc595"]]);
const _sfc_main$s = {
props: {
value: {
type: Object,
default: {
value: false
}
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
}
},
created() {
if (this.localChecked) {
$("head").append(``);
}
}
};
const _hoisted_1$p = { class: "item" };
const _hoisted_2$p = { class: "tit" };
function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
vue.createElementVNode("div", _hoisted_2$p, vue.toDisplayString($props.sort) + ". 隐藏话题详情顶部大标题", 1),
vue.withDirectives(vue.createElementVNode("input", {
type: "checkbox",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event),
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args))
}, null, 544), [
[vue.vModelCheckbox, $data.localChecked]
])
]);
}
const MenuHidetopicdetailtitle = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$s], ["__scopeId", "data-v-3b311953"]]);
const _sfc_main$r = {
props: {
value: {
type: Object,
default: {
value: false
}
},
sort: {
type: Number,
required: true
}
},
data() {
return {
localChecked: this.value
};
},
watch: {
value(newValue) {
this.localChecked = newValue;
}
},
methods: {
handleChange() {
this.$emit("update:value", this.localChecked);
},
init() {
if ($(".topicpreview").length < 1) {
$("body").append(`
正在加载中...
发帖时间:${formatDate( previewData.created_at )}
仅显示前 20 条,查看更多
`); $.each(previewData.post_stream.posts, function(index, post) { $(".topicpreview .topicpreview-content").append(`正在加载中...
` ); }); } }, created() { if (this.localChecked) { setInterval(() => { this.init(); }, 1e3); let pollinglength1 = 0; let pollinglength2 = 0; setInterval(() => { if (pollinglength1 != $(".topic-list-body tr").length) { pollinglength1 = $(".topic-list-body tr").length; this.setClick(); } if (pollinglength2 != $(".post-stream .topic-post").length) { pollinglength2 = $(".post-stream .topic-post").length; this.setClick(); } }, 1e3); } } }; const _hoisted_1$o = { class: "item" }; const _hoisted_2$o = { class: "tit" }; function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [ vue.createElementVNode("div", _hoisted_2$o, vue.toDisplayString($props.sort) + ". 是否开启话题预览功能", 1), vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event), onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)) }, null, 544), [ [vue.vModelCheckbox, $data.localChecked] ]) ]); } const MenuTopicpreview = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$r], ["__scopeId", "data-v-0573003c"]]); const _sfc_main$q = { props: { value: { type: String, default: "前排围观,支持一下\n感谢分享,支持一下\n有点厉害,支持一下" }, sort: { type: Number, required: true } }, data() { return { textarea: this.value }; }, watch: { value(newValue) { this.textarea = newValue; } }, methods: { handleChange() { this.$emit("update:value", this.textarea); }, init() { this.list = this.textarea.split(/\r?\n/) || []; if ($(".createreply").length < 1) { $(".timeline-container .topic-timeline").append( `` ); this.list.forEach(function(item) { var $li = $( '' ).text(item); $(".createreply").append($li); }); $(".createreply button").click(function() { if ($(".timeline-footer-controls button.create").length != 0) { $(".timeline-footer-controls button.create")[0].click(); } if ($("#topic-footer-buttons .topic-footer-main-buttons button.create").length != 0) { $( "#topic-footer-buttons .topic-footer-main-buttons button.create" )[0].click(); } setTimeout(() => { let $textarea = $(".d-editor-textarea-wrapper textarea"); let text = $(this).html(); $textarea.focus(); for (let i = 0; i < text.length; i++) { let char = text[i]; $textarea.val($textarea.val() + char); let inputEvent = new Event("input", { bubbles: true, cancelable: true }); $textarea[0].dispatchEvent(inputEvent); let keyEvent = new KeyboardEvent("keydown", { key: char, char, keyCode: char.charCodeAt(0), which: char.charCodeAt(0), bubbles: true }); $textarea[0].dispatchEvent(keyEvent); } }, 1e3); }); } } }, created() { if (this.textarea) { setInterval(() => { this.init(); }, 1e3); } } }; const _hoisted_1$n = { class: "item" }; const _hoisted_2$n = { class: "tit" }; function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [ vue.createElementVNode("div", _hoisted_2$n, vue.toDisplayString($props.sort) + ". 自定义快捷回复(换行分隔)", 1), vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.textarea = $event), onInput: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)), placeholder: "前排围观支持一下\\n感谢分享大佬厉害啊\\n有点厉害支持~~" }, null, 544), [ [vue.vModelText, $data.textarea] ]) ]); } const MenuCreatereply = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q]]); const _sfc_main$p = { props: { value: { type: String, default: "" }, sort: { type: Number, required: true } }, data() { return { textarea: this.value }; }, watch: { value(newValue) { this.textarea = newValue; } }, methods: { handleChange() { this.$emit("update:value", this.textarea); }, init() { this.list = this.textarea.split(",") || []; var self = this; $(".topic-list .topic-list-data.posters>a:nth-child(1)").filter((index, element) => { var user = $(element).attr("data-user-card"); return self.list.indexOf(user) !== -1; }).parents("tr.topic-list-item").remove(); $(".topic-post .full-name a").filter((index, element) => { var user = $(element).attr("data-user-card"); return self.list.indexOf(user) !== -1; }).parents(".topic-post").remove(); } }, created() { if (this.textarea) { let pollinglength1 = 0; let pollinglength2 = 0; setInterval(() => { if (pollinglength1 != $(".topic-list-body tr").length) { pollinglength1 = $(".topic-list-body tr").length; this.init(); } if (pollinglength2 != $(".post-stream .topic-post").length) { pollinglength2 = $(".post-stream .topic-post").length; this.init(); } }, 1e3); } } }; const _hoisted_1$m = { class: "item" }; const _hoisted_2$m = { class: "tit" }; function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [ vue.createElementVNode("div", _hoisted_2$m, vue.toDisplayString($props.sort) + ". 屏蔽指定用户(使用英文,分隔)", 1), vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.textarea = $event), onInput: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)), placeholder: "user1,user2,user3" }, null, 544), [ [vue.vModelText, $data.textarea] ]) ]); } const MenuBlockuserlist = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p]]); const _sfc_main$o = { props: { value: { type: Object, default: { value1: false, value2: 10 } }, sort: { type: Number, required: true } }, data() { return { localChecked: this.value }; }, watch: { value(newValue) { this.localChecked = newValue; } }, methods: { handleChange() { this.$emit("update:value", this.localChecked); } } }; const _hoisted_1$l = { class: "item" }; const _hoisted_2$l = { class: "tit" }; function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [ vue.createElementVNode("div", _hoisted_2$l, [ vue.createTextVNode(vue.toDisplayString($props.sort) + ". 是否显示自动阅读按钮,可调节速度默认 10 ", 1), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked.value2 = $event), placeholder: "默认速度 10" }, null, 512), [ [vue.vModelText, $data.localChecked.value2] ]) ]), vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.localChecked.value1 = $event), onChange: _cache[2] || (_cache[2] = (...args) => $options.handleChange && $options.handleChange(...args)) }, null, 544), [ [vue.vModelCheckbox, $data.localChecked.value1] ]) ]); } const MenuAutoRead = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-3bad948d"]]); const _sfc_main$n = { data() { return { num: 10, // 滚动速度 isScrolling: false, scrollInterval: null }; }, methods: { scrollToBottomSlowly(distancePerStep = this.num, delayPerStep = 50) { if (this.scrollInterval !== null) { clearInterval(this.scrollInterval); } this.scrollInterval = setInterval(() => { const documentHeight = document.body.scrollHeight; const windowHeight = window.innerHeight; const scrollPosition = window.scrollY; if (scrollPosition + windowHeight >= documentHeight - 1) { clearInterval(this.scrollInterval); this.scrollInterval = null; } else { window.scrollBy(0, distancePerStep); } }, delayPerStep); }, autoread() { if (this.isScrolling) { clearInterval(this.scrollInterval); this.scrollInterval = null; this.isScrolling = false; } else { this.scrollToBottomSlowly(); this.isScrolling = true; } } }, created() { let linxudoscriptssetting = localStorage.getItem("linxudoscriptssetting"); if (linxudoscriptssetting) { linxudoscriptssetting = JSON.parse(linxudoscriptssetting); this.num = Number(linxudoscriptssetting.checked8.value2); } } }; const _hoisted_1$k = /* @__PURE__ */ vue.createElementVNode("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor" }, [ /* @__PURE__ */ vue.createElementVNode("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), /* @__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" }) ], -1); const _hoisted_2$k = [ _hoisted_1$k ]; function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: "el-button", onClick: _cache[0] || (_cache[0] = (...args) => $options.autoread && $options.autoread(...args)), title: "自动阅读" }, _hoisted_2$k); } const AutoRead = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n]]); const name = "linuxdo-scripts"; const version = "0.3.2"; const author = "dlzmoe"; const description = "An enhanced script for the linux.do forum"; const type = "module"; const license = "Apache-2.0"; const scripts = { dev: "vite", build: "vite build && py build.py", preview: "vite preview" }; const dependencies = { "element-plus": "^2.8.1", vue: "^3.4.27" }; const devDependencies = { "@vitejs/plugin-vue": "^5.0.4", less: "^4.1.0", "less-loader": "^8.0.0", "style-loader": "^2.0.0", vite: "^5.2.12", "vite-plugin-monkey": "^4.0.0" }; const packageJson = { name, version, author, description, type, "private": true, license, scripts, dependencies, devDependencies }; const _sfc_main$m = { data() { return { version: packageJson.version }; }, created() { } }; const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-f69e48bb"), n = n(), vue.popScopeId(), n); const _hoisted_1$j = { class: "item" }; const _hoisted_2$j = { class: "tit" }; const _hoisted_3$5 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "https://github.com/dlzmoe/linuxdo-scripts", target: "_blank" }, "Github源码", -1)); const _hoisted_4$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "https://linuxdo-scripts-docs.netlify.app/", target: "_blank" }, "使用文档", -1)); function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [ vue.createElementVNode("div", _hoisted_2$j, [ vue.createTextVNode(" 当前版本:" + vue.toDisplayString($data.version) + " ", 1), _hoisted_3$5, _hoisted_4$4 ]) ]); } const Updates = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-f69e48bb"]]); const _sfc_main$l = { props: { value: { type: Object, default: { value: false } }, sort: { type: Number, required: true } }, data() { return { localChecked: this.value }; }, watch: { value(newValue) { this.localChecked = newValue; } }, methods: { handleChange() { this.$emit("update:value", this.localChecked); } } }; const _hoisted_1$i = { class: "item" }; const _hoisted_2$i = { class: "tit" }; function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [ vue.createElementVNode("div", _hoisted_2$i, vue.toDisplayString($props.sort) + ". 是否开启只看楼主", 1), vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.localChecked = $event), onChange: _cache[1] || (_cache[1] = (...args) => $options.handleChange && $options.handleChange(...args)) }, null, 544), [ [vue.vModelCheckbox, $data.localChecked] ]) ]); } const MenuLookOP = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$l], ["__scopeId", "data-v-2287508a"]]); const _sfc_main$k = { data() { return {}; }, methods: { lookop() { $(".post-stream").toggleClass("lookopwrapactive"); } } }; function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", { class: "el-button", onClick: _cache[0] || (_cache[0] = (...args) => $options.lookop && $options.lookop(...args)), title: "只看楼主" }, "楼主"); } const LookOP = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k]]); const _sfc_main$j = { data() { return { isMinimized: true, content: "输入用户名查询等级信息", username: "", levelDescriptions: { 0: "游客", 1: "基本用户", 2: "成员", 3: "活跃用户", 4: "领导者" }, levelRequirements: { 0: { topics_entered: 5, posts_read_count: 30, time_read: 600 }, 1: { days_visited: 15, likes_given: 1, likes_received: 1, post_count: 3, topics_entered: 20, posts_read_count: 100, time_read: 3600 }, 2: { days_visited: 50, likes_given: 30, likes_received: 20, post_count: 10, topics_entered: 0, posts_read_count: 0 } } }; }, methods: { async fetchAboutData() { try { const response = await fetch("/about.json", { headers: { Accept: "application/json", "User-Agent": "Mozilla/5.0" }, method: "GET" }); if (!response.ok) throw new Error(`HTTP 错误!状态:${response.status}`); return await response.json(); } catch (error) { console.error("获取关于页面数据失败:", error); this.displayError("获取关于页面数据失败"); return null; } }, async fetchUserData(username) { try { const response = await fetch(`/u/${username}/summary.json`, { headers: { Accept: "application/json", "User-Agent": "Mozilla/5.0" }, method: "GET" }); if (!response.ok) throw new Error(`HTTP 错误!状态:${response.status}`); return await response.json(); } catch (error) { console.error("获取用户数据失败:", error); this.displayError("获取用户数据失败"); return null; } }, async handleSearch() { if (this.username == "") { return false; } this.content = "正在查询中,请稍后..."; const username = this.username.trim(); if (username) { const aboutData = await this.fetchAboutData(); const userData = await this.fetchUserData(username); if (userData && aboutData) { const userSummary = userData.user_summary; const user = userData.users[0]; const status = aboutData.about.stats; this.updatePopupContent(userSummary, user, status); } } }, updatePopupContent(userSummary, user, status) { if (userSummary && user) { let content = `信任等级:${this.levelDescriptions[user.trust_level]}${url}(该用户签名非图片格式,已自动转文字)
` ); self.hide(); } else { url.replace(/\/+$/, ""); 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; if (domainPattern.test(url)) { self.after( `${url}(该用户签名非图片格式,已自动转文字)
` ); self.hide(); } else if (url.indexOf("photos.google.com") !== -1) { self.after( `${url}(该用户签名非图片格式,已自动转文字)
` ); self.hide(); } } } }); if ($(".menu-nav").length > 0) { $(".menu-nav li").each(function() { $(this).click(function() { const num = $(this).index(); $(".menu-nav li").removeClass("act"); $(this).addClass("act"); $(".menu-body-item").removeClass("act"); $(".menu-body-item").eq(num).addClass("act"); if (num == 2) { $(".menu-footer").addClass("hides"); } else { $(".menu-footer").removeClass("hides"); } }); }); } }, // 初始化设置 initialization() { localStorage.removeItem("linxudoscriptssetting"); setTimeout(() => { location.reload(); }, 1e3); } }, created() { setInterval(() => { if ($(".linuxdoscripts-setting").length < 1) { $(".sidebar-footer-actions").prepend(``); } }, 1e3); const linxudoscriptssetting = localStorage.getItem("linxudoscriptssetting"); if (linxudoscriptssetting) { this.settingData = JSON.parse(linxudoscriptssetting); this.showautoread = this.settingData.checked8.value1; this.showlookop = this.settingData.checked9; this.showlevelsearch = this.settingData.checked12; this.showaidialog = this.settingData.checked18; } else { localStorage.setItem("linxudoscriptssetting", JSON.stringify(this.settingData)); } setInterval(() => { this.runscripts(); }, 1e3); } }; const _hoisted_1 = { id: "linuxdoscripts" }; const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "linuxdoscripts-opacity" }, null, -1); const _hoisted_3 = { class: "setting-btn" }; const _hoisted_4 = { open: "", id: "menu_suspendedball" }; const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "linuxdo 增强插件设置", -1); const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("ul", { class: "menu-nav" }, [ /* @__PURE__ */ vue.createElementVNode("li", { class: "act" }, "基础设置"), /* @__PURE__ */ vue.createElementVNode("li", null, "自定义文字"), /* @__PURE__ */ vue.createElementVNode("li", null, "用户标签"), /* @__PURE__ */ vue.createElementVNode("li", null, "gpt 配置") ], -1); const _hoisted_7 = { class: "menu-body" }; const _hoisted_8 = { class: "menu-body-item act" }; const _hoisted_9 = { class: "menu-about" }; const _hoisted_10 = /* @__PURE__ */ vue.createElementVNode("p", null, "请注意,该设置面板数据全部保存在本地浏览器缓存中,注意备份。", -1); const _hoisted_11 = { class: "hint" }; const _hoisted_12 = { class: "menu-body-item" }; const _hoisted_13 = { class: "menu-body-item" }; const _hoisted_14 = { class: "menu-body-item" }; const _hoisted_15 = { class: "menu-footer" }; const _hoisted_16 = /* @__PURE__ */ vue.createElementVNode("a", { class: "btn", style: { "background": "#979797" }, href: "https://raw.githubusercontent.com/dlzmoe/linuxdo-scripts/main/linuxdo-scripts.user.js" }, "检测新版本", -1); const _hoisted_17 = { open: "" }; const _hoisted_18 = /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "楼层抽奖", -1); const _hoisted_19 = { class: "menu-body" }; const _hoisted_20 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "height": "20px" } }, null, -1); const _hoisted_21 = { key: 0 }; const _hoisted_22 = { key: 1, title: "抽奖结果", type: "success" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_AIDialog = vue.resolveComponent("AIDialog"); const _component_LevelDiglog = vue.resolveComponent("LevelDiglog"); const _component_AutoRead = vue.resolveComponent("AutoRead"); const _component_LookOP = vue.resolveComponent("LookOP"); const _component_MenuOpenpostblank = vue.resolveComponent("MenuOpenpostblank"); const _component_MenuNewtopicreminder = vue.resolveComponent("MenuNewtopicreminder"); const _component_MenuAutoexpandreply = vue.resolveComponent("MenuAutoexpandreply"); const _component_MenuShowcreatetime = vue.resolveComponent("MenuShowcreatetime"); const _component_MenuShowcreatetime1 = vue.resolveComponent("MenuShowcreatetime1"); const _component_MenuShowfloors = vue.resolveComponent("MenuShowfloors"); const _component_MenuHidetopicdetailtitle = vue.resolveComponent("MenuHidetopicdetailtitle"); const _component_MenuTopicpreview = vue.resolveComponent("MenuTopicpreview"); const _component_MenuAutoRead = vue.resolveComponent("MenuAutoRead"); const _component_MenuLookOP = vue.resolveComponent("MenuLookOP"); const _component_MenuFloorHeight = vue.resolveComponent("MenuFloorHeight"); const _component_MenuPangu = vue.resolveComponent("MenuPangu"); const _component_MenuLevelSearch = vue.resolveComponent("MenuLevelSearch"); const _component_MenuShowUnread = vue.resolveComponent("MenuShowUnread"); const _component_MenuFilterText = vue.resolveComponent("MenuFilterText"); const _component_MenuLookmeSign = vue.resolveComponent("MenuLookmeSign"); const _component_MenuQuickAccess = vue.resolveComponent("MenuQuickAccess"); const _component_MenureplaceEmojiStyle = vue.resolveComponent("MenureplaceEmojiStyle"); const _component_MenuShowAI = vue.resolveComponent("MenuShowAI"); const _component_MenuEditorJa = vue.resolveComponent("MenuEditorJa"); const _component_Updates = vue.resolveComponent("Updates"); const _component_MenuLogoUrl = vue.resolveComponent("MenuLogoUrl"); const _component_MenuCreatereply = vue.resolveComponent("MenuCreatereply"); const _component_MenuBlockuserlist = vue.resolveComponent("MenuBlockuserlist"); const _component_MenuOtherCss = vue.resolveComponent("MenuOtherCss"); const _component_UserTags = vue.resolveComponent("UserTags"); const _component_GPTconfig = vue.resolveComponent("GPTconfig"); const _component_UsageTip = vue.resolveComponent("UsageTip"); const _component_ReplyTBEnjoy = vue.resolveComponent("ReplyTBEnjoy"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ _hoisted_2, vue.createElementVNode("div", _hoisted_3, [ vue.withDirectives(vue.createVNode(_component_AIDialog, null, null, 512), [ [vue.vShow, $data.showaidialog] ]), vue.withDirectives(vue.createVNode(_component_LevelDiglog, null, null, 512), [ [vue.vShow, $data.showlevelsearch] ]), vue.withDirectives(vue.createVNode(_component_AutoRead, null, null, 512), [ [vue.vShow, $data.showautoread] ]), vue.withDirectives(vue.createVNode(_component_LookOP, null, null, 512), [ [vue.vShow, $data.showlookop] ]) ]), vue.createElementVNode("dialog", _hoisted_4, [ _hoisted_5, vue.createElementVNode("div", { class: "close", onClick: _cache[0] || (_cache[0] = (...args) => $options.closedialog && $options.closedialog(...args)) }, "+"), _hoisted_6, vue.createElementVNode("div", _hoisted_7, [ vue.createElementVNode("div", _hoisted_8, [ vue.createElementVNode("div", _hoisted_9, [ _hoisted_10, vue.createElementVNode("p", _hoisted_11, [ vue.createTextVNode(" 如果感觉哪里不太对劲,点我"), vue.createElementVNode("span", { class: "initialization", onClick: _cache[1] || (_cache[1] = (...args) => $options.initialization && $options.initialization(...args)) }, "初始化设置"), vue.createTextVNode(",会清除全部所有的设置数据并初始化,慎重使用! ") ]) ]), vue.createVNode(_component_MenuOpenpostblank, { sort: 1, value: $data.settingData.checked1, "onUpdate:value": _cache[2] || (_cache[2] = ($event) => $data.settingData.checked1 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuNewtopicreminder, { sort: 2, value: $data.settingData.checked2, "onUpdate:value": _cache[3] || (_cache[3] = ($event) => $data.settingData.checked2 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuAutoexpandreply, { sort: 3, value: $data.settingData.checked3, "onUpdate:value": _cache[4] || (_cache[4] = ($event) => $data.settingData.checked3 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuShowcreatetime, { sort: 4, value: $data.settingData.checked4, "onUpdate:value": _cache[5] || (_cache[5] = ($event) => $data.settingData.checked4 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuShowcreatetime1, { sort: 4.1, value: $data.settingData.checked41, "onUpdate:value": _cache[6] || (_cache[6] = ($event) => $data.settingData.checked41 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuShowfloors, { sort: 5, value: $data.settingData.checked5, "onUpdate:value": _cache[7] || (_cache[7] = ($event) => $data.settingData.checked5 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuHidetopicdetailtitle, { sort: 6, value: $data.settingData.checked6, "onUpdate:value": _cache[8] || (_cache[8] = ($event) => $data.settingData.checked6 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuTopicpreview, { sort: 7, value: $data.settingData.checked7, "onUpdate:value": _cache[9] || (_cache[9] = ($event) => $data.settingData.checked7 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuAutoRead, { sort: 8, value: $data.settingData.checked8, "onUpdate:value": _cache[10] || (_cache[10] = ($event) => $data.settingData.checked8 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuLookOP, { sort: 9, value: $data.settingData.checked9, "onUpdate:value": _cache[11] || (_cache[11] = ($event) => $data.settingData.checked9 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuFloorHeight, { sort: 10, value: $data.settingData.checked10, "onUpdate:value": _cache[12] || (_cache[12] = ($event) => $data.settingData.checked10 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuPangu, { sort: 11, value: $data.settingData.checked11, "onUpdate:value": _cache[13] || (_cache[13] = ($event) => $data.settingData.checked11 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuLevelSearch, { sort: 12, value: $data.settingData.checked12, "onUpdate:value": _cache[14] || (_cache[14] = ($event) => $data.settingData.checked12 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuShowUnread, { sort: 13, value: $data.settingData.checked13, "onUpdate:value": _cache[15] || (_cache[15] = ($event) => $data.settingData.checked13 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuFilterText, { sort: 14, value: $data.settingData.checked14, "onUpdate:value": _cache[16] || (_cache[16] = ($event) => $data.settingData.checked14 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuLookmeSign, { sort: 15, value: $data.settingData.checked15, "onUpdate:value": _cache[17] || (_cache[17] = ($event) => $data.settingData.checked15 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuQuickAccess, { sort: 16, value: $data.settingData.checked16, "onUpdate:value": _cache[18] || (_cache[18] = ($event) => $data.settingData.checked16 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenureplaceEmojiStyle, { sort: 17, value: $data.settingData.checked17, "onUpdate:value": _cache[19] || (_cache[19] = ($event) => $data.settingData.checked17 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuShowAI, { sort: 18, value: $data.settingData.checked18, "onUpdate:value": _cache[20] || (_cache[20] = ($event) => $data.settingData.checked18 = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuEditorJa, { sort: 19, value: $data.settingData.checked19, "onUpdate:value": _cache[21] || (_cache[21] = ($event) => $data.settingData.checked19 = $event) }, null, 8, ["value"]), vue.createVNode(_component_Updates) ]), vue.createElementVNode("div", _hoisted_12, [ vue.createVNode(_component_MenuLogoUrl, { sort: 1, value: $data.settingData.logourl, "onUpdate:value": _cache[22] || (_cache[22] = ($event) => $data.settingData.logourl = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuCreatereply, { sort: 2, value: $data.settingData.QuickReply, "onUpdate:value": _cache[23] || (_cache[23] = ($event) => $data.settingData.QuickReply = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuBlockuserlist, { sort: 3, value: $data.settingData.blockList, "onUpdate:value": _cache[24] || (_cache[24] = ($event) => $data.settingData.blockList = $event) }, null, 8, ["value"]), vue.createVNode(_component_MenuOtherCss, { sort: 4, value: $data.settingData.othercss, "onUpdate:value": _cache[25] || (_cache[25] = ($event) => $data.settingData.othercss = $event) }, null, 8, ["value"]) ]), vue.createElementVNode("div", _hoisted_13, [ vue.createVNode(_component_UserTags) ]), vue.createElementVNode("div", _hoisted_14, [ vue.createVNode(_component_GPTconfig, { value: $data.settingData.gptdata, "onUpdate:value": _cache[26] || (_cache[26] = ($event) => $data.settingData.gptdata = $event) }, null, 8, ["value"]) ]) ]), vue.createElementVNode("div", _hoisted_15, [ vue.createElementVNode("input", { type: "file", id: "fileInput", ref: "fileInput", style: { "display": "none" }, accept: ".json", onChange: _cache[27] || (_cache[27] = (...args) => $options.handleFileUpload && $options.handleFileUpload(...args)) }, null, 544), vue.createElementVNode("button", { class: "btn save", onClick: _cache[28] || (_cache[28] = (...args) => $options.save && $options.save(...args)) }, "保存"), vue.createElementVNode("button", { class: "btn saveload", onClick: _cache[29] || (_cache[29] = (...args) => $options.saveload && $options.saveload(...args)) }, "保存并刷新"), vue.createElementVNode("button", { class: "btn floorlottery", onClick: _cache[30] || (_cache[30] = (...args) => $options.openFloorlottery && $options.openFloorlottery(...args)) }, "楼层抽奖"), _hoisted_16, vue.createElementVNode("button", { class: "btn import", onClick: _cache[31] || (_cache[31] = (...args) => $options.triggerFileInput && $options.triggerFileInput(...args)) }, "导入"), vue.createElementVNode("button", { class: "btn export", onClick: _cache[32] || (_cache[32] = (...args) => $options.exportData && $options.exportData(...args)) }, "导出") ]) ]), vue.withDirectives(vue.createElementVNode("dialog", _hoisted_17, [ _hoisted_18, vue.createElementVNode("div", _hoisted_19, [ vue.withDirectives(vue.createElementVNode("input", { type: "text", "onUpdate:modelValue": _cache[33] || (_cache[33] = ($event) => $data.floorlotteryval1 = $event), placeholder: "请输入总数" }, null, 512), [ [vue.vModelText, $data.floorlotteryval1] ]), vue.withDirectives(vue.createElementVNode("input", { type: "text", "onUpdate:modelValue": _cache[34] || (_cache[34] = ($event) => $data.floorlotteryval2 = $event), placeholder: "请输入抽取的数量" }, null, 512), [ [vue.vModelText, $data.floorlotteryval2] ]), vue.createElementVNode("button", { type: "primary", onClick: _cache[35] || (_cache[35] = (...args) => $options.drawRandomNumbers && $options.drawRandomNumbers(...args)) }, "开始抽奖"), vue.createElementVNode("button", { type: "primary", plain: "", onClick: _cache[36] || (_cache[36] = (...args) => $options.closelotter && $options.closelotter(...args)) }, "关闭弹窗"), _hoisted_20, $data.floorlotterloading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, "正在抽奖...")) : vue.createCommentVNode("", true), $data.floorlotterresult ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22, " 抽奖结果:" + vue.toDisplayString($data.floorlotterresult), 1)) : vue.createCommentVNode("", true) ]) ], 512), [ [vue.vShow, $data.floorlotteryDialog] ]), vue.createVNode(_component_UsageTip), vue.createVNode(_component_ReplyTBEnjoy) ]); } const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); const app = vue.createApp(App); app.mount( (() => { const appDiv = document.createElement("div"); document.body.append(appDiv); return appDiv; })() ); })(Vue);