aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/options/twitter
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/options/twitter')
-rw-r--r--src/pages/options/twitter/twitter.html24
-rw-r--r--src/pages/options/twitter/twitter.js11
2 files changed, 33 insertions, 2 deletions
diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html
index 8e189856..bd0b37e0 100644
--- a/src/pages/options/twitter/twitter.html
+++ b/src/pages/options/twitter/twitter.html
@@ -30,10 +30,30 @@
<h4>Enable</h4>
<input id="disable-nitter" type="checkbox" checked />
</div>
+
+ <hr>
+
+ <div class="some-block option-block">
+ <h4>Default Instances</h4>
+ </div>
+ <div class="checklist" id="nitter-checklist"></div>
+ <hr>
<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 />
+ <h4>Custom Instances</h4>
</div>
+ <form id="custom-nitter-instance-form">
+ <div class="some-block option-block">
+ <input id="nitter-custom-instance" placeholder="https://nitter.com" type="url" />
+ <button type="submit" class="add" id="nitter-add-instance">
+ <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
+ fill="currentColor">
+ <path d="M0 0h24v24H0V0z" fill="none" />
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
+ </svg>
+ </button>
+ </div>
+ </form>
+ <div class="checklist" id="nitter-custom-checklist"></div>
</section>
diff --git a/src/pages/options/twitter/twitter.js b/src/pages/options/twitter/twitter.js
index 4316b456..e9c64643 100644
--- a/src/pages/options/twitter/twitter.js
+++ b/src/pages/options/twitter/twitter.js
@@ -1,4 +1,5 @@
import twitterHelper from "../../../assets/javascripts/helpers/twitter.js";
+import commonHelper from "../../../assets/javascripts/helpers/common.js";
let disableTwitterElement = document.getElementById("disable-nitter");
disableTwitterElement.addEventListener("change",
@@ -7,4 +8,14 @@ disableTwitterElement.addEventListener("change",
twitterHelper.init().then(() => {
disableTwitterElement.checked = !twitterHelper.getDisableTwitter();
+
+ commonHelper.processDefaultCustomInstances(
+ 'nitter',
+ twitterHelper,
+ document,
+ twitterHelper.getNitterRedirectsChecks,
+ twitterHelper.setNitterRedirectsChecks,
+ twitterHelper.getNitterCustomRedirects,
+ twitterHelper.setNitterCustomRedirects
+ )
}); \ No newline at end of file