diff --git a/CHANGELOG.md b/CHANGELOG.md index 43995e6b..730f8555 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,15 @@ # Changelog -## v3.1.6 +## v3.1.7-beta +- Added a hint in the popup if no channel has yet been visited. + + +## v3.1.6 + - Reverted UI changes made while the playlist generation feature was broken. - Removed hints from the breaking news page. - ## v3.1.5 diff --git a/src/html/popup/popup.js b/src/html/popup/popup.js index 39d99cb5..c545657c 100644 --- a/src/html/popup/popup.js +++ b/src/html/popup/popup.js @@ -82,6 +82,10 @@ function getPopupDomElements() { channelCustomOptionsDiv: document.getElementById("channelCustomOptionsDiv"), // Custom options per channel: Channel name and description channelCustomOptionsHeader: channelCustomOptionsDiv.children.namedItem("channelCustomOptionsHeader"), + // Custom options per channel: Options explanation + channelCustomOptionsExplanationP: channelCustomOptionsDiv.children.namedItem("channelCustomOptionsExplanationP"), + // Custom options per channel: No channel has been visited div + channelNoneVisitedYetP: channelCustomOptionsDiv.children.namedItem("channelNoneVisitedYetP"), // Custom options per channel: Dropdown menu Div (only for reference below) channelCustomOptionsDropdownDiv: channelCustomOptionsDiv.children.namedItem("channelCustomOptionsDropdownDiv"), // Dropdown menu div: Dropdown menu @@ -182,8 +186,12 @@ async function setPopupDomElementValuesFromConfig(domElements) { updateDomElementsDependentOnChannel(domElements); // ----- Custom options per channel div ----- - if (configSync.currentChannelId) { - domElements.channelCustomOptionsDiv.classList.remove("hidden"); + if (!configSync.currentChannelId) { + domElements.channelCustomOptionsExplanationP.classList.add("hidden"); + domElements.channelNoneVisitedYetP.classList.remove("hidden"); + + domElements.popupShuffleButton.classList.add("hidden"); + domElements.channelCustomOptionsDropdownDiv.classList.add("disabled"); } // Contains logic for all the "For your information" div content @@ -491,13 +499,13 @@ async function determineOverlayVisibility(domElements) { // Responsible for all DOM elements that need a reference to the current channel async function updateDomElementsDependentOnChannel(domElements) { // ----- Custom options per channel: Channel name and description ----- - domElements.channelCustomOptionsHeader.innerText = `Channel Settings: ${configSync.currentChannelName}`; + domElements.channelCustomOptionsHeader.innerText = configSync.currentChannelName ? `Channel Settings: ${configSync.currentChannelName}` : "Channel Settings"; // ----- Custom options per channel: Dropdown menu ----- updateChannelSettingsDropdownMenu(domElements); // ----- Popup shuffle button ----- - domElements.popupShuffleButton.innerText = `Shuffle from: ${configSync.currentChannelName}`; + domElements.popupShuffleButton.innerText = configSync.currentChannelName ? `Shuffle from: ${configSync.currentChannelName}`: "This will be a shuffle button!"; } async function updateChannelSettingsDropdownMenu(domElements) { diff --git a/static/html/popup.html b/static/html/popup.html index 7207a26a..20767861 100644 --- a/static/html/popup.html +++ b/static/html/popup.html @@ -131,9 +131,11 @@
Customize your most recently visited channel.
+Customize your most recently visited channel.
+ +Shuffle from
diff --git a/static/manifest.json b/static/manifest.json index bdf180ae..cecf2799 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -2,7 +2,7 @@ "name": "Random YouTube Video", "description": "Customize, shuffle and play random videos from any YouTube channel.", "version": "3.1.6", - "version_name": "3.1.6", + "version_name": "3.1.7-beta", "manifest_version": 3, "content_scripts": [ {