用户:RedDragon/Test2:修订间差异
来自Rizline中文维基
更多操作
小 |
小 |
||
| 第36行: | 第36行: | ||
<script> | <script> | ||
document.addEventListener('DOMContentLoaded', () => { | document.addEventListener('DOMContentLoaded', () => { | ||
fetch('https://rizwiki.cn/api.php?action=query&titles=曲目列表&prop=revisions&rvprop=content&format=json') | fetch('https://rizwiki.cn/api.php?action=query&titles=曲目列表&prop=revisions&rvprop=content&format=json&origin=*') | ||
.then(r => r.ok ? r.json() : Promise.reject('网络错误')) | .then(r => r.ok ? r.json() : Promise.reject('网络错误')) | ||
.then(data => { | .then(data => { | ||
| 第76行: | 第76行: | ||
function loadSongColors(song) { | function loadSongColors(song) { | ||
fetch(`https://rizwiki.cn/api.php?action=query&titles=${encodeURIComponent(song.title)}&prop=revisions&rvprop=content&format=json`) | fetch(`https://rizwiki.cn/api.php?action=query&titles=${encodeURIComponent(song.title)}&prop=revisions&rvprop=content&format=json&origin=*`) | ||
.then(r => r.ok ? r.json() : Promise.reject('页面不存在')) | .then(r => r.ok ? r.json() : Promise.reject('页面不存在')) | ||
.then(data => { | .then(data => { | ||
| 第118行: | 第118行: | ||
function parseImageFromWikitext(wikitext) { | function parseImageFromWikitext(wikitext) { | ||
const fileMatch = wikitext.match(/\[\[文件:(.*?)\]\]/) | |||
if (fileMatch) { | |||
const fileName = fileMatch[1] | |||
return `https://rizwiki.cn/images/thumb/${fileName.substring(0, 1)}/${fileName.substring(0, 2)}/${fileName}/300px-${fileName}` | |||
} | } | ||
return null | |||
} | |||
function updateSongInfo(song, data) { | function updateSongInfo(song, data) { | ||
2025年10月19日 (日) 21:38的版本
| 曲目 | |
|---|---|
|
|
|
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
神秘的随机挑战!
| 曲目 | |
|---|---|
|
| |
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2