diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/choose-bg-songs.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/choose-bg-songs.js index e90dd28b..b5e64dc6 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/choose-bg-songs.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/choose-bg-songs.js @@ -85,8 +85,8 @@ ${(categories.length > 14) ? '' : ''} `; Object.keys(categories).forEach(function (k) { - var catID = categories[k].id; - var songsInCat = wtvbgm.getCategorySongList(catID); + const catID = categories[k].id; + const songsInCat = wtvbgm.getCategorySongList(catID); if (songsInCat.length > 0) { if (catsListed == divide) { data += ` diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/region.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/region.js index 0de17437..1929f2d8 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/region.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/region.js @@ -1,4 +1,4 @@ -var minisrv_service_file = true; +const minisrv_service_file = true; let timezone = "-0000"; let zip = ""; @@ -15,7 +15,7 @@ if (session_data.isRegistered()) { } } -strf = strftime.timezone(timezone) +const strf = strftime.timezone(timezone) headers = `200 OK Connection: Keep-Alive @@ -28,7 +28,7 @@ Content-Type: text/html` -html = ` +data = ` Region Settings @@ -88,13 +88,13 @@ const timezones = [ ["UTC+08:00", "+0800"], ["UTC+09:00", "+0900"], ["UTC+10:00", "+1000"], ["UTC+11:00", "+1100"], ["UTC+12:00", "+1200"] ]; -html += `<select name="timezone" onchange="this.form.submit()">\n`; +data += `<select name="timezone" onchange="this.form.submit()">\n`; for (const tz of timezones) { - html += ` <option value="${tz[1]}" ${tz[1] === timezone ? 'selected' : ''}>${tz[0]}</option>\n`; + data += ` <option value="${tz[1]}" ${tz[1] === timezone ? 'selected' : ''}>${tz[0]}</option>\n`; } -html += `</select>`; +data += `</select>`; -html += `</form> +data += `</form> <p> @@ -137,6 +137,4 @@ html += `</form> </TABLE> </BODY> </HTML> -`; - -data = html; \ No newline at end of file +`; \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set-bg.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set-bg.js index e4d06d13..26aa8389 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set-bg.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set-bg.js @@ -1,4 +1,4 @@ -var minisrv_service_file = true; +const minisrv_service_file = true; if (request_headers.query.category) { const wtvbgm = new WTVBGMusic(minisrv_config, session_data); @@ -105,7 +105,7 @@ Choose the songs that you'd like to include. <td valign="top"> <input type="checkbox" name="enableSong" value=${musicList[k]['id']}${(wtvbgm.isSongEnabled(musicList[k]['id'])) ? ' checked="checked"' : ''}> </td><td valign="bottom">`; - const strLenLimit = 16; + 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) + "..."; @@ -150,7 +150,7 @@ Choose the songs that you'd like to include. </display></display></body></html>`; } else { - const errPage = doErrorPage("400", "Category ID is required."); + const errPage = wtvshared.doErrorPage("400", "Category ID is required."); headers = errPage[0]; data = errPage[1]; } \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set.js index 541635f4..566d86db 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/set.js @@ -1,7 +1,7 @@ const minisrv_service_file = true; if (request_headers.query && session_data) { - const settings_obj = session_data.getSessionData("wtv-setup"); + let settings_obj = session_data.getSessionData("wtv-setup"); if (settings_obj === null) settings_obj = {}; Object.keys(request_headers.query).forEach(function (k) { @@ -12,7 +12,7 @@ if (request_headers.query && session_data) { headers = `200 OK Content-type: text/html`; } else { - const errpage = doErrorPage(); + const errpage = wtvshared.doErrorPage(); headers = errpage[0]; data = errpage[1]; } \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-bg-song-category.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-bg-song-category.js index d54ab0a0..029af94e 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-bg-song-category.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-bg-song-category.js @@ -3,10 +3,10 @@ const minisrv_service_file = true; const wtvbgm = new WTVBGMusic(minisrv_config, session_data); if (request_headers.query && session_data) { - + let music_obj = wtvbgm.getMusicObj(); + const old_music_obj = Object.assign({}, music_obj); if (request_headers.request_url.indexOf('?') >= 0) { const category = (request_headers.query.category) ? request_headers.query.category : null; - const music_obj = wtvbgm.getMusicObj(); if (category == null) music_obj.enableCategories = []; else { @@ -52,7 +52,7 @@ wtv-backgroundmusic-load-playlist: wtv-setup:/get-playlist`; Content-type: text/html`; } } else { - const outdata = doErrorPage(); + const outdata = wtvshared.doErrorPage(); headers = outdata[0]; data = outdata[1]; } \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-change-password.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-change-password.js index 49a07ae7..491383f0 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-change-password.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-change-password.js @@ -7,14 +7,14 @@ let user_id = null; if (request_headers.query.user_id) { user_id = request_headers.query.user_id; } else { - errpage = doErrorPage(400, "User was not specified."); + errpage = wtvshared.doErrorPage(400, "User was not specified."); headers = errpage[0]; data = errpage[1]; } if (session_data.user_id != 0 && session_data.user_id != request_headers.query.user_id) { user_id = null; // force unset - errpage = doErrorPage(400, "You are not authorized to edit the selected user."); + errpage = wtvshared.doErrorPage(400, "You are not authorized to edit the selected user."); headers = errpage[0]; data = errpage[1]; } @@ -31,7 +31,7 @@ Content-Type: text/html` } if (!userSession.loadSessionData()) { - errpage = doErrorPage(400, "Invalid user ID."); + errpage = wtvshared.doErrorPage(400, "Invalid user ID."); headers = errpage[0]; data = errpage[1]; } diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-mail-signature.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-mail-signature.js index 880ad8d1..1559d5fc 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-mail-signature.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-mail-signature.js @@ -9,7 +9,7 @@ if (request_headers.query && session_data) { headers = `200 OK Content-type: text/html` } else { - const outdata = doErrorPage(); + const outdata = wtvshared.doErrorPage(); headers = outdata[0]; data = outdata[1]; } \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-remove-users.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-remove-users.js index 42f40f3c..d6011867 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-remove-users.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-remove-users.js @@ -6,7 +6,7 @@ if (Object.keys(session_data.listPrimaryAccountUsers()).length == 1) { } else if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to remove users from this account."); -var usersToRemove = []; +const usersToRemove = []; Object.keys(request_headers.query).forEach(function (k) { if (k.substr(0, 4) === "user" && request_headers.query[k] === "on") { usersToRemove.push(parseInt(k.replace("user", ""))); diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-transfer-account.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-transfer-account.js index b025fbf7..70c5feb0 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-transfer-account.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-transfer-account.js @@ -30,7 +30,7 @@ if (!session_data.getUserPasswordEnabled()) { headers = errpage[0]; data = errpage[1]; } else if (session_data.getUserPasswordEnabled() && session_data.user_id === 0 && request_headers.query.ssid && request_headers.query.password) { - validPassword = session_data.validateUserPassword(request_headers.query.password); + const validPassword = session_data.validateUserPassword(request_headers.query.password); if (!validPassword) { const errpage = wtvshared.doErrorPage(400, "Incorrect Password"); headers = errpage[0]; diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-tweaks.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-tweaks.js index 9b257edd..b3aad74b 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-tweaks.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-setup/validate-tweaks.js @@ -1,4 +1,4 @@ -var minisrv_service_file = true; +const minisrv_service_file = true; const fast_splash = wtvshared.parseBool(request_headers.query.fast_splash);