From 330937cbe661538aada4cd1328fea072aac2c79e Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 8 Oct 2023 06:43:40 +0000 Subject: [PATCH] add my account :3 --- html/poketube.ejs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index d7591fe4..96c2661b 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -661,7 +661,11 @@ But Please note that unofficial instances can add the same lock icon, so please Customize PokeTube - + + +Account + + Region settings @@ -997,7 +1001,7 @@ display: block; !important;" autoplay controls - +
@@ -1758,6 +1762,20 @@ if (!urlParams.has('hl') && !urlParams.has('region') && languageCode && regionCo location.href = currentURL + `®ion=${regionCode}&hl=${languageCode}`; } +var anchor = document.getElementById("sub"); + +// Check if there's a user ID in localStorage +var userID = localStorage.getItem("UserID"); + +if (userID) { + // If user ID exists in localStorage, set the href attribute + anchor.href = `/api/set-channel-subs?ID=${userID}&channelName=<%=k.Video.Channel.Name%>&avatar=https://p.poketube.fun/<%= k.Video.Channel.Avatar[1].$t %>&channelID=<%=video?.Channel.id || k.Video.Channel.id %>`; +} else { + // If user ID doesn't exist in localStorage, you can handle it as needed + console.log("User ID not found in localStorage"); + // Optionally, you can set a default href or display an error message. +} + // Now, all the selected video links should have the parameters added to their href attributes // Now, all the selected links should have the parameters appended