优化 代码

This commit is contained in:
xiu2
2021-08-10 01:37:14 +08:00
parent 7410b0c7a5
commit da009764f4
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -178,7 +178,7 @@
} else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
curSite = DBSite.youspace;
}
curSite.pageUrl = ""; // 下一页URL
curSite.pageUrl = ''; // 下一页URL
qianDao(); // 自动签到
pageLoading(); // 自动翻页
+6 -6
View File
@@ -207,7 +207,7 @@
}
}
curSite.pageUrl = ""; // 下一页URL
curSite.pageUrl = ''; // 下一页URL
if(menu_value('menu_fish'))fish(); // 标签页伪装为 Github(摸鱼)
if(menu_value('menu_autoClockIn'))setTimeout(qianDao, 1000); // 自动签到(后台),延迟 1 秒执行是为了兼容 [V2ex Plus] 扩展
if(menu_value('menu_pageLoading'))pageLoading(); // 自动翻页(无缝)
@@ -233,9 +233,9 @@
let timeOld = GM_getValue('menu_clockInTime')
if (!timeOld || timeOld != timeNow) {
qianDaoStatus_(timeNow) // 后台获取签到状态(并判断是否需要签到)
} else { // 新旧签到时间一致
}/* else { // 新旧签到时间一致
console.info('[V2EX 增强] 已经签过到了。')
}
}*/
}
}
@@ -271,7 +271,7 @@
function qianDaoStatus_(timeNow) {
GM_xmlhttpRequest({
url: 'https://www.v2ex.com/mission/daily',
method: "GET",
method: 'GET',
timeout: 5000,
onload: function (response) {
let html = ShowPager.createDocumentByString(response.responseText);
@@ -288,7 +288,7 @@
// 回到顶部(右键左右两侧空白处)
function backToTop() {
document.getElementById("Wrapper").oncontextmenu = document.querySelector("#Wrapper > .content").oncontextmenu = function(event){
document.getElementById('Wrapper').oncontextmenu = document.querySelector("#Wrapper > .content").oncontextmenu = function(event){
if (event.target==this) {
event.preventDefault();
window.scrollTo(0,0)
@@ -321,7 +321,7 @@
// 快速回复(双击左右两侧空白处)
function quickReply() {
document.getElementById("Wrapper").ondblclick = document.querySelector("#Wrapper > .content").ondblclick = function(event){
document.getElementById('Wrapper').ondblclick = document.querySelector('#Wrapper > .content').ondblclick = function(event){
if (event.target==this) {
if (document.querySelector('.box.reply-box-sticky')) {
document.getElementById('undock-button').click();