more BGMusic updates

- update getCategoryList to return obj
- 2 custom categories
- improved classic support
- only tell client to refresh playlist if the playlist has changed
- move reset defaults for bgmusic due to autosubmit onleave on category page
- rearrange songs: move Lufia Fortress near Lufia Map
This commit is contained in:
zefie
2021-11-09 18:32:58 -05:00
parent 2251aad735
commit a76c31a9c8
39 changed files with 315 additions and 43 deletions

View File

@@ -53,7 +53,7 @@ ${categoryName}
</td><td colspan="3">
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td absheight="80" valign="center">
${(musicList.length > 14) ? '<td absheight="50" valign="center">' : '<td absheight="80" valign="center">'}
<font size="+2" color="E7CE4A"><blackface><shadow>
${categoryName}
</shadow></blackface></font></td></tr><tr><td>
@@ -71,8 +71,7 @@ Choose the songs that you'd like to include.
<input type="hidden" autosubmit="onLeave">
`;
var songsListed = 0;
var numSongs = musicList.length;
var divide = Math.round(numSongs / 2, 0);
var divide = Math.round(musicList.length / 2, 0);
Object.keys(musicList).forEach(function (k) {
if (songsListed == divide) {
data += `</td ><td width="20">
@@ -82,9 +81,12 @@ Choose the songs that you'd like to include.
<tbody><tr>
<td valign="top">
<input type="checkbox" name="enableSong" value=${musicList[k]['id']}${(wtvbgm.isSongEnabled(musicList[k]['id'])) ? ' checked="checked"' : ''}>
</td><td valign="bottom">
<a href=${musicList[k]['url']}?wtv-title=${escape(musicList[k]['title'])}>${musicList[k]['title']}</a>
</td><td valign="bottom">`;
if (musicList[k]['title'].length > 12 && musicList[k]['title'].length < 18) data += `<font size="-1">`;
if (musicList[k]['title'].length > 18) data += `<font size="-2">`;
data += `<a href=${musicList[k]['url']}?wtv-title=${escape(musicList[k]['title'])}>${musicList[k]['title']}</a>
</td></tr></tbody></table>`;
if (musicList[k]['title'].length > 12) data += `</font>`;
songsListed++;
});