This commit is contained in:
SuperBFG7 2021-07-29 11:57:55 +02:00
parent 7b5496e06c
commit f5080c8419
1 changed files with 17 additions and 7 deletions

View File

@ -103,7 +103,11 @@ var app = $.sammy(function () {
full_path = full_path + chunk; full_path = full_path + chunk;
$('#breadcrump').append( $('#breadcrump').append(
'<li><a uri="' + encodeURIComponent(full_path) + '">' + chunk + '</a></li>' '<li><a uri="' +
encodeURIComponent(full_path) +
'">' +
chunk +
'</a></li>'
); );
full_path += '/'; full_path += '/';
}); });
@ -444,9 +448,9 @@ function webSocketConnect() {
/* The use of encodeURIComponent() below might seem useless, but it's not. It prevents /* The use of encodeURIComponent() below might seem useless, but it's not. It prevents
* some browsers, such as Safari, from changing the normalization form of the * some browsers, such as Safari, from changing the normalization form of the
* URI from NFD to NFC, breaking our link with MPD. * URI from NFD to NFC, breaking our link with MPD.
* *
* encodeURIComponent() instead of encodeURI() is used to ensure special characters * encodeURIComponent() instead of encodeURI() is used to ensure special characters
* (like e.g. +) are handled correctly. * (like e.g. +) are handled correctly.
*/ */
if ($('#salamisandwich > tbody').is(':ui-sortable')) { if ($('#salamisandwich > tbody').is(':ui-sortable')) {
$('#salamisandwich > tbody').sortable('destroy'); $('#salamisandwich > tbody').sortable('destroy');
@ -489,7 +493,9 @@ function webSocketConnect() {
} }
$('#salamisandwich > tbody').append( $('#salamisandwich > tbody').append(
'<tr uri="' + '<tr uri="' +
encodeURIComponent(obj.data[item].plist) + encodeURIComponent(
obj.data[item].plist
) +
'" class="' + '" class="' +
clazz + clazz +
'">' + '">' +
@ -667,7 +673,9 @@ function webSocketConnect() {
case 'song': case 'song':
socket.send( socket.send(
'MPD_API_ADD_TRACK,' + 'MPD_API_ADD_TRACK,' +
decodeURIComponent($(this).attr('uri')) decodeURIComponent(
$(this).attr('uri')
)
); );
$('.top-right') $('.top-right')
.notify({ .notify({
@ -686,7 +694,9 @@ function webSocketConnect() {
case 'plist': case 'plist':
socket.send( socket.send(
'MPD_API_ADD_PLAYLIST,' + 'MPD_API_ADD_PLAYLIST,' +
decodeURIComponent($(this).attr('uri')) decodeURIComponent(
$(this).attr('uri')
)
); );
$('.top-right') $('.top-right')
.notify({ .notify({