mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-26 08:13:00 +01:00
Merge branch 'main' of https://github.com/thereaper90917/return-youtube-dislike into main
This commit is contained in:
9 files changed
+84
-19
No files matched your search
@@ -311,22 +311,22 @@ function roundDown(num) {
|
||||
}
|
||||
|
||||
function numberFormat(numberState) {
|
||||
let localeURL = Array.from(document.querySelectorAll("head > link[rel='search']"))
|
||||
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||
?.getAttribute("href");
|
||||
|
||||
const userLocales = localeURL ? new URL(localeURL)?.searchParams?.get("locale") : document.body.lang;
|
||||
|
||||
let userLocales;
|
||||
try {
|
||||
userLocales = new URL(
|
||||
Array.from(document.querySelectorAll("head > link[rel='search']"))
|
||||
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||
?.getAttribute("href")
|
||||
)?.searchParams?.get("locale");
|
||||
} catch {}
|
||||
const formatter = Intl.NumberFormat(
|
||||
document.documentElement.lang || userLocales || navigator.language,
|
||||
{
|
||||
notation: "compact",
|
||||
minimumFractionDigits: 1,
|
||||
maximumFractionDigits: 1,
|
||||
}
|
||||
);
|
||||
|
||||
return formatter.format(roundDown(numberState)).replace(/\.0|,0/, "");
|
||||
return formatter.format(roundDown(numberState));
|
||||
}
|
||||
|
||||
function setEventListeners(evt) {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<img id="server-status" src="./icons/server.svg" alt="" />
|
||||
<p>API Status: <span id="status"></span></p>
|
||||
<p>by Dmitrii Selivanov & Community</p>
|
||||
<p id="ext-version"></p>
|
||||
|
||||
<button id="link_website">Website</button>
|
||||
<button id="link_github">GitHub</button>
|
||||
|
||||
@@ -4,7 +4,17 @@ const config = {
|
||||
showAdvancedMessage: "Show Settings",
|
||||
hideAdvancedMessage: "Hide Settings",
|
||||
disableVoteSubmission: false,
|
||||
}
|
||||
|
||||
function initConfig() {
|
||||
initializeVersionNumber();
|
||||
}
|
||||
|
||||
function initializeVersionNumber() {
|
||||
const version = chrome.runtime.getManifest().version;
|
||||
document.getElementById('ext-version').innerHTML = 'v' + version;
|
||||
}
|
||||
|
||||
links: {
|
||||
website: "https://returnyoutubedislike.com",
|
||||
github: "https://github.com/Anarios/return-youtube-dislike",
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Extension Source
|
||||
## Guide to Compiling
|
||||
|
||||
## Compiling to Development (Testing)
|
||||
<ol>
|
||||
<li>Go to the root directory of the project</li>
|
||||
<li>Run <code>npm i</code> to install all project dependancies (if not done so already)</li>
|
||||
<li>run <code>npm run dev</code> to compile the extension to the <code>~/Extensions/combined/dist/</code> folder.</li>
|
||||
</ol>
|
||||
|
||||
## Compiling to Production (Final Release)
|
||||
<ol>
|
||||
<li>Go to the root directory of the project</li>
|
||||
<li>Run <code>npm i</code> to install all project dependancies (if not done so already)</li>
|
||||
<li>run <code>npm run build</code> to compile the extension to the <code>~/Extensions/combined/dist/</code> folder.</li>
|
||||
</ol>
|
||||
@@ -1,9 +1,12 @@
|
||||
//--- Import Button Functions ---//
|
||||
import {
|
||||
getButtons,
|
||||
getLikeButton,
|
||||
getDislikeButton,
|
||||
checkForSignInButton,
|
||||
} from "./src/buttons";
|
||||
|
||||
//--- Import State Functions ---//
|
||||
import {
|
||||
isMobile,
|
||||
isVideoDisliked,
|
||||
@@ -19,10 +22,13 @@ import {
|
||||
NEUTRAL_STATE,
|
||||
initExtConfig,
|
||||
} from "./src/state";
|
||||
|
||||
//--- Import Video & Browser Functions ---//
|
||||
import { numberFormat, getBrowser, getVideoId, isVideoLoaded, cLog } from "./src/utils";
|
||||
import { createRateBar } from "./src/bar";
|
||||
import { sendVideoIds, sendVote, likeClicked, dislikeClicked, addLikeDislikeEventListener, storageChangeHandler } from "./src/events"
|
||||
|
||||
|
||||
initExtConfig()
|
||||
|
||||
let jsInitChecktimer = null;
|
||||
|
||||
Reference in new issue
Block a user