Fix various minor javascript-related warnings
This commit is contained in:
@@ -13,48 +13,48 @@
|
|||||||
var fileCount = ${fn:length(model.songs)};
|
var fileCount = ${fn:length(model.songs)};
|
||||||
function setArtist() {
|
function setArtist() {
|
||||||
var artist = dwr.util.getValue("artistAll");
|
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);
|
dwr.util.setValue("artist" + i, artist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function setAlbum() {
|
function setAlbum() {
|
||||||
var album = dwr.util.getValue("albumAll");
|
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);
|
dwr.util.setValue("album" + i, album);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function setYear() {
|
function setYear() {
|
||||||
var year = dwr.util.getValue("yearAll");
|
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);
|
dwr.util.setValue("year" + i, year);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function setGenre() {
|
function setGenre() {
|
||||||
var genre = dwr.util.getValue("genreAll");
|
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);
|
dwr.util.setValue("genre" + i, genre);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function suggestTitle() {
|
function suggestTitle() {
|
||||||
for (i = 0; i < fileCount; i++) {
|
for (var i = 0; i < fileCount; i++) {
|
||||||
var title = dwr.util.getValue("suggestedTitle" + i);
|
var title = dwr.util.getValue("suggestedTitle" + i);
|
||||||
dwr.util.setValue("title" + i, title);
|
dwr.util.setValue("title" + i, title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function resetTitle() {
|
function resetTitle() {
|
||||||
for (i = 0; i < fileCount; i++) {
|
for (var i = 0; i < fileCount; i++) {
|
||||||
var title = dwr.util.getValue("originalTitle" + i);
|
var title = dwr.util.getValue("originalTitle" + i);
|
||||||
dwr.util.setValue("title" + i, title);
|
dwr.util.setValue("title" + i, title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function suggestTrack() {
|
function suggestTrack() {
|
||||||
for (i = 0; i < fileCount; i++) {
|
for (var i = 0; i < fileCount; i++) {
|
||||||
var track = dwr.util.getValue("suggestedTrack" + i);
|
var track = dwr.util.getValue("suggestedTrack" + i);
|
||||||
dwr.util.setValue("track" + i, track);
|
dwr.util.setValue("track" + i, track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function resetTrack() {
|
function resetTrack() {
|
||||||
for (i = 0; i < fileCount; i++) {
|
for (var i = 0; i < fileCount; i++) {
|
||||||
var track = dwr.util.getValue("originalTrack" + i);
|
var track = dwr.util.getValue("originalTrack" + i);
|
||||||
dwr.util.setValue("track" + i, track);
|
dwr.util.setValue("track" + i, track);
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
document.getElementById("save").disabled = true;
|
document.getElementById("save").disabled = true;
|
||||||
index = 0;
|
index = 0;
|
||||||
dwr.util.setValue("errors", "");
|
dwr.util.setValue("errors", "");
|
||||||
for (i = 0; i < fileCount; i++) {
|
for (var i = 0; i < fileCount; i++) {
|
||||||
dwr.util.setValue("status" + i, "");
|
dwr.util.setValue("status" + i, "");
|
||||||
}
|
}
|
||||||
updateNextTag();
|
updateNextTag();
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
} else if (result == "UPDATED") {
|
} else if (result == "UPDATED") {
|
||||||
message = "<b><fmt:message key="edittags.updated"/></b>";
|
message = "<b><fmt:message key="edittags.updated"/></b>";
|
||||||
} else {
|
} 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");
|
var errors = dwr.util.getValue("errors");
|
||||||
errors += "<br>" + result + "<br>";
|
errors += "<br>" + result + "<br>";
|
||||||
dwr.util.setValue("errors", errors, { escapeHtml:false });
|
dwr.util.setValue("errors", errors, { escapeHtml:false });
|
||||||
@@ -159,6 +159,6 @@
|
|||||||
|
|
||||||
</table>
|
</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"/>
|
<div class="warning" id="errors"/>
|
||||||
</body></html>
|
</body></html>
|
||||||
@@ -26,8 +26,7 @@
|
|||||||
|
|
||||||
if (uploadInfo.bytesTotal > 0) {
|
if (uploadInfo.bytesTotal > 0) {
|
||||||
var percent = Math.ceil((uploadInfo.bytesUploaded / uploadInfo.bytesTotal) * 100);
|
var percent = Math.ceil((uploadInfo.bytesUploaded / uploadInfo.bytesTotal) * 100);
|
||||||
var width = parseInt(percent * 3.5) + 'px';
|
progressBarContent.style.width = parseInt(percent * 3.5) + 'px';
|
||||||
progressBarContent.style.width = width;
|
|
||||||
progressText.innerHTML = percent + "<fmt:message key="more.upload.progress"/>";
|
progressText.innerHTML = percent + "<fmt:message key="more.upload.progress"/>";
|
||||||
progressBar.style.display = "block";
|
progressBar.style.display = "block";
|
||||||
progressText.style.display = "block";
|
progressText.style.display = "block";
|
||||||
@@ -61,7 +60,7 @@
|
|||||||
var data = JSON.parse(localStorage.getItem("randomPlayQueue"));
|
var data = JSON.parse(localStorage.getItem("randomPlayQueue"));
|
||||||
} catch(e) { return; }
|
} catch(e) { return; }
|
||||||
if (data == null ) { return; }
|
if (data == null ) { return; }
|
||||||
elements = form.getElementsByTagName("input");
|
var elements = form.getElementsByTagName("input");
|
||||||
for (var i = 0; i < elements.length; i++) {
|
for (var i = 0; i < elements.length; i++) {
|
||||||
if (elements[i].type == "hidden") continue;
|
if (elements[i].type == "hidden") continue;
|
||||||
if (elements[i].type == "submit") continue;
|
if (elements[i].type == "submit") continue;
|
||||||
@@ -86,7 +85,7 @@
|
|||||||
function saveShuffleForm() {
|
function saveShuffleForm() {
|
||||||
if (!isLocalStorageEnabled()) return;
|
if (!isLocalStorageEnabled()) return;
|
||||||
var form = document.getElementById("randomPlayQueue");
|
var form = document.getElementById("randomPlayQueue");
|
||||||
var data = {}
|
var data = {};
|
||||||
var elements = [];
|
var elements = [];
|
||||||
elements = form.getElementsByTagName("input");
|
elements = form.getElementsByTagName("input");
|
||||||
for (var i = 0; i < elements.length; i++) {
|
for (var i = 0; i < elements.length; i++) {
|
||||||
|
|||||||
@@ -228,7 +228,7 @@
|
|||||||
/**
|
/**
|
||||||
* Increase or decrease volume by a certain amount
|
* 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) {
|
function onGainAdd(gain) {
|
||||||
if (CastPlayer.castSession) {
|
if (CastPlayer.castSession) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ var javaJukeboxPlayerModel = {
|
|||||||
playing : false,
|
playing : false,
|
||||||
songDuration : null,
|
songDuration : null,
|
||||||
songPosition : 0
|
songPosition : 0
|
||||||
}
|
};
|
||||||
|
|
||||||
function refreshView() {
|
function refreshView() {
|
||||||
if (javaJukeboxPlayerModel.playing == true) {
|
if (javaJukeboxPlayerModel.playing == true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user