Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Anarios/return-youtube-dislike.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Extensions/combined/popup.js')
-rw-r--r--Extensions/combined/popup.js39
1 files changed, 31 insertions, 8 deletions
diff --git a/Extensions/combined/popup.js b/Extensions/combined/popup.js
index c0e7b78..291f555 100644
--- a/Extensions/combined/popup.js
+++ b/Extensions/combined/popup.js
@@ -19,8 +19,8 @@ const config = {
website: "https://returnyoutubedislike.com",
github: "https://github.com/Anarios/return-youtube-dislike",
discord: "https://discord.gg/mYnESY4Md5",
- donate: 'https://returnyoutubedislike.com/donate',
- faq: 'https://returnyoutubedislike.com/faq'
+ donate: "https://returnyoutubedislike.com/donate",
+ faq: "https://returnyoutubedislike.com/faq",
},
};
@@ -45,10 +45,11 @@ document.getElementById("link_donate").addEventListener("click", () => {
chrome.tabs.create({ url: config.links.donate });
});
-
-document.getElementById("disable_vote_submission").addEventListener("click", (ev) => {
- chrome.storage.sync.set({ disableVoteSubmission: ev.target.checked });
-});
+document
+ .getElementById("disable_vote_submission")
+ .addEventListener("click", (ev) => {
+ chrome.storage.sync.set({ disableVoteSubmission: ev.target.checked });
+ });
/* Advanced Toggle */
const advancedToggle = document.getElementById("advancedToggle");
@@ -72,7 +73,7 @@ function initConfig() {
}
function initializeDisableVoteSubmission() {
- chrome.storage.sync.get(['disableVoteSubmission'], (res) => {
+ chrome.storage.sync.get(["disableVoteSubmission"], (res) => {
handleDisableVoteSubmissionChangeEvent(res.disableVoteSubmission);
});
}
@@ -81,7 +82,9 @@ chrome.storage.onChanged.addListener(storageChangeHandler);
function storageChangeHandler(changes, area) {
if (changes.disableVoteSubmission !== undefined) {
- handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue);
+ handleDisableVoteSubmissionChangeEvent(
+ changes.disableVoteSubmission.newValue
+ );
}
}
@@ -90,6 +93,26 @@ function handleDisableVoteSubmissionChangeEvent(value) {
document.getElementById("disable_vote_submission").checked = value;
}
+(async function getStatus() {
+ let status = document.getElementById("status");
+ let serverStatus = document.getElementById("server-status");
+ let resp = await fetch(
+ "https://returnyoutubedislikeapi.com/votes?videoId=YbJOTdZBX1g"
+ );
+ let result = await resp.status;
+ if (result === 200) {
+ status.innerText = "Online";
+ status.style.color = "green";
+ serverStatus.style.filter =
+ "invert(58%) sepia(81%) saturate(2618%) hue-rotate(81deg) brightness(119%) contrast(129%)";
+ } else {
+ status.innerText = "Offline";
+ status.style.color = "red";
+ serverStatus.style.filter =
+ "invert(11%) sepia(100%) saturate(6449%) hue-rotate(3deg) brightness(116%) contrast(115%)";
+ }
+})();
+
/* popup-script.js
document.querySelector('#login')
.addEventListener('click', function () {