From 2262a1c15e987c420e96b56898debc590cdc4a23 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 19 Mar 2022 13:33:51 +0300 Subject: Readded Soju #109. Readded strict_min_version #119. Improved install_chromium README --- 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/piped.js | 2 - src/pages/options/youtube/youtube.html | 4 +- src/pages/options/youtubeMusic/youtubeMusic.html | 4 +- 22 files changed, 293 insertions(+), 295 deletions(-) delete mode 100644 src/pages/options/.spotify/.spotify.html delete mode 100644 src/pages/options/.spotify/.spotify.js 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/.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/general/general.html b/src/pages/options/general/general.html index b602036a..98e9fca6 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 b74cfb4f..37b7bda1 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 0f4c352a..51b6c58d 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 a7e826b3..16ea3875 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 bbb0009e..6f10c270 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 dd354c03..ee922d17 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 99738685..23009d1d 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 56724a93..8f6630da 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 c3c49b3e..57f29b15 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 b0f34af5..613e4d0f 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 235205f0..3431c9a2 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 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/tiktok/tiktok.html b/src/pages/options/tiktok/tiktok.html index 63935721..05b3417e 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 7e4f3bd5..931ba760 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 a21b26fb..2e8d0122 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 2cea3cd0..21fa9ced 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/piped.js b/src/pages/options/youtube/piped.js index 876106e2..5f388d6f 100644 --- a/src/pages/options/youtube/piped.js +++ b/src/pages/options/youtube/piped.js @@ -198,9 +198,7 @@ youtubeHelper.init().then(() => { pipedSponsorblockElement.checked = youtubeHelper.getPipedSponsorblock(); selectSkip = youtubeHelper.getPipedSelectedSkip(); - console.log("selectSkip", selectSkip) pipedSelectedSkipSponsorElement.checked = selectSkip.includes('sponsor'); - console.log("selectSkip.includes('sponsor')", selectSkip.includes('sponsor')) pipedSelectedSkipIntroElement.checked = selectSkip.includes('intro'); pipedSelectedSkipOutroElement.checked = selectSkip.includes('outro'); pipedSelectedSkipPreviewElement.checked = selectSkip.includes('preview'); diff --git a/src/pages/options/youtube/youtube.html b/src/pages/options/youtube/youtube.html index d36e8ba1..e2d627c7 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 5051b9f0..1993d449 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