From 439c9e49c46743d900329df71569b074db743709 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Thu, 17 Mar 2022 10:58:05 +0300 Subject: Disabled soju in code as you can access songs through embeds #109 --- src/pages/options/.spotify/.spotify.html | 198 +++++++++++++++++++++++ src/pages/options/.spotify/.spotify.js | 59 +++++++ src/pages/options/general/general.html | 8 +- src/pages/options/imgur/imgur.html | 4 +- src/pages/options/instagram/instagram.html | 4 +- src/pages/options/lbry/lbry.html | 4 +- src/pages/options/maps/maps.html | 4 +- src/pages/options/medium/medium.html | 4 +- src/pages/options/peertube/peertube.html | 4 +- src/pages/options/pixiv/pixiv.html | 4 +- src/pages/options/reddit/reddit.html | 4 +- src/pages/options/search/search.html | 4 +- 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 | 4 +- src/pages/options/translate/translate.html | 4 +- src/pages/options/twitter/twitter.html | 4 +- src/pages/options/wikipedia/wikipedia.html | 4 +- src/pages/options/youtube/youtube.html | 4 +- src/pages/options/youtubeMusic/youtubeMusic.html | 4 +- 21 files changed, 293 insertions(+), 293 deletions(-) create mode 100644 src/pages/options/.spotify/.spotify.html create mode 100644 src/pages/options/.spotify/.spotify.js delete mode 100644 src/pages/options/spotify/spotify.html delete mode 100644 src/pages/options/spotify/spotify.js (limited to 'src/pages/options') diff --git a/src/pages/options/.spotify/.spotify.html b/src/pages/options/.spotify/.spotify.html new file mode 100644 index 00000000..e0553743 --- /dev/null +++ b/src/pages/options/.spotify/.spotify.html @@ -0,0 +1,198 @@ + + + + + + + + + + LibRedirect: Spotify + + + + + +
+
+

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/general/general.html b/src/pages/options/general/general.html index 98e9fca6..b602036a 100644 --- a/src/pages/options/general/general.html +++ b/src/pages/options/general/general.html @@ -51,10 +51,10 @@ Pixiv -
+
Wikipedia @@ -262,13 +262,13 @@
-
+
diff --git a/src/pages/options/imgur/imgur.html b/src/pages/options/imgur/imgur.html index 37b7bda1..b74cfb4f 100644 --- a/src/pages/options/imgur/imgur.html +++ b/src/pages/options/imgur/imgur.html @@ -62,10 +62,10 @@ Pixiv
-
+
diff --git a/src/pages/options/instagram/instagram.html b/src/pages/options/instagram/instagram.html index 51b6c58d..0f4c352a 100644 --- a/src/pages/options/instagram/instagram.html +++ b/src/pages/options/instagram/instagram.html @@ -53,10 +53,10 @@ Pixiv
-
+
Wikipedia diff --git a/src/pages/options/lbry/lbry.html b/src/pages/options/lbry/lbry.html index 16ea3875..a7e826b3 100644 --- a/src/pages/options/lbry/lbry.html +++ b/src/pages/options/lbry/lbry.html @@ -52,10 +52,10 @@ Pixiv
-
+
Wikipedia diff --git a/src/pages/options/maps/maps.html b/src/pages/options/maps/maps.html index 6f10c270..bbb0009e 100644 --- a/src/pages/options/maps/maps.html +++ b/src/pages/options/maps/maps.html @@ -63,10 +63,10 @@ Pixiv
-
+
diff --git a/src/pages/options/medium/medium.html b/src/pages/options/medium/medium.html index ee922d17..dd354c03 100644 --- a/src/pages/options/medium/medium.html +++ b/src/pages/options/medium/medium.html @@ -62,10 +62,10 @@ Pixiv
-
+
diff --git a/src/pages/options/peertube/peertube.html b/src/pages/options/peertube/peertube.html index 23009d1d..99738685 100644 --- a/src/pages/options/peertube/peertube.html +++ b/src/pages/options/peertube/peertube.html @@ -62,10 +62,10 @@ Pixiv
-
+
diff --git a/src/pages/options/pixiv/pixiv.html b/src/pages/options/pixiv/pixiv.html index 8f6630da..56724a93 100644 --- a/src/pages/options/pixiv/pixiv.html +++ b/src/pages/options/pixiv/pixiv.html @@ -62,10 +62,10 @@ Pixiv
-
+
diff --git a/src/pages/options/reddit/reddit.html b/src/pages/options/reddit/reddit.html index 57f29b15..c3c49b3e 100644 --- a/src/pages/options/reddit/reddit.html +++ b/src/pages/options/reddit/reddit.html @@ -62,10 +62,10 @@ Pixiv
-
+
diff --git a/src/pages/options/search/search.html b/src/pages/options/search/search.html index 613e4d0f..b0f34af5 100644 --- a/src/pages/options/search/search.html +++ b/src/pages/options/search/search.html @@ -62,10 +62,10 @@ Pixiv
-
+
diff --git a/src/pages/options/sendTargets/sendTargets.html b/src/pages/options/sendTargets/sendTargets.html index 3431c9a2..235205f0 100644 --- a/src/pages/options/sendTargets/sendTargets.html +++ b/src/pages/options/sendTargets/sendTargets.html @@ -52,10 +52,10 @@ Pixiv
-
+
Wikipedia diff --git a/src/pages/options/spotify/spotify.html b/src/pages/options/spotify/spotify.html deleted file mode 100644 index e0553743..00000000 --- a/src/pages/options/spotify/spotify.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - LibRedirect: Spotify - - - - - -
-
-

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 deleted file mode 100644 index 1bd078cb..00000000 --- a/src/pages/options/spotify/spotify.js +++ /dev/null @@ -1,59 +0,0 @@ -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 05b3417e..63935721 100644 --- a/src/pages/options/tiktok/tiktok.html +++ b/src/pages/options/tiktok/tiktok.html @@ -61,10 +61,10 @@ Pixiv
-
+
diff --git a/src/pages/options/translate/translate.html b/src/pages/options/translate/translate.html index 931ba760..7e4f3bd5 100644 --- a/src/pages/options/translate/translate.html +++ b/src/pages/options/translate/translate.html @@ -62,10 +62,10 @@ Pixiv
-
+
diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html index 2e8d0122..a21b26fb 100644 --- a/src/pages/options/twitter/twitter.html +++ b/src/pages/options/twitter/twitter.html @@ -63,10 +63,10 @@ Pixiv
-
+
diff --git a/src/pages/options/wikipedia/wikipedia.html b/src/pages/options/wikipedia/wikipedia.html index 21fa9ced..2cea3cd0 100644 --- a/src/pages/options/wikipedia/wikipedia.html +++ b/src/pages/options/wikipedia/wikipedia.html @@ -52,10 +52,10 @@ Pixiv
-
+
Wikipedia diff --git a/src/pages/options/youtube/youtube.html b/src/pages/options/youtube/youtube.html index d6d9b5e5..af7e8d3d 100644 --- a/src/pages/options/youtube/youtube.html +++ b/src/pages/options/youtube/youtube.html @@ -53,10 +53,10 @@ Pixiv
-
+
Wikipedia diff --git a/src/pages/options/youtubeMusic/youtubeMusic.html b/src/pages/options/youtubeMusic/youtubeMusic.html index 1993d449..5051b9f0 100644 --- a/src/pages/options/youtubeMusic/youtubeMusic.html +++ b/src/pages/options/youtubeMusic/youtubeMusic.html @@ -53,10 +53,10 @@ Pixiv
-
+
Wikipedia -- cgit 1.4.1