From c25e002b1b0d12fed485d6c1ca685659a63d530c Mon Sep 17 00:00:00 2001 From: cglatot Date: Sun, 11 Oct 2020 19:53:48 +0100 Subject: Add SxEx to titles in list --- js/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index fc94dec..f314cfc 100644 --- a/js/main.js +++ b/js/main.js @@ -708,8 +708,9 @@ function showSeasonInfo(data, row) { $("#subtitleTable tbody").empty(); for (let i = 0; i < episodes.length; i++) { + console.log(episodes[i]); let rowHTML = ` - ${episodes[i].title} + S${episodes[i].parentIndex}E${episodes[i].index} - ${episodes[i].title} `; $("#episodesTable tbody").append(rowHTML); } -- cgit v1.2.3 From e15c377f72b4ce1006340926d9306fa9c0ce93b6 Mon Sep 17 00:00:00 2001 From: cglatot Date: Sun, 11 Oct 2020 20:02:34 +0100 Subject: Scroll to tables --- js/main.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/main.js b/js/main.js index f314cfc..e810b75 100644 --- a/js/main.js +++ b/js/main.js @@ -506,6 +506,10 @@ function displayLibraries(data) { `; $("#libraryTable tbody").append(rowHTML); } + // Scroll to the table + document.querySelector('#libraryTable').scrollIntoView({ + behavior: 'smooth' + }); } function getAlphabet(uid, row) { @@ -607,6 +611,10 @@ function displayTitles(titles) { `; $("#tvShowsTable tbody").append(rowHTML); } + // Scroll to the table + document.querySelector('#tvShowsTable').scrollIntoView({ + behavior: 'smooth' + }); } function getTitleInfo(uid, row) { @@ -714,6 +722,10 @@ function showSeasonInfo(data, row) { `; $("#episodesTable tbody").append(rowHTML); } + // Scroll to the table + document.querySelector('#episodesTable').scrollIntoView({ + behavior: 'smooth' + }); } function getEpisodeInfo(uid, row) { @@ -776,6 +788,11 @@ function showEpisodeInfo(data, row) { -- `; $("#subtitleTable tbody").prepend(noSubsRow); + + // Scroll to the table + document.querySelector('#audioTable').scrollIntoView({ + behavior: 'smooth' + }); } async function setAudioStream(partsId, streamId, row) { -- cgit v1.2.3 From ad1bf72ef3be426a6fd44cab9284b21b565b1f80 Mon Sep 17 00:00:00 2001 From: cglatot Date: Sun, 11 Oct 2020 21:10:19 +0100 Subject: Toast notification for individual track changes --- css/main.css | 14 ++++++++++++++ index.html | 7 +++++++ js/main.js | 11 ++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/css/main.css b/css/main.css index 97c5c42..9bb7175 100644 --- a/css/main.css +++ b/css/main.css @@ -172,6 +172,20 @@ label, p { color: #856404 } +#successToast { + position: fixed; + top: 5%; + left: 0; + right: 0; + max-width: fit-content; + margin: auto; + z-index: 999; +} + +.toast.show { + opacity: 0.9; +} + /*========================== NAV TABS ==========================*/ diff --git a/index.html b/index.html index 040965e..651a698 100644 --- a/index.html +++ b/index.html @@ -150,6 +150,13 @@ + + +
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 = ` S${episodes[i].parentIndex}E${episodes[i].index} - ${episodes[i].title} `; @@ -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 ${audioTrackName}`); + $('#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 ${subtitleTrackName}`); + $('#successToast').toast('show'); }, "error": (data) => { console.log("ERROR L965"); -- cgit v1.2.3