mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-21 15:44:26 +08:00
[✨ Feat] <Settings UI> Support custom access methods
1. [/] 修复了 PLS 下载时, 目录未递归创建导致的 ENOENT 错误。 2. [+] 现在可以通过多种方式访问 Aura 设置 UI 了, 更多详细信息, 请参见 #18。 3. [↑] 优化了 Tooltip 的渲染逻辑。
This commit is contained in:
@@ -1,5 +1,54 @@
|
||||
global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = {
|
||||
showAuraConfig: () => {
|
||||
window.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active = true;
|
||||
if (global.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active) return;
|
||||
global.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active = true;
|
||||
},
|
||||
};
|
||||
|
||||
(() => {
|
||||
let clickCounter = 0;
|
||||
let clickTimeout = null;
|
||||
|
||||
const onMounted = () => {
|
||||
if (global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon) {
|
||||
const iconEl = document.getElementsByClassName("aura-header-icon")[0];
|
||||
iconEl.classList.remove("aura-header-icon-hidden");
|
||||
}
|
||||
|
||||
if (
|
||||
global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod
|
||||
.fallbackAccessMethods.hotkey
|
||||
) {
|
||||
document.addEventListener("keydown", (event) => {
|
||||
if (event.ctrlKey && event.shiftKey && event.key === "A") {
|
||||
global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon.showAuraConfig();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod
|
||||
.fallbackAccessMethods.touch
|
||||
) {
|
||||
const mesModelEl = document.getElementsByClassName(
|
||||
"index__mes-modal__2hRouc6M"
|
||||
)[0];
|
||||
const verEl = mesModelEl.children[0];
|
||||
verEl.onclick = () => {
|
||||
clickCounter += 1;
|
||||
if (clickCounter >= 7) {
|
||||
global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon.showAuraConfig();
|
||||
clickCounter = 0;
|
||||
if (clickTimeout) {
|
||||
clearTimeout(clickTimeout);
|
||||
}
|
||||
}
|
||||
clickTimeout = setTimeout(() => {
|
||||
clickCounter = 0;
|
||||
}, 10000);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
onMounted();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user