From f1e406678260fe0370609e2d265d608bcb3f96bd Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Thu, 28 Dec 2017 18:27:55 +0100 Subject: [PATCH] Some web enhancement --- src/main/resources/static/index.html | 10 +++++++++- src/main/resources/static/js/init.js | 7 +++++-- src/main/resources/templates/music.html | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 18c00be..aa840ce 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -45,7 +45,15 @@ - + + diff --git a/src/main/resources/static/js/init.js b/src/main/resources/static/js/init.js index a92afbd..5423536 100644 --- a/src/main/resources/static/js/init.js +++ b/src/main/resources/static/js/init.js @@ -72,15 +72,18 @@ $(document).ready(function() { playlistLimit: $('#limit_range').val(), onHead: true }; + $('#input_link').val(''); sendCommand(JSON.stringify(command)); }) $('#btn_add_bottom').click(function () { + var command = { command: "ADD", url: $('#input_link').val(), playlistLimit: $('#limit_range').val(), onHead: false }; + $('#input_link').val(''); sendCommand(JSON.stringify(command)); }) @@ -200,7 +203,7 @@ function getPlayList() { content = content.replace("@title", element.title); content = content.replace("@author", element.author); content = content.replace("@lenght", msToTime(element.length)); - content = content.replace("@url", element.uri) + content = content.replace(/@url/g, element.uri); template.html(content); $('#playlist_list').append(template); @@ -254,7 +257,7 @@ function updateControl(data){ $('#btn_next').removeClass("disabled"); } - $('#music_img').attr("src","http://img.youtube.com/vi/"+data.info.identifier+"/hqdefault.jpg"); + $('#music_img').attr("src","https://img.youtube.com/vi/"+data.info.identifier+"/hqdefault.jpg"); updateModal(data); } diff --git a/src/main/resources/templates/music.html b/src/main/resources/templates/music.html index 556a45d..8dc9702 100644 --- a/src/main/resources/templates/music.html +++ b/src/main/resources/templates/music.html @@ -167,7 +167,7 @@