From 3aad419dc264107368f7ee94625babedf3f67494 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 16 Mar 2022 19:58:55 +0300 Subject: Added Soju #109 --- src/pages/options/general/general.html | 11 ++ src/pages/options/imgur/imgur.html | 23 +++ src/pages/options/instagram/instagram.html | 4 + src/pages/options/lbry/lbry.html | 4 + src/pages/options/maps/maps.html | 22 +++ src/pages/options/medium/medium.html | 23 +++ src/pages/options/peertube/peertube.html | 23 +++ src/pages/options/pixiv/pixiv.html | 23 +++ src/pages/options/reddit/reddit.html | 23 +++ src/pages/options/search/search.html | 23 +++ src/pages/options/sendTargets/sendTargets.html | 4 + src/pages/options/spotify/spotify.html | 198 +++++++++++++++++++++++ src/pages/options/spotify/spotify.js | 59 +++++++ src/pages/options/tiktok/tiktok.html | 22 +++ src/pages/options/translate/translate.html | 25 ++- src/pages/options/twitter/twitter.html | 25 ++- src/pages/options/wikipedia/wikipedia.html | 6 +- src/pages/options/youtube/youtube.html | 4 + src/pages/options/youtubeMusic/youtubeMusic.html | 6 +- 19 files changed, 524 insertions(+), 4 deletions(-) create mode 100644 src/pages/options/spotify/spotify.html create mode 100644 src/pages/options/spotify/spotify.js (limited to 'src/pages/options') diff --git a/src/pages/options/general/general.html b/src/pages/options/general/general.html index 7fa004e6..98e9fca6 100644 --- a/src/pages/options/general/general.html +++ b/src/pages/options/general/general.html @@ -51,6 +51,10 @@ Pixiv +
+ + Spotify +
Wikipedia @@ -258,6 +262,13 @@
+
+
+ + Spotify +
+ +
diff --git a/src/pages/options/imgur/imgur.html b/src/pages/options/imgur/imgur.html index 2519622a..0eb50b9f 100644 --- a/src/pages/options/imgur/imgur.html +++ b/src/pages/options/imgur/imgur.html @@ -12,6 +12,7 @@
diff --git a/src/pages/options/instagram/instagram.html b/src/pages/options/instagram/instagram.html index 9ff3b3d2..fe01b384 100644 --- a/src/pages/options/instagram/instagram.html +++ b/src/pages/options/instagram/instagram.html @@ -53,6 +53,10 @@ Pixiv
+
+ + Spotify +
Wikipedia diff --git a/src/pages/options/lbry/lbry.html b/src/pages/options/lbry/lbry.html index c1fddf35..c17a64b5 100644 --- a/src/pages/options/lbry/lbry.html +++ b/src/pages/options/lbry/lbry.html @@ -52,6 +52,10 @@ Pixiv
+
+ + Spotify +
Wikipedia diff --git a/src/pages/options/maps/maps.html b/src/pages/options/maps/maps.html index 04272146..d175e3b1 100644 --- a/src/pages/options/maps/maps.html +++ b/src/pages/options/maps/maps.html @@ -13,6 +13,7 @@
diff --git a/src/pages/options/medium/medium.html b/src/pages/options/medium/medium.html index 6b69bdc8..6332f738 100644 --- a/src/pages/options/medium/medium.html +++ b/src/pages/options/medium/medium.html @@ -12,6 +12,7 @@
diff --git a/src/pages/options/peertube/peertube.html b/src/pages/options/peertube/peertube.html index 1ef835f1..2e61a1a3 100644 --- a/src/pages/options/peertube/peertube.html +++ b/src/pages/options/peertube/peertube.html @@ -11,6 +11,7 @@ +
diff --git a/src/pages/options/pixiv/pixiv.html b/src/pages/options/pixiv/pixiv.html index a66c5d29..241c327e 100644 --- a/src/pages/options/pixiv/pixiv.html +++ b/src/pages/options/pixiv/pixiv.html @@ -12,6 +12,7 @@
diff --git a/src/pages/options/reddit/reddit.html b/src/pages/options/reddit/reddit.html index 97f5093b..a9c0b9bc 100644 --- a/src/pages/options/reddit/reddit.html +++ b/src/pages/options/reddit/reddit.html @@ -12,6 +12,7 @@ diff --git a/src/pages/options/search/search.html b/src/pages/options/search/search.html index 6683c299..3539dbe2 100644 --- a/src/pages/options/search/search.html +++ b/src/pages/options/search/search.html @@ -12,6 +12,7 @@
diff --git a/src/pages/options/sendTargets/sendTargets.html b/src/pages/options/sendTargets/sendTargets.html index 983db907..76a794a5 100644 --- a/src/pages/options/sendTargets/sendTargets.html +++ b/src/pages/options/sendTargets/sendTargets.html @@ -52,6 +52,10 @@ Pixiv
+
+ + Spotify +
Wikipedia diff --git a/src/pages/options/spotify/spotify.html b/src/pages/options/spotify/spotify.html new file mode 100644 index 00000000..9bf08ef9 --- /dev/null +++ b/src/pages/options/spotify/spotify.html @@ -0,0 +1,198 @@ + + + + + + + + + + LibRedirect Options: TikTok + + + + + +
+
+

