Skip to content

Commit

Permalink
clear
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikaiiiiiii committed Jun 27, 2024
1 parent 202ee82 commit 28b4b6b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions psnineplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,11 @@
const tdElements = document.querySelectorAll('table.list tbody > tr');

// 添加完成度染色

const platinumBackground = 'background-color: #d0f6ff;background-image: linear-gradient(90deg, #c7fffd 0%, #ffffff 60%);'
const goldBackground = 'background-color: #e5ffe7;background-image: linear-gradient(90deg, #daffde 0%, #ffffff 60%);'
const personalGameCompletions = GM_getValue('personalGameCompletions', [])

// 根据已保存的完成度添加染色
tdElements.forEach((tr) => {
const gameID = tr.getAttribute('id') || 0;
const thisGameCompletion = personalGameCompletions.find(item => item[0] == gameID);
Expand All @@ -434,7 +435,6 @@
}
})


// 创建新的 span 元素
const spanElement = document.createElement('span');
spanElement.className = 'btn';
Expand Down Expand Up @@ -557,11 +557,9 @@
const savePersonalGameCompletions = (configifneeded) => {

// if GM_setValue && GM_getValue is enabled

let thisFeatureEnabled = configifneeded || true && (typeof GM_setValue === 'function' && typeof GM_getValue === 'function')

if (thisFeatureEnabled) {

// 获得当前页的游戏完成度
const tdElements = document.querySelectorAll('table.list tbody > tr');
const personalGameCompletions = Array.from(tdElements).map((tr) => {
Expand All @@ -571,7 +569,6 @@
const platinum = platinumElement ? platinumElement.textContent == '白1' : false
const gameIDElement = tr.querySelector('a')
const gameID = gameIDElement.href.match(/\/psngame\/(\d+)/)[1]

return [gameID, completion, platinum]
})

Expand All @@ -590,7 +587,7 @@

// 保存更新后的历史记录
GM_setValue('personalGameCompletions', history);
console.log(GM_getValue('personalGameCompletions'))
// console.log(GM_getValue('personalGameCompletions'))
return true
} else {
return false
Expand All @@ -605,7 +602,6 @@
}



if (
/psnid\/[A-Za-z0-9_-]+\/?$/.test(window.location.href)
&& $('tbody').length > 2
Expand Down

0 comments on commit 28b4b6b

Please sign in to comment.