aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/options/general/general.html59
-rw-r--r--src/pages/options/general/general.js25
-rw-r--r--src/pages/options/instagram/instagram.html16
-rw-r--r--src/pages/options/medium/medium.html15
-rw-r--r--src/pages/options/reddit/reddit.html17
-rw-r--r--src/pages/options/search/search.html17
-rw-r--r--src/pages/options/twitter/twitter.html16
-rw-r--r--src/pages/options/wikipedia/wikipedia.html14
-rw-r--r--src/pages/options/youtube/youtube.html21
-rw-r--r--src/pages/options/youtube/youtube.js75
-rw-r--r--src/pages/stylesheets/styles.css177
11 files changed, 36 insertions, 416 deletions
diff --git a/src/pages/options/general/general.html b/src/pages/options/general/general.html
index 3a7e8cf2..92cd48c5 100644
--- a/src/pages/options/general/general.html
+++ b/src/pages/options/general/general.html
@@ -38,65 +38,6 @@
<span>Update Instances</span>
</a>
</div>
- <!-- <hr> -->
- <!-- <section class="settings-block">
- <p data-localise="__MSG_exceptionsDescriptionP1__">
- Enter a URL or Regular Expression to be excluded from redirects.
- </p>
- <p data-localise="__MSG_exceptionsDescriptionP2__">
- All requests for or initiating from a URL that matches your exception
- will be excluded from redirects.
- </p>
- <p data-localise="__MSG_exceptionsDescriptionP3__">
- Note - Supports JavaScript regular expressions, excluding the
- enclosing forward slashes.
- </p>
- </section>
- <section class="settings-block">
- <table class="exceptions option">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_addException__">Add Exception</h1>
- </td>
- </tr>
- <tr>
- <td>
- <input id="new-exceptions-item" type="text" placeholder="URL or RegExp" />
- </td>
- <td>
- <input type="radio" id="url" name="type" value="URL" checked />
- <label class="radio" for="url">URL</label>
- <input type="radio" id="regExp" name="type" value="RegExp" />
- <label class="radio" for="regExp">RegExp</label>
- </td>
- <td>
- <button id="add-to-exceptions">
- <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
- <line x1="256" y1="112" x2="256" y2="400" style="
- fill: none;
- stroke: #fff;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 32px;
- " />
- <line x1="400" y1="256" x2="112" y2="256" style="
- fill: none;
- stroke: #fff;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 32px;
- " />
- </svg>
- </button>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <ul id="exceptions-items"></ul>
- </section> -->
-
<script type="module" src="../init.js"></script>
<script type="module" src="./general.js"></script>
diff --git a/src/pages/options/general/general.js b/src/pages/options/general/general.js
index 23c739aa..17b7a843 100644
--- a/src/pages/options/general/general.js
+++ b/src/pages/options/general/general.js
@@ -47,31 +47,6 @@ browser.storage.sync.get(
}
);
-// function addToExceptions() {
-// const input = document.getElementById("new-exceptions-item");
-// const type = document.querySelector('input[name="type"]:checked').value;
-// if (input.value) {
-// try {
-// let value = input.value;
-// new RegExp(input.value);
-// if (type === "URL")
-// value = value.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
-
-// exceptions.push(value);
-// browser.storage.sync.set({
-// exceptions: exceptions,
-// });
-// prependExceptionsItem(value, exceptions.indexOf(value));
-// input.value = "";
-// } catch (error) {
-// input.setCustomValidity("Invalid RegExp");
-// }
-// } else {
-// input.setCustomValidity("Invalid RegExp");
-// }
-// }
-// document.getElementById("add-to-exceptions").addEventListener("click", addToExceptions);
-
themeElement.addEventListener("change", (event) => {
const value = event.target.options[theme.selectedIndex].value;
switch (value) {
diff --git a/src/pages/options/instagram/instagram.html b/src/pages/options/instagram/instagram.html
index 1f09cab7..98e296f8 100644
--- a/src/pages/options/instagram/instagram.html
+++ b/src/pages/options/instagram/instagram.html
@@ -28,22 +28,6 @@
<h4>Enable</h4>
<input id="disable-bibliogram" type="checkbox" checked />
</div>
- <!-- <div class="some-block option-block">
- <h4>Instance</h4>
- <div class="autocomplete">
- <input id="bibliogram-instance" type="url" data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)" />
- </div>
- </div> -->
-
- <!-- <section class="settings-block">
- <h4>Instance List</h4>
- <div class="random-pool">
- <textarea id="bibliogram-random-pool" name="bibliogram-random-pool" type="text"></textarea>
- <ul id="bibliogram-random-pool-list"></ul>
- </div>
- </section> -->
-
</section>
<script type="module" src="../init.js"></script>
diff --git a/src/pages/options/medium/medium.html b/src/pages/options/medium/medium.html
index abf149c0..1c978d82 100644
--- a/src/pages/options/medium/medium.html
+++ b/src/pages/options/medium/medium.html
@@ -28,21 +28,6 @@
<h4>Enable</h4>
<input id="disable-scribe" type="checkbox" checked />
</div>
- <!-- <div class="some-block option-block">
- <h4>Instance</h4>
- <div class="autocomplete">
- <input id="scribe-instance" type="url" name="scribe-instance"
- data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)" />
- </div>
- </div>
- <section class="settings-block">
- <h4>Instance List</h4>
- <div class="random-pool">
- <textarea id="scribe-random-pool" type="text"></textarea>
- <ul id="scribe-random-pool-list"></ul>
- </div>
- </section> -->
</section>
<script type="module" src="../init.js"></script>
diff --git a/src/pages/options/reddit/reddit.html b/src/pages/options/reddit/reddit.html
index 9dd59d73..c968b954 100644
--- a/src/pages/options/reddit/reddit.html
+++ b/src/pages/options/reddit/reddit.html
@@ -45,23 +45,6 @@
<option value="teddit">Teddit</option>
</select>
</div>
-
- <!-- <section class="settings-block">
- <h4>LibReddit Instance List</h4>
- <div class="random-pool">
- <textarea id="libreddit-random-pool" type="text"></textarea>
- <ul id="libreddit-random-pool-list"></ul>
- </div>
- </section>
-
- <section class="settings-block">
- <h4>Teddit Instance List</h4>
- <div class="random-pool">
- <textarea id="teddit-random-pool" type="text"></textarea>
- <ul id="teddit-random-pool-list"></ul>
- </div>
- </section> -->
-
</section>
<script type="module" src="../init.js"></script>
diff --git a/src/pages/options/search/search.html b/src/pages/options/search/search.html
index af7d3946..489ed38a 100644
--- a/src/pages/options/search/search.html
+++ b/src/pages/options/search/search.html
@@ -44,23 +44,6 @@
<option value="whoogle">Whoogle</option>
</select>
</div>
-<!--
- <section class="settings-block">
- <h4>SearX Instance List</h4>
- <div class="random-pool">
- <textarea id="searx-random-pool" type="text"></textarea>
- <ul id="searx-random-pool-list"></ul>
- </div>
- </section>
-
- <section class="settings-block">
- <h4>Whoogle Instance List</h4>
- <div class="random-pool">
- <textarea id="whoogle-random-pool" type="text"></textarea>
- <ul id="whoogle-random-pool-list"></ul>
- </div>
- </section> -->
-
</section>
diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html
index b13d02dd..8e189856 100644
--- a/src/pages/options/twitter/twitter.html
+++ b/src/pages/options/twitter/twitter.html
@@ -30,22 +30,6 @@
<h4>Enable</h4>
<input id="disable-nitter" type="checkbox" checked />
</div>
- <!-- <div class="some-block option-block">
- <h4>Instance</h4>
- <div class="autocomplete">
- <input id="nitter-instance" type="url" name="nitter-instance"
- data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)" />
- </div>
- </div> -->
-
- <!-- <section class="settings-block">
- <h4>Instance List</h4>
- <div class="random-pool">
- <textarea id="nitter-random-pool" type="text"></textarea>
- <ul id="nitter-random-pool-list"></ul>
- </div>
- </section> -->
<div class="some-block option-block">
<h4 data-localise="__MSG_removeTwitterSW__">Proactively remove Twitter service worker</h4>
<input id="remove-twitter-sw" type="checkbox" checked />
diff --git a/src/pages/options/wikipedia/wikipedia.html b/src/pages/options/wikipedia/wikipedia.html
index a68f36a6..ed811e94 100644
--- a/src/pages/options/wikipedia/wikipedia.html
+++ b/src/pages/options/wikipedia/wikipedia.html
@@ -28,20 +28,6 @@
<h4>Enable</h4>
<input id="disable-wikipedia" type="checkbox" checked />
</div>
- <!-- <div class="some-block option-block">
- <h4>Instance</h4>
- <div class="autocomplete">
- <input id="wikipedia-instance" type="url" placeholder="https://wikiless.org" />
- </div>
- </div>
-
- <section class="settings-block">
- <h4>Instance List</h4>
- <div class="random-pool">
- <textarea id="wikiless-random-pool" type="text"></textarea>
- <ul id="wikiless-random-pool-list"></ul>
- </div>
- </section> -->
</section>
<script type="module" src="../init.js"></script>
diff --git a/src/pages/options/youtube/youtube.html b/src/pages/options/youtube/youtube.html
index a9bb6c63..0778b794 100644
--- a/src/pages/options/youtube/youtube.html
+++ b/src/pages/options/youtube/youtube.html
@@ -30,23 +30,6 @@
<input id="disable-invidious" type="checkbox" checked />
</div>
- <!-- <div class="some-block option-block">
- <h4>Instance</h4>
- <div class="autocomplete">
- <input id="invidious-instance" type="url" data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)" />
- </div>
- </div> -->
-
- <!-- <section class="settings-block">
- <h4>Instance List</h4>
- <div class="random-pool">
- <textarea type="textarea" id="invidious-random-pool" name="invidious-random-pool"
- type="text"></textarea>
- <ul id="invidious-random-pool-list"></ul>
- </div>
- </section> -->
-
<div class="some-block option-block">
<h4>Frontend</h4>
<select id="youtube-frontend">
@@ -59,7 +42,6 @@
<hr>
<div id="invidious-piped">
-
<div class="some-block option-block">
<h4>Only Redirect Embedded-Video</h4>
<input id="only-embed" type="checkbox" checked />
@@ -108,7 +90,7 @@
</div>
<div class="some-block option-block">
- <h4 data-localise="__MSG_invidiousAlwaysProxy__">Always proxy videos</h4>
+ <h4>Always proxy videos</h4>
<select id="invidious-always-proxy">
<option value="DEFAULT">Default</option>
<option value="true">True</option>
@@ -151,7 +133,6 @@
<h4>Custom Instances</h4>
</div>
-
<form id="custom-instance-form">
<div class="some-block option-block">
<input id="invidious-custom-instance" placeholder="https://invidious.com" type="url" />
diff --git a/src/pages/options/youtube/youtube.js b/src/pages/options/youtube/youtube.js
index 595006fd..dcd8c22d 100644
--- a/src/pages/options/youtube/youtube.js
+++ b/src/pages/options/youtube/youtube.js
@@ -69,10 +69,8 @@ invidiousPlayerStyleElement.addEventListener("change",
);
let invidiousSubtitlesElement = document.getElementById("invidious-subtitles");
-invidiousSubtitlesElement.addEventListener("input",
- commonHelper.debounce(() => {
- youtubeHelper.setInvidiousSubtitles(invidiousSubtitlesElement.value)
- }, 500)
+invidiousSubtitlesElement.addEventListener("change",
+ () => youtubeHelper.setInvidiousSubtitles(invidiousSubtitlesElement.value)
);
let invidiousAutoplayElement = document.getElementById("invidious-autoplay");
@@ -124,62 +122,51 @@ youtubeHelper.init().then(() => {
let myMightyList = youtubeHelper.getInvidiousRedirectsChecks();
- function checkToggleAll() {
- console.log("CheckToggleAll")
- let isTrue = true;
- for (const item of youtubeHelper.getRedirects().invidious.normal)
- if (!myMightyList.includes(item)) {
- isTrue = false;
- break;
- }
- document.getElementById('invidious-toogle-all').checked = isTrue;
- }
-
-
let checklistList = invidiousCheckListElement.getElementsByTagName('input')
for (let element of checklistList) {
-
element.checked = myMightyList.includes(element.id);
-
if (element.id == 'invidious-toogle-all')
- document.getElementById('invidious-toogle-all').addEventListener("change",
- (event) => {
- if (event.target.checked) {
- for (let item of checklistList) {
- myMightyList.push(item.id)
- item.checked = true;
- }
- }
- else {
- myMightyList = [];
- for (let item of checklistList) item.checked = false;
+ document.getElementById('invidious-toogle-all').addEventListener("change", (event) => {
+ if (event.target.checked)
+ for (let item of checklistList) {
+ myMightyList.push(item.id);
+ item.checked = true;
}
- youtubeHelper.setInvidiousRedirectsChecks(myMightyList);
+ else {
+ myMightyList = [];
+ for (let item of checklistList) item.checked = false;
}
- );
+ youtubeHelper.setInvidiousRedirectsChecks(myMightyList);
+ });
else
- document.getElementById(element.id).addEventListener("change",
- (event) => {
- if (event.target.checked)
- myMightyList.push(element.id)
- else {
- let index = myMightyList.indexOf(element.id);
- if (index > -1) myMightyList.splice(index, 1);
- }
-
- youtubeHelper.setInvidiousRedirectsChecks(myMightyList);
- checkToggleAll();
+ document.getElementById(element.id).addEventListener("change", (event) => {
+ if (event.target.checked)
+ myMightyList.push(element.id)
+ else {
+ let index = myMightyList.indexOf(element.id);
+ if (index > -1) myMightyList.splice(index, 1);
}
- );
+ youtubeHelper.setInvidiousRedirectsChecks(myMightyList);
+ checkToggleAll();
+ });
}
checkToggleAll();
-
mightyInvidiousCustomInstances = youtubeHelper.getInvidiousCustomRedirects();
calcCustom();
});
+function checkToggleAll() {
+ let isTrue = true;
+ for (const item of youtubeHelper.getRedirects().invidious.normal)
+ if (!myMightyList.includes(item)) {
+ isTrue = false;
+ break;
+ }
+ document.getElementById('invidious-toogle-all').checked = isTrue;
+}
+
let invidiousCustomInstanceElement = document.getElementById("invidious-custom-instance")
let mightyInvidiousCustomInstances = []
diff --git a/src/pages/stylesheets/styles.css b/src/pages/stylesheets/styles.css
index 9046ce26..1d2e9428 100644
--- a/src/pages/stylesheets/styles.css
+++ b/src/pages/stylesheets/styles.css
@@ -19,7 +19,6 @@ body.light-theme {
body {
margin: auto;
padding: 0;
- min-height: 572px;
font-family: Sans-Serif;
background-color: var(--bg-main);
color: var(--text);
@@ -31,23 +30,11 @@ div.some-block input[type="checkbox"] {
-webkit-appearance: none;
}
-h2 {
- clear: both;
- font-size: 12px;
- font-weight: normal;
- margin: 0;
-}
-
-h1,
-h2 {
- color: var(--text);
-}
-
input[type="url"],
input[type="text"],
select {
padding: 5px 10px;
- width: 400px;
+ width: 350px;
border-radius: 3px;
box-sizing: border-box;
margin-bottom: var(--space);
@@ -63,37 +50,11 @@ select {
padding: 8px;
background-color: var(--bg-secondary);
border: none;
- ;
margin: 0;
width: auto;
border-radius: 3px;
}
-input[type="radio"] {
- appearance: radio;
- -moz-appearance: radio;
- -webkit-appearance: radio;
-}
-
-input[type="radio"]:checked+label {
- background: transparent;
-}
-
-input:checked+label {
- background: var(--active);
-}
-
-input:checked+label:after {
- left: calc(100% - var(--space));
- transform: translateX(-100%);
-}
-
-.settings-block {
- display: block;
- margin: 30px 0;
- padding: 5px 15px;
-}
-
a.button * {
vertical-align: middle;
}
@@ -113,62 +74,6 @@ a.button:active {
input:invalid {
color: var(--danger);
border-color: var(--danger);
- background-color: var(--danger-light);
-}
-
-.margin-bottom {
- margin-bottom: 20px;
-}
-
-div.exceptions {
- clear: left;
-}
-
-div.exceptions>input {
- width: 240px;
- float: left;
-}
-
-#add-to-exceptions {
- float: right;
- border: var(--active) solid 1px;
- background-color: var(--active);
- color: var(--text);
- font-weight: bold;
- cursor: pointer;
- border-radius: 50%;
- padding: 1px 1px 0px 1px;
- margin-right: 5px;
-}
-
-#add-to-exceptions svg {
- height: 20px;
- width: 20px;
-}
-
-ul {
- padding: 0;
- list-style-type: none;
- color: var(--text);
- margin: 20px 20px 0 20px;
-}
-
-li {
- white-space: nowrap;
- border-bottom: solid 0.5px var(--bg-secondary);
- padding: 20px 0px 20px 20px;
-}
-
-#exceptions-items button {
- float: right;
- margin-right: -5px;
- border: var(--active) solid 1px;
- background-color: var(--active);
- color: var(--text);
- font-weight: bold;
- cursor: pointer;
- border-radius: 50%;
- padding: 2px 2px 0px 2px;
}
.button svg {
@@ -176,48 +81,6 @@ li {
width: 18px;
}
-.autocomplete {
- position: relative;
- display: inline-block;
- width: 100%;
-}
-
-.autocomplete input {
- background: url(../../assets/images/chevron-down.svg) right no-repeat;
-}
-
-.autocomplete-items {
- position: absolute;
- border: 1px solid var(--bg-main);
- border-bottom: none;
- border-top: none;
- z-index: 99;
- top: 85%;
- left: 0;
- right: 0;
- overflow-y: auto;
- max-height: 175px;
- color: var(--text);
- overflow-x: hidden;
- max-width: 380px;
-}
-
-.autocomplete-items div {
- padding: 10px;
- cursor: pointer;
- background-color: var(--bg-secondary);
- border-bottom: 1px solid var(--bg-main);
-}
-
-.autocomplete-items div:hover {
- background-color: var(--active);
-}
-
-.autocomplete-active {
- background-color: var(--active);
- color: var(--text);
-}
-
section.option-block {
width: 50%;
margin: 0 50px;
@@ -229,10 +92,6 @@ body.option {
padding: 40px;
}
-section.links {
- margin: 00px 0;
-}
-
section.links a {
display: flex;
align-items: center;
@@ -244,20 +103,13 @@ section.links a {
transition: 0.1s;
}
-section.links a:hover {
- color: var(--active);
-}
-
+section.links a:hover,
section.links a.selected {
color: var(--active);
}
-.option td {
- vertical-align: middle;
-}
-
input[type="range"] {
- width: 50%;
+ width: 350px;
}
::placeholder {
@@ -265,11 +117,6 @@ input[type="range"] {
opacity: 0.7;
}
-input[type="text"]:focus,
-input[type="url"]:focus {
- outline: none;
-}
-
#volume-value {
color: var(--active);
}
@@ -328,7 +175,6 @@ h4 {
div.some-block h4 {
margin: 0;
- /* width: 70%; */
}
div.option-block h4 {
@@ -356,10 +202,6 @@ div.some-block input[type="checkbox"]:checked {
background-color: var(--active);
}
-div.some-block input[type="checkbox"]:focus {
- outline: none;
-}
-
div.some-block input[type="checkbox"]::before {
content: "";
display: inline-block;
@@ -372,7 +214,7 @@ div.some-block input[type="checkbox"]::before {
height: 20px;
background-color: white;
border-radius: 50%;
- transition: .4s;
+ transition: .3s;
}
div.some-block input[type="checkbox"]:checked::before {
@@ -422,15 +264,6 @@ a.button:active {
transform: translateY(1px);
}
-textarea {
- line-height: 21px;
- background-color: var(--bg-secondary);
- color: white;
- border: none;
- resize: none;
- width: 100%;
-}
-
button.default {
margin-left: 30px;
background-color: transparent;
@@ -455,11 +288,9 @@ div.checklist div {
justify-content: space-between;
margin: 5px 15px;
padding: 10px 0;
- /* border-bottom: 2px solid rgb(77, 77, 77); */
display: flex;
}
-
button.add {
background-color: transparent;
border: none;