diff --git a/maloja/web/static/css/maloja.css b/maloja/web/static/css/maloja.css index 7f91dde..bb9f397 100644 --- a/maloja/web/static/css/maloja.css +++ b/maloja/web/static/css/maloja.css @@ -363,12 +363,14 @@ div#notification_area { right:20px; } div#notification_area div.notification { - background-color:white; + background-color:black; width:400px; min-height:50px; margin-bottom:7px; padding:9px; - opacity:0.4; + opacity:0.5; + border-left: 8px solid var(--notification-color); + border-radius: 3px; } div#notification_area div.notification:hover { opacity:0.95; diff --git a/maloja/web/static/js/manualscrobble.js b/maloja/web/static/js/manualscrobble.js index bc276c1..3fa1dda 100644 --- a/maloja/web/static/js/manualscrobble.js +++ b/maloja/web/static/js/manualscrobble.js @@ -126,7 +126,7 @@ function scrobble(artists,title,albumartists,album,timestamp) { lastArtists = artists; lastTrack = title; lastAlbum = album; - lastAlbumartists = albumartists; + lastAlbumartists = albumartists || []; var payload = { "artists":artists, diff --git a/maloja/web/static/js/notifications.js b/maloja/web/static/js/notifications.js index 1cdf323..a548d99 100644 --- a/maloja/web/static/js/notifications.js +++ b/maloja/web/static/js/notifications.js @@ -1,12 +1,14 @@ // JS for feedback to the user whenever any XHTTP action is taken const colors = { - 'warning':'red', + 'error': 'red', + 'warning':'#8ACC26', 'info':'green' } + const notification_template = info => ` -
+
${info.title}
${info.body} @@ -35,18 +37,24 @@ function notify(title,msg,notification_type='info',reload=false) { } function notifyCallback(request) { - var body = request.response; + var response = request.response; var status = request.status; if (status == 200) { - var notification_type = 'info'; + if (response.hasOwnProperty('warnings') && response.warnings.length > 0) { + var notification_type = 'warning'; + } + else { + var notification_type = 'info'; + } + var title = "Success!"; - var msg = body.desc || body; + var msg = response.desc || response; } else { - var notification_type = 'warning'; - var title = "Error: " + body.error.type; - var msg = body.error.desc || ""; + var notification_type = 'error'; + var title = "Error: " + response.error.type; + var msg = response.error.desc || ""; }