Fix various minor javascript-related warnings

master
jvoisin 6 years ago
parent 1640411573
commit 9bd2c1e83f
  1. 22
      airsonic-main/src/main/webapp/WEB-INF/jsp/editTags.jsp
  2. 7
      airsonic-main/src/main/webapp/WEB-INF/jsp/more.jsp
  3. 2
      airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp
  4. 2
      airsonic-main/src/main/webapp/script/playQueue/javaJukeboxPlayerControlBar.js

@ -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 = "<b><fmt:message key="edittags.updated"/></b>";
} else {
message = "<div class='warning'><fmt:message key="edittags.error"/></div>"
message = "<div class='warning'><fmt:message key="edittags.error"/></div>";
var errors = dwr.util.getValue("errors");
errors += "<br>" + result + "<br>";
dwr.util.setValue("errors", errors, { escapeHtml:false });
@ -159,6 +159,6 @@
</table>
<p><input type="submit" id="save" value="<fmt:message key="common.save"/>" onclick="javascript:updateTags()"/></p>
<p><input type="submit" id="save" value="<fmt:message key="common.save"/>" onclick="updateTags()"/></p>
<div class="warning" id="errors"/>
</body></html>

@ -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 + "<fmt:message key="more.upload.progress"/>";
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++) {

@ -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) {

@ -6,7 +6,7 @@ var javaJukeboxPlayerModel = {
playing : false,
songDuration : null,
songPosition : 0
}
};
function refreshView() {
if (javaJukeboxPlayerModel.playing == true) {

Loading…
Cancel
Save