From 9bd2c1e83f1252cd591974024be8309493dcc3cd Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 15 Jun 2019 17:27:03 +0200 Subject: [PATCH] Fix various minor javascript-related warnings --- .../src/main/webapp/WEB-INF/jsp/editTags.jsp | 22 +++++++++---------- .../src/main/webapp/WEB-INF/jsp/more.jsp | 7 +++--- .../src/main/webapp/WEB-INF/jsp/playQueue.jsp | 2 +- .../playQueue/javaJukeboxPlayerControlBar.js | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/airsonic-main/src/main/webapp/WEB-INF/jsp/editTags.jsp b/airsonic-main/src/main/webapp/WEB-INF/jsp/editTags.jsp index d0a2125c..c3816b21 100644 --- a/airsonic-main/src/main/webapp/WEB-INF/jsp/editTags.jsp +++ b/airsonic-main/src/main/webapp/WEB-INF/jsp/editTags.jsp @@ -13,48 +13,48 @@ var fileCount = ${fn:length(model.songs)}; function setArtist() { var artist = dwr.util.getValue("artistAll"); - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { dwr.util.setValue("artist" + i, artist); } } function setAlbum() { var album = dwr.util.getValue("albumAll"); - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { dwr.util.setValue("album" + i, album); } } function setYear() { var year = dwr.util.getValue("yearAll"); - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { dwr.util.setValue("year" + i, year); } } function setGenre() { var genre = dwr.util.getValue("genreAll"); - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { dwr.util.setValue("genre" + i, genre); } } function suggestTitle() { - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { var title = dwr.util.getValue("suggestedTitle" + i); dwr.util.setValue("title" + i, title); } } function resetTitle() { - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { var title = dwr.util.getValue("originalTitle" + i); dwr.util.setValue("title" + i, title); } } function suggestTrack() { - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { var track = dwr.util.getValue("suggestedTrack" + i); dwr.util.setValue("track" + i, track); } } function resetTrack() { - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { var track = dwr.util.getValue("originalTrack" + i); dwr.util.setValue("track" + i, track); } @@ -63,7 +63,7 @@ document.getElementById("save").disabled = true; index = 0; dwr.util.setValue("errors", ""); - for (i = 0; i < fileCount; i++) { + for (var i = 0; i < fileCount; i++) { dwr.util.setValue("status" + i, ""); } updateNextTag(); @@ -86,7 +86,7 @@ } else if (result == "UPDATED") { message = ""; } else { - message = "
" + message = "
"; var errors = dwr.util.getValue("errors"); errors += "
" + result + "
"; dwr.util.setValue("errors", errors, { escapeHtml:false }); @@ -159,6 +159,6 @@ -

" onclick="javascript:updateTags()"/>

+

" onclick="updateTags()"/>

\ No newline at end of file diff --git a/airsonic-main/src/main/webapp/WEB-INF/jsp/more.jsp b/airsonic-main/src/main/webapp/WEB-INF/jsp/more.jsp index b50a2d81..76219f4c 100644 --- a/airsonic-main/src/main/webapp/WEB-INF/jsp/more.jsp +++ b/airsonic-main/src/main/webapp/WEB-INF/jsp/more.jsp @@ -26,8 +26,7 @@ if (uploadInfo.bytesTotal > 0) { var percent = Math.ceil((uploadInfo.bytesUploaded / uploadInfo.bytesTotal) * 100); - var width = parseInt(percent * 3.5) + 'px'; - progressBarContent.style.width = width; + progressBarContent.style.width = parseInt(percent * 3.5) + 'px'; progressText.innerHTML = percent + ""; progressBar.style.display = "block"; progressText.style.display = "block"; @@ -61,7 +60,7 @@ var data = JSON.parse(localStorage.getItem("randomPlayQueue")); } catch(e) { return; } if (data == null ) { return; } - elements = form.getElementsByTagName("input"); + var elements = form.getElementsByTagName("input"); for (var i = 0; i < elements.length; i++) { if (elements[i].type == "hidden") continue; if (elements[i].type == "submit") continue; @@ -86,7 +85,7 @@ function saveShuffleForm() { if (!isLocalStorageEnabled()) return; var form = document.getElementById("randomPlayQueue"); - var data = {} + var data = {}; var elements = []; elements = form.getElementsByTagName("input"); for (var i = 0; i < elements.length; i++) { diff --git a/airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp b/airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp index 965c3278..1783e6e8 100644 --- a/airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp +++ b/airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp @@ -228,7 +228,7 @@ /** * Increase or decrease volume by a certain amount * - * @param amount to add or remove from the current volume + * @param gain amount to add or remove from the current volume */ function onGainAdd(gain) { if (CastPlayer.castSession) { diff --git a/airsonic-main/src/main/webapp/script/playQueue/javaJukeboxPlayerControlBar.js b/airsonic-main/src/main/webapp/script/playQueue/javaJukeboxPlayerControlBar.js index f789bf53..5aebf8b5 100644 --- a/airsonic-main/src/main/webapp/script/playQueue/javaJukeboxPlayerControlBar.js +++ b/airsonic-main/src/main/webapp/script/playQueue/javaJukeboxPlayerControlBar.js @@ -6,7 +6,7 @@ var javaJukeboxPlayerModel = { playing : false, songDuration : null, songPosition : 0 -} +}; function refreshView() { if (javaJukeboxPlayerModel.playing == true) {