fix/optimize wtv-news, wtv-proxy, wtv-register, wtv-search, wtv-setup, wtv-star

This commit is contained in:
zefie
2025-08-12 19:19:23 -04:00
parent d5f41837c0
commit 74ec365ae1
20 changed files with 141 additions and 133 deletions

View File

@@ -49,5 +49,5 @@ Content-Type: text/html`;
data += k + "=" + encodeURIComponent(settings_obj[k]) + "&";
});
data = data.substring(0, (data.length - 1));
data = data.slice(0, (data.length - 1));
}

View File

@@ -108,7 +108,7 @@ Choose the songs that you'd like to include.
let strLenLimit = 16;
if (musicList.length > 14) strLenLimit = 20;
let songTitle = musicList[k]['title'];
if (songTitle.length > strLenLimit) songTitle = musicList[k]['title'].substr(0, strLenLimit - 3) + "...";
if (songTitle.length > strLenLimit) songTitle = musicList[k]['title'].slice(0, strLenLimit - 3) + "...";
if (musicList.length > 14) data += '<font size="-2">';
data += `<a href="${musicList[k]['url']}?wtv-title=${encodeURIComponent(musicList[k]['title'])}" onmouseout="clearTitle()" onmouseover="showTitle('${musicList[k]['title'].replace(/\'/g, "\\'")}')">${songTitle}</a>
</td></tr></tbody></table>`;

View File

@@ -8,7 +8,7 @@ else if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You ar
const usersToRemove = [];
Object.keys(request_headers.query).forEach(function (k) {
if (k.substr(0, 4) === "user" && request_headers.query[k] === "on") {
if (k.slice(0, 4) === "user" && request_headers.query[k] === "on") {
usersToRemove.push(parseInt(k.replace("user", "")));
}
});
@@ -31,7 +31,7 @@ if (errpage) {
}
let removeurl = request_headers.request_url;
if (removeurl.indexOf('?') >= 0) {
removeurl = removeurl.substring(0, removeurl.indexOf('?'));
removeurl = removeurl.slice(0, removeurl.indexOf('?'));
}
removeurl += "?";