aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/main.js
diff options
context:
space:
mode:
authorcglatot <[email protected]>2020-10-11 21:10:19 +0100
committercglatot <[email protected]>2020-10-11 21:10:19 +0100
commitad1bf72ef3be426a6fd44cab9284b21b565b1f80 (patch)
tree355a0352836be10427b358c7c49d2410b220fb37 /js/main.js
parente15c377f72b4ce1006340926d9306fa9c0ce93b6 (diff)
downloadpasta-ad1bf72ef3be426a6fd44cab9284b21b565b1f80.tar.gz
pasta-ad1bf72ef3be426a6fd44cab9284b21b565b1f80.zip
Toast notification for individual track changes
Diffstat (limited to 'js/main.js')
-rw-r--r--js/main.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/js/main.js b/js/main.js
index e810b75..306412f 100644
--- a/js/main.js
+++ b/js/main.js
@@ -30,6 +30,8 @@ $(document).ready(() => {
$('.helpButtons, #titleLogo').tooltip();
// Enable history tracking for tabs
$('a[data-toggle="tab"]').historyTabs();
+ // Enable Toasts
+ $('.toast').toast({'delay': 1750});
// Check if the page was loaded locally or over http and warn them about the value of https
if ((location.protocol == "http:") || (location.protocol == "file:")) {
@@ -716,7 +718,6 @@ function showSeasonInfo(data, row) {
$("#subtitleTable tbody").empty();
for (let i = 0; i < episodes.length; i++) {
- console.log(episodes[i]);
let rowHTML = `<tr onclick="getEpisodeInfo(${episodes[i].ratingKey}, this)">
<td>S${episodes[i].parentIndex}E${episodes[i].index} - ${episodes[i].title}</td>
</tr>`;
@@ -816,6 +817,10 @@ async function setAudioStream(partsId, streamId, row) {
setTimeout(() => {
$(row).removeClass('success-transition');
}, 1750);
+ // Show the toast
+ let audioTrackName = $(row).find('td.name')[0].innerText;
+ $('#successToast .toast-body').html( `Audio track successfully updated to <strong>${audioTrackName}</strong>`);
+ $('#successToast').toast('show');
},
"error": (data) => {
console.log("ERROR L670");
@@ -1111,6 +1116,10 @@ async function setSubtitleStream(partsId, streamId, row) {
setTimeout(() => {
$(row).removeClass('success-transition');
}, 1750);
+ // Show the toast
+ let subtitleTrackName = $(row).find('td.name')[0].innerText;
+ $('#successToast .toast-body').html( `Subtitle track successfully updated to <strong>${subtitleTrackName}</strong>`);
+ $('#successToast').toast('show');
},
"error": (data) => {
console.log("ERROR L965");