Enable

+ +
+ +
+

Protocol

+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/src/pages/options/spotify/spotify.js b/src/pages/options/spotify/spotify.js new file mode 100644 index 00000000..1bd078cb --- /dev/null +++ b/src/pages/options/spotify/spotify.js @@ -0,0 +1,59 @@ +import spotifyHelper from "../../../assets/javascripts/helpers/spotify.js"; +import commonHelper from "../../../assets/javascripts/helpers/common.js"; + +let disableSpotifyElement = document.getElementById("disable-spotify"); +disableSpotifyElement.addEventListener("change", + (event) => spotifyHelper.setDisable(!event.target.checked) +); + +let protocolElement = document.getElementById("protocol") +protocolElement.addEventListener("change", + (event) => { + let protocol = event.target.options[protocolElement.selectedIndex].value + spotifyHelper.setProtocol(protocol); + changeProtocolSettings(protocol); + } +); + +function changeProtocolSettings(protocol) { + let normalDiv = document.getElementById("normal"); + let torDiv = document.getElementById("tor"); + if (protocol == 'normal') { + normalDiv.style.display = 'block'; + torDiv.style.display = 'none'; + } + else if (protocol == 'tor') { + normalDiv.style.display = 'none'; + torDiv.style.display = 'block'; + } +} + +spotifyHelper.init().then(() => { + disableSpotifyElement.checked = !spotifyHelper.getDisable(); + + let protocol = spotifyHelper.getProtocol(); + protocolElement.value = protocol; + changeProtocolSettings(protocol); + + commonHelper.processDefaultCustomInstances( + 'soju', + 'normal', + spotifyHelper, + document, + spotifyHelper.getSojuNormalRedirectsChecks, + spotifyHelper.setSojuNormalRedirectsChecks, + spotifyHelper.getSojuNormalCustomRedirects, + spotifyHelper.setSojuNormalCustomRedirects + ); + + commonHelper.processDefaultCustomInstances( + 'soju', + 'tor', + spotifyHelper, + document, + spotifyHelper.getSojuTorRedirectsChecks, + spotifyHelper.setSojuTorRedirectsChecks, + spotifyHelper.getSojuTorCustomRedirects, + spotifyHelper.setSojuTorCustomRedirects + ) +}) \ No newline at end of file diff --git a/src/pages/options/tiktok/tiktok.html b/src/pages/options/tiktok/tiktok.html index 4f82cecd..16e62a31 100644 --- a/src/pages/options/tiktok/tiktok.html +++ b/src/pages/options/tiktok/tiktok.html @@ -12,6 +12,7 @@
diff --git a/src/pages/options/translate/translate.html b/src/pages/options/translate/translate.html index 34b2ebe5..37a2f2f0 100644 --- a/src/pages/options/translate/translate.html +++ b/src/pages/options/translate/translate.html @@ -12,6 +12,7 @@
+
@@ -81,6 +100,7 @@ Search
+
@@ -89,6 +109,7 @@ Translate
+ + +
diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html index 9e4a5d45..33e1d5c9 100644 --- a/src/pages/options/twitter/twitter.html +++ b/src/pages/options/twitter/twitter.html @@ -13,6 +13,7 @@
+
@@ -82,6 +101,7 @@ Search
+
@@ -90,6 +110,7 @@ Translate
+ + +
diff --git a/src/pages/options/wikipedia/wikipedia.html b/src/pages/options/wikipedia/wikipedia.html index 1c12ea16..be8bd5ad 100644 --- a/src/pages/options/wikipedia/wikipedia.html +++ b/src/pages/options/wikipedia/wikipedia.html @@ -52,6 +52,10 @@ Pixiv
+
+ + Spotify +
Wikipedia @@ -72,7 +76,7 @@ +
diff --git a/src/pages/options/youtube/youtube.html b/src/pages/options/youtube/youtube.html index 6146171e..ce19aa6c 100644 --- a/src/pages/options/youtube/youtube.html +++ b/src/pages/options/youtube/youtube.html @@ -53,6 +53,10 @@ Pixiv
+
+ + Spotify +
Wikipedia diff --git a/src/pages/options/youtubeMusic/youtubeMusic.html b/src/pages/options/youtubeMusic/youtubeMusic.html index ca90dcc4..ffa3cca2 100644 --- a/src/pages/options/youtubeMusic/youtubeMusic.html +++ b/src/pages/options/youtubeMusic/youtubeMusic.html @@ -53,6 +53,10 @@ Pixiv
+
+ + Spotify +
Wikipedia @@ -73,7 +77,7 @@ +
-- cgit 1.4.1