chaowenguo
commited on
Commit
•
efb95ed
1
Parent(s):
af7c35b
Update index.js
Browse files
index.js
CHANGED
@@ -5,11 +5,13 @@ globalThis.document.querySelector('div[style*="flex-direction"] > button').oncli
|
|
5 |
}
|
6 |
for (const button of globalThis.document.querySelectorAll('div[style*="justify-content"] button')) button.onclick = async event =>
|
7 |
{
|
|
|
|
|
8 |
for (const episode of await globalThis.fetch('https://backend.chaowenguo.eu.org/list', {method:'post', body:event.target.textContent}).then(_ => _.json()))
|
9 |
{
|
10 |
const hyperlink = globalThis.document.createElement('a')
|
11 |
hyperlink.textContent = hyperlink.href = episode
|
12 |
-
globalThis.document.querySelector('div[style*="flex-direction"]')
|
13 |
}
|
14 |
globalThis.document.querySelector('div[style*="flex-direction"]').style.width = globalThis.document.querySelector('body > nav').style.marginLeft = globalThis.document.querySelector('div[style*="justify-content"]').style.marginLeft = globalThis.document.querySelector('video').style.marginLeft = '10%'
|
15 |
}
|
|
|
5 |
}
|
6 |
for (const button of globalThis.document.querySelectorAll('div[style*="justify-content"] button')) button.onclick = async event =>
|
7 |
{
|
8 |
+
const list = globalThis.document.querySelector('div[style*="flex-direction"]')
|
9 |
+
list.replaceChildren()
|
10 |
for (const episode of await globalThis.fetch('https://backend.chaowenguo.eu.org/list', {method:'post', body:event.target.textContent}).then(_ => _.json()))
|
11 |
{
|
12 |
const hyperlink = globalThis.document.createElement('a')
|
13 |
hyperlink.textContent = hyperlink.href = episode
|
14 |
+
list.globalThis.document.querySelector('div[style*="flex-direction"]')appendChild(hyperlink)
|
15 |
}
|
16 |
globalThis.document.querySelector('div[style*="flex-direction"]').style.width = globalThis.document.querySelector('body > nav').style.marginLeft = globalThis.document.querySelector('div[style*="justify-content"]').style.marginLeft = globalThis.document.querySelector('video').style.marginLeft = '10%'
|
17 |
}
|