Update index.js
#2
by
chaowenguo
- opened
index.js
CHANGED
@@ -6,17 +6,18 @@ globalThis.document.querySelector('div[style*="flex-direction"] > button').oncli
|
|
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.
|
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 |
-
|
|
|
14 |
list.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 |
}
|
18 |
const drama = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
|
19 |
-
globalThis.document.querySelector('title').textContent = globalThis.document.querySelector('h1').textContent = drama
|
20 |
for (const episode of globalThis.Array(globalThis.Number(await globalThis.fetch('https://backend.chaowenguo.eu.org/episode', {method:'post', body:drama}).then(_ => _.text()))).keys())
|
21 |
{
|
22 |
const button = globalThis.document.createElement('button')
|
|
|
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 |
+
for (const hyperlink of list.querySelectorAll('a')) hyperlink.remove()
|
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.href = ['', event.target.textContent, episode].join('/')
|
14 |
+
hyperlink.textContent = episode
|
15 |
list.appendChild(hyperlink)
|
16 |
}
|
17 |
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%'
|
18 |
}
|
19 |
const drama = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
|
20 |
+
globalThis.document.querySelector('title').textContent = globalThis.document.querySelector('h1').textContent = drama.split('/').at(-1)
|
21 |
for (const episode of globalThis.Array(globalThis.Number(await globalThis.fetch('https://backend.chaowenguo.eu.org/episode', {method:'post', body:drama}).then(_ => _.text()))).keys())
|
22 |
{
|
23 |
const button = globalThis.document.createElement('button')
|