Update inject.js
Signed-off-by: AvaLilac <amyshimplays@gmail.com>
This commit is contained in:
parent
84ecbc5233
commit
b2afc5d363
1 changed files with 18 additions and 15 deletions
|
|
@ -243,10 +243,15 @@
|
||||||
const appearanceBtn = Array.from(document.querySelectorAll('a')).find(a => a.textContent.trim() === 'Appearance');
|
const appearanceBtn = Array.from(document.querySelectorAll('a')).find(a => a.textContent.trim() === 'Appearance');
|
||||||
if (!appearanceBtn) return;
|
if (!appearanceBtn) return;
|
||||||
|
|
||||||
const targetBtn = document.querySelector(
|
const aviaHeader = [...document.querySelectorAll('span')]
|
||||||
'a.pos_relative.min-w_0.d_flex.ai_center.p_6px_8px.bdr_8px.fw_500.me_12px.fs_15px.us_none.trs_background-color_0\\.1s_ease-in-out.c_var\\(\\--md-sys-color-on-surface\\).fill_var\\(\\--md-sys-color-on-surface\\).bg_unset'
|
.find(s => s.textContent.trim() === "AVIA CLIENT SETTINGS");
|
||||||
);
|
if (!aviaHeader) return;
|
||||||
if (!targetBtn) return;
|
|
||||||
|
const aviaContainer = aviaHeader.closest('.d_flex.flex-d_column');
|
||||||
|
if (!aviaContainer) return;
|
||||||
|
|
||||||
|
const targetParent = aviaContainer.querySelector('.d_flex.flex-d_column.gap_var\\(--gap-s\\)');
|
||||||
|
if (!targetParent) return;
|
||||||
|
|
||||||
if (!document.getElementById('stoat-fake-linktree')) {
|
if (!document.getElementById('stoat-fake-linktree')) {
|
||||||
const linktreeBtn = appearanceBtn.cloneNode(true);
|
const linktreeBtn = appearanceBtn.cloneNode(true);
|
||||||
|
|
@ -255,7 +260,7 @@
|
||||||
if (textNode) textNode.textContent = "(Avia) Ava's Linktree";
|
if (textNode) textNode.textContent = "(Avia) Ava's Linktree";
|
||||||
setIcon(linktreeBtn, "monitor");
|
setIcon(linktreeBtn, "monitor");
|
||||||
linktreeBtn.addEventListener('click', () => window.open(LINKTREE_URL, "_blank"));
|
linktreeBtn.addEventListener('click', () => window.open(LINKTREE_URL, "_blank"));
|
||||||
targetBtn.parentElement.insertBefore(linktreeBtn, targetBtn);
|
targetParent.appendChild(linktreeBtn);
|
||||||
|
|
||||||
const stoatBtn = appearanceBtn.cloneNode(true);
|
const stoatBtn = appearanceBtn.cloneNode(true);
|
||||||
stoatBtn.id = 'stoat-fake-stoatserver';
|
stoatBtn.id = 'stoat-fake-stoatserver';
|
||||||
|
|
@ -263,7 +268,7 @@
|
||||||
if (stoatTextNode) stoatTextNode.textContent = "(Avia) Stoat Server";
|
if (stoatTextNode) stoatTextNode.textContent = "(Avia) Stoat Server";
|
||||||
setIcon(stoatBtn, "monitor");
|
setIcon(stoatBtn, "monitor");
|
||||||
stoatBtn.addEventListener('click', () => window.open(STOAT_SERVER_URL, "_blank"));
|
stoatBtn.addEventListener('click', () => window.open(STOAT_SERVER_URL, "_blank"));
|
||||||
linktreeBtn.parentElement.insertBefore(stoatBtn, linktreeBtn.nextSibling);
|
targetParent.appendChild(stoatBtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!document.getElementById('stoat-fake-loadfont')) {
|
if (!document.getElementById('stoat-fake-loadfont')) {
|
||||||
|
|
@ -275,8 +280,7 @@
|
||||||
newBtn.addEventListener('click', showFontLoaderPopup);
|
newBtn.addEventListener('click', showFontLoaderPopup);
|
||||||
|
|
||||||
const stoatBtn = document.getElementById('stoat-fake-stoatserver');
|
const stoatBtn = document.getElementById('stoat-fake-stoatserver');
|
||||||
stoatBtn ? stoatBtn.parentElement.insertBefore(newBtn, stoatBtn.nextSibling) :
|
targetParent.appendChild(newBtn);
|
||||||
document.getElementById('stoat-fake-linktree').parentElement.insertBefore(newBtn, document.getElementById('stoat-fake-linktree').nextSibling);
|
|
||||||
|
|
||||||
if (!document.getElementById('stoat-fake-removefont')) {
|
if (!document.getElementById('stoat-fake-removefont')) {
|
||||||
const removeBtn = appearanceBtn.cloneNode(true);
|
const removeBtn = appearanceBtn.cloneNode(true);
|
||||||
|
|
@ -285,7 +289,7 @@
|
||||||
if (removeTextNode) removeTextNode.textContent = "(Avia) Remove selected font";
|
if (removeTextNode) removeTextNode.textContent = "(Avia) Remove selected font";
|
||||||
setIcon(removeBtn, "refresh");
|
setIcon(removeBtn, "refresh");
|
||||||
removeBtn.addEventListener('click', showRemoveFontPopup);
|
removeBtn.addEventListener('click', showRemoveFontPopup);
|
||||||
newBtn.parentElement.insertBefore(removeBtn, newBtn.nextSibling);
|
targetParent.appendChild(removeBtn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -301,8 +305,7 @@
|
||||||
document.getElementById('stoat-fake-loadfont') ||
|
document.getElementById('stoat-fake-loadfont') ||
|
||||||
document.getElementById('stoat-fake-stoatserver') ||
|
document.getElementById('stoat-fake-stoatserver') ||
|
||||||
document.getElementById('stoat-fake-linktree');
|
document.getElementById('stoat-fake-linktree');
|
||||||
lastBtn.parentElement.insertBefore(quickCssBtn, lastBtn.nextSibling);
|
targetParent.appendChild(quickCssBtn); }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyQuickCSS(css) {
|
function applyQuickCSS(css) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue