Add settings entries

This commit is contained in:
the1812 2020-09-05 21:42:14 +08:00
parent a12fad87f7
commit 3d63fcb22a
14 changed files with 90 additions and 33 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -117,9 +117,9 @@
"full-tweets-title.min.js": "DD57BB732ABEF7739CA84AEFF97E86F8984FCC4A8A75B957213622350B2A7C37",
"gbk.min.js": "872D7A4562F13A539C4A9AF1825DE89E610C775F1AD026EA6986A80DD74E4B53",
"get-number.min.js": "7B81A45D0F7D7F68CC6EDE25E02FCD76F8A05B2CF29274F94A99980BB23D8B76",
"gui-settings.min.css": "F4A6C927F3EEFA876C753E9348259D138C96F6A59DE4453275E222ABAAEC9667",
"gui-settings.min.html": "F2C2C3C0F3995BB98D954E3127D8DD288C95886DACBDE711C73239E660BF444B",
"gui-settings.min.js": "C306FF5E5A52DF78A8AD6FE82411A08BE3A2A6D6B15F3E9F863469A7A1DDC4F5",
"gui-settings.min.css": "A282A6720CDCB7E7C909763988BDD39C452C47A626BAC86D7576FA70FB0D6ACD",
"gui-settings.min.html": "7492A61262FF58A8704AE4FB419E3068232722D740137BE7E5EE576C3D03C1F1",
"gui-settings.min.js": "245A969294CFD6F73C6FE4F249AC9907564FB0C204CA22FD92465E7AD9CC77F7",
"haruna-scale.min.js": "FD079C86741F614FD63E733CF9B7B896A7D20110754815A540F3341D4DC252B2",
"hide-bangumi-reviews.min.js": "7265C0CE994FDA926355A9A4F9B207E7E68E749D47332F3C537EF93E97927A23",
"hide-bangumi-sponsors.min.js": "C862B67D5FC1DDC46412F5595A0B900A58F7A6D6E55A2464B6525DCB4D935FE7",
@ -135,7 +135,7 @@
"home-video.vue.min.js": "ACD3918903369692BF0AA0ADBE3E77B8D6B942EA1DAAB7138B362D263E9DC1F4",
"horizontal-scroll.min.js": "5E0CC9BFCE6A8D8C6576C2AA3BA46775EE109E2427DFC802B237C17BE397B559",
"i18n.de-DE.min.js": "5BDAC5F0493F447A98B4D308817B21AB2787BEF9E3929EA37F0D2ACD3D879337",
"i18n.en-US.min.js": "3AF17B07A7F03BDB0F05A5A5A13B7F31EB384EE6214E08FA9893BA41B4F672CF",
"i18n.en-US.min.js": "DCB0DC8C75DEA9E466C8005BE1580ABE4F26281F8C93BA1C2602304A3DBC5C61",
"i18n.ja-JP.min.js": "B8F1BC57D64342A8C6EF4B7BF3980B8448520C0DE6DC1FA389F67125A6A68827",
"i18n.min.css": "6C3B95DC9FB0DDA12E779E98FB51E0A46DEB60CE4BE44EBD490C6BA7B738261B",
"i18n.min.js": "2537C9D365EC1E6BEB1707BE5D2D035DD77BD135AA0B1A31C956C3CABBB8D7D0",

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,6 +17,22 @@
<div class="operations">
<i class="mdi mdi-dots-vertical"></i>
<div class="operations-menu">
<div class="operation home">
<i class="mdi mdi-home-circle"></i>
主页
</div>
<a class="operation feedback" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/issues">
<i class="mdi mdi-message-text-outline"></i>
反馈
</a>
<a class="operation release-notes" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/releases">
<i class="mdi mdi-update"></i>
更新日志
</a>
<a class="operation donate" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/blob/preview/donate.md">
<i class="mdi mdi-heart-circle"></i>
捐助
</a>
<div class="operation export">
<i class="mdi mdi-inbox-arrow-up"></i>
导出设置
@ -166,8 +182,11 @@
<checkbox indent="0" key="ajaxHook" dependencies=""></checkbox>
</ul>
<div class="script-info">
<div class="version"></div>
<a class="release-notes" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/releases">查看更新日志</a>
<div class="version selectable"></div>
<div class="content-hash selectable"></div>
<div class="grow"></div>
<a class="feedback" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/issues">反馈</a>
<a class="release-notes" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/releases">更新日志</a>
</div>
</div>
<div class="gui-settings-tooltip"></div>

View File

@ -230,6 +230,22 @@ function setDisplayNames () {
checkCompatibility()
setDisplayNames()
dq('.script-info .version').textContent = scriptVersion + ' v' + GM.info.script.version
;(async () => {
const hashElement = dq('.script-info .content-hash')
if (Object.keys(settings.cache).length === 0) {
hashElement.remove()
return
}
const digestMessage = async (message) => {
const msgUint8 = new TextEncoder().encode(message)
const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8)
const hashArray = Array.from(new Uint8Array(hashBuffer))
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('')
return hashHex
}
const hash = await digestMessage(JSON.stringify(settings.cache))
hashElement.textContent = `内容包: ${hash.substring(0, 7)}`
})()
new SettingsSearch()
}, { once: true })
})()

View File

@ -90,6 +90,7 @@
background-color: #333;
}
.operation {
color: inherit;
display: flex;
align-items: center;
padding: 8px 16px;
@ -99,8 +100,14 @@
.mdi {
margin-right: 8px;
}
&.release-notes {
.mdi {
transform: scale(1.1);
}
}
&:hover {
background-color: #8882;
color: inherit !important;
}
}
}
@ -180,18 +187,31 @@
.script-info {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px;
flex-wrap: wrap;
padding: 0 8px;
font-size: 12px;
> * {
padding: 8px 0;
&:not(:last-child) {
margin-right: 8px;
}
}
.grow {
flex: 1;
}
.selectable {
user-select: text;
}
.content-hash,
.version {
opacity: 0.75;
}
a {
color: inherit !important;
opacity: 0.5;
// opacity: 0.5;
&:hover,
&:active {
opacity: 1;
// opacity: 1;
color: var(--theme-color) !important;
}
}

View File

@ -914,7 +914,9 @@ export const map = new Map([
[`使用细滚动条`, `Use narrow scrollbar`],
[`网址AV号转换`, `Convert to AV ID`],
[`夜间模式跟随系统`, `Dark mode follows system`],
[`查看更新日志`, `Release Notes`],
[`更新日志`, `Release Notes`],
[`捐助`, `Donate`],
[`反馈`, `Feedback`],
[`条弹幕`, `danmaku(s)`],
[`字幕`, `Subtitle`],
[`科学科普`, `Popular Science`],