Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Vic authored Aug 29, 2017
1 parent 802e5e5 commit f76e464
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion WebInterface/Audio/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ body #lyricsElem {
width: 150px;
height: 150px;
bottom: 127px;
position: absolute;
position: fixed;
overflow-y: scroll;
background-color: white;
border: 10px solid white;
Expand Down
6 changes: 5 additions & 1 deletion WebInterface/Audio/mediaHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ function displayLyrics(artist, songName) {
}).catch(err => console.err);
}

function escapeString(string) {
return string.replace(/\'/g, "\\'");
}




Expand Down Expand Up @@ -254,7 +258,7 @@ function mediaSession() {
const dataDiv = document.createElement('div');

dataDiv.id = 'artistInfo';
dataDiv.innerHTML += `<p style="font-size: 120%;">Song info:</p> <img id="infoBtn" onclick="displayLyrics('${json.artist}', '${json.title}')" src="Assets/ic_info_outline_white.svg"><hr>`;
dataDiv.innerHTML += `<p style="font-size: 120%;">Song info:</p> <img id="infoBtn" onclick="displayLyrics('${escapeString(json.artist)}', '${escapeString(json.title)}')" src="Assets/ic_info_outline_white.svg"><hr>`;
dataDiv.innerHTML += `<p><b>Title:</b> ${json.title}</p>`;
dataDiv.innerHTML += `<p><b>Artist:</b> ${json.artist}</p>`;
dataDiv.innerHTML += `<p><b>Album:</b> ${json.album}</p>`;
Expand Down

0 comments on commit f76e464

Please sign in to comment.