Merge pull request #431 from PickleNik/main

Website & Extension improvements
This commit is contained in:
Dmitrii Selivanov authored and GitHub committed 2022-01-13 01:32:58 +03:00
commit 137335d1a1
12 files changed
+151 -124

No files matched your search

+36 -3
View File
@@ -43,14 +43,47 @@ button:hover {
} }
#ext-version { #ext-version {
padding: .25rem .5rem;
}
#ext-update {
cursor: pointer;
color: var(--white);
text-decoration: none;
background: var(--primary);
border-radius: .25rem;
}
#ext-update:hover {
text-decoration: underline;
}
#ext {
padding: .25rem 0;
z-index: 69; z-index: 69;
position: fixed; position: fixed;
background: var(--secondary);
margin: 0; margin: 0;
bottom: 1.15rem; bottom: 1.15rem;
right: 1.15rem; right: 1.15rem;
background: var(--secondary); border-radius: .25rem;
border-radius: 0.25rem; }
padding: 0.25rem 0.5rem;
.switch:before {
content: attr(data-hover);
visibility: hidden;
width: 250px;
background-color: var(--secondary);
border-radius: .5rem;
padding: .5rem;
position: absolute;
z-index: 1;
left: 0;
top: 160%;
}
.switch:hover:before {
visibility: visible;
} }
#advancedToggle { #advancedToggle {
+6 -3
View File
@@ -63,16 +63,19 @@
</button> </button>
<!-- bottom-right --> <!-- bottom-right -->
<p id="ext-version"></p> <div id="ext">
<a href="https://returnyoutubedislike.com/install" target="_blank" id="ext-update"></a>
<span id="ext-version"></span>
</div>
<!-- dialog box --> <!-- dialog box -->
<fieldset id="advancedSettings"> <fieldset id="advancedSettings">
<legend id="advancedLegend">Settings</legend> <legend id="advancedLegend">Settings</legend>
<label class="switch"> <label class="switch" data-hover="Stops counting your likes and dislikes.">
<input type="checkbox" id="disable_vote_submission" /> <input type="checkbox" id="disable_vote_submission" />
<span class="slider" /> <span class="slider" />
<span class="switchLabel">Disable like/dislike submission</span> <span class="switchLabel">Disable vote submission</span>
</label> </label>
<!-- <br /> <!-- <br />
<label class="switch"> <label class="switch">
+13
View File
@@ -65,6 +65,19 @@ function initConfig() {
function initializeVersionNumber() { function initializeVersionNumber() {
const version = chrome.runtime.getManifest().version; const version = chrome.runtime.getManifest().version;
document.getElementById('ext-version').innerHTML = 'v' + version; document.getElementById('ext-version').innerHTML = 'v' + version;
fetch(
"https://raw.githubusercontent.com/Anarios/return-youtube-dislike/main/Extensions/combined/manifest-chrome.json"
)
.then((response) => response.json())
.then((json) => {
if (version !== json.version) {
document.getElementById('ext-update').innerHTML = 'update to v' + json.version;
document.getElementById('ext-update').style.padding = '.25rem .5rem';
}
});
// .catch(console.error);
} }
function initializeDisableVoteSubmission() { function initializeDisableVoteSubmission() {
+29 -30
View File
@@ -73,29 +73,22 @@ export default {
}), }),
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
// check if browser version out of date // Chrome < 70 or FF < 60
if ( if (
window.navigator.userAgent.indexOf("Chrome") > -1 && (this.$ua._parsed.name == "Chrome" &&
window.navigator.userAgent.indexOf("Edge") === -1 parseInt(this.$ua._parsed.version.slice(0, 2)) < 70) ||
(this.$ua._parsed.name == "Firefox" &&
parseInt(this.$ua._parsed.version.slice(0, 2)) < 60)
) { ) {
let chrome = window.navigator.userAgent.match(/Chrome\/(\d+)/); this.alert.html = `<b style="background: #222; border-radius: .5rem; padding: .25rem .25rem .25rem .5rem; margin: 0 .25rem;">
let chromeVersion = chrome ? chrome[1] : 0; ${this.$ua._parsed.name} ${this.$ua._parsed.version.slice(0, 2)}
if (chromeVersion < 70) { </b> is not supported. Consider upgrading to the latest version.`;
this.alert.html = `You are using <b style="background: #222; border-radius: .5rem; padding: .25rem .5rem;">${this.$ua._parsed.name} ${this.$ua._parsed.version}</b>. Please update to the latest version.`; this.alert.show = true;
this.alert.show = true;
}
} }
if (window.navigator.userAgent.indexOf("Firefox") > -1) {
let firefox = window.navigator.userAgent.match(/Firefox\/(\d+)/); // Win7
let firefoxVersion = firefox ? firefox[1] : 0; if (window.navigator.userAgent.indexOf("Windows NT 6.1") > -1) {
if (firefoxVersion < 60) { this.alert.html = `<b style="background: #222; border-radius: .5rem; padding: .25rem .5rem; margin: 0 .25rem;">Windows 7</b> is not supported. Consider upgrading Windows, or installing Linux.`;
this.alert.html = `You are using <b style="background: #222; border-radius: .5rem; padding: .25rem .5rem;">${this.$ua._parsed.name} ${this.$ua._parsed.version}</b>. Please update to the latest version.`;
this.alert.show = true;
}
}
// check for IE browser
if (window.navigator.userAgent.indexOf("MSIE") > -1) {
this.alert.html = `Looks like you're using <b style="background: #222; border-radius: .5rem; padding: .25rem .5rem;">Internet Explorer</b>. Stop it, get some help.`;
this.alert.show = true; this.alert.show = true;
} }
}, 1000); }, 1000);
@@ -107,10 +100,9 @@ export default {
html, html,
body { body {
height: 100%; height: 100%;
background: #111; /* for MacOS/iOS overscroll */
height: -webkit-fill-available;
background: #111; background: #111;
overflow: auto; height: -webkit-fill-available; /* for MacOS/iOS overscroll */
scrollbar-color: #424242 #111;
} }
::selection { ::selection {
@@ -128,14 +120,18 @@ body {
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: #333; /* color of the scroll thumb */ background-color: #333; /* color of the scroll thumb */
border-radius: 20px; /* roundness of the scroll thumb */ border-radius: 1rem 0 0 1rem; /* roundness of the scroll thumb */
border: 4px solid #111; /* creates padding around scroll thumb */ border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
} }
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background-color: #f22; /* color of the scroll thumb */ background-color: #f22; /* color of the scroll thumb */
border-radius: 20px; /* roundness of the scroll thumb */ border-radius: 1rem 0 0 1rem; /* roundness of the scroll thumb */
border: 4px solid #111; /* creates padding around scroll thumb */ border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
} }
.debug { .debug {
@@ -154,14 +150,17 @@ body {
.topBar { .topBar {
padding: 0 3rem; padding: 0 3rem;
width: fit-content !important; width: fit-content !important;
background-color: #222 !important; backdrop-filter: blur(16px) saturate(180%);
-webkit-backdrop-filter: blur(16px) saturate(180%);
background: rgba(42, 42, 42, 0.75) !important;
border-radius: 1rem !important; border-radius: 1rem !important;
border-radius: 0.75rem; /* border: 1px solid #222; */
overflow: hidden; overflow: hidden;
} }
.title-text { .title-text {
font-size: 3rem; font-size: 3rem;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
/* mobile */ /* mobile */
.title-text { .title-text {
@@ -186,7 +185,7 @@ body {
.swoop-right-leave-active { .swoop-right-leave-active {
transition-duration: 0.1s; transition-duration: 0.1s;
transition-property: opacity, transform; transition-property: opacity, transform;
/* overflow: hidden; */ overflow: hidden;
} }
.swoop-left-enter, .swoop-left-enter,
+6 -5
View File
@@ -1,5 +1,5 @@
<template> <template>
<div class="row wrap justify-center full-width" style="max-width: 100%"> <div class="row wrap justify-center full-width mx-auto" style="width: 80vw">
<!-- Left Section // "Sections" Card --> <!-- Left Section // "Sections" Card -->
<v-card <v-card
class="col-xs-12 mx-2 elevation-0" class="col-xs-12 mx-2 elevation-0"
@@ -8,6 +8,7 @@
height: max-content; height: max-content;
position: sticky; position: sticky;
top: 5.5rem; top: 5.5rem;
max-width: 500px;
" "
> >
<!-- <v-card-title style="padding-bottom: 0 !important; color: #aaa"> <!-- <v-card-title style="padding-bottom: 0 !important; color: #aaa">
@@ -24,12 +25,12 @@
color="primary" color="primary"
style="overflow: hidden; border-radius: 0.75rem" style="overflow: hidden; border-radius: 0.75rem"
> >
<v-list-item-title style="text-align: right">
<v-list-item-title v-text="item.text" />
</v-list-item-title>
<v-list-item-icon> <v-list-item-icon>
<v-icon v-text="item.icon" /> <v-icon v-text="item.icon" />
</v-list-item-icon> </v-list-item-icon>
<v-list-item-title style="text-align: left">
<v-list-item-title v-text="item.text" />
</v-list-item-title>
</v-list-item> </v-list-item>
</v-list> </v-list>
</v-card> </v-card>
@@ -41,7 +42,7 @@
height: max-content; height: max-content;
background-color: #222; background-color: #222;
border-radius: 0.75rem; border-radius: 0.75rem;
max-width: 90%; width: 90%;
" "
> >
<NuxtChild /> <NuxtChild />
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div> <div style="line-height: 3rem">
<h1 class="primary--text">Available Endpoints</h1> <h1 class="primary--text">Available Endpoints</h1>
List of available endpoints is available here:<br /> List of available endpoints is available here:<br />
<a :href="endpointUrl" target="_blank" v-text="endpointUrl" /> <a :href="endpointUrl" target="_blank" v-text="endpointUrl" />
+32 -29
View File
@@ -1,51 +1,51 @@
<template> <template>
<div> <div style="line-height: 3rem">
<h1 class="primary--text">Basic Fetching Tutorial</h1> <h1 class="primary--text">Basic Fetching Tutorial</h1>
<span>Example to get votes of a given YouTube video ID:</span> <span>Example to get votes of a given YouTube video ID:</span>
<a href="https://youtube.com/watch?v=kxOuG8jMIgI" target="_blank" <a href="https://youtube.com/watch?v=kxOuG8jMIgI" target="_blank"
>kxOuG8jMIgI</a >kxOuG8jMIgI</a
><br /><br /> >
<h2>Example Request:</h2> <h2>Example Request:</h2>
<span><b>Request URL:</b></span> <span>Request URL:</span>
<a <a
:href="apiUrl + '/votes?videoId=kxOuG8jMIgI'" :href="apiUrl + '/votes?videoId=kxOuG8jMIgI'"
target="_blank" target="_blank"
v-text="apiUrl + '/votes?videoId=kxOuG8jMIgI'" v-text="apiUrl + '/votes?videoId=kxOuG8jMIgI'"
/><br /> />
<span <br />
><b>Request Method:</b> <span>
Request Method:
<a <a
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET"
target="_blank" target="_blank"
>HTTP/GET</a >HTTP/GET</a
></span >
><br /> </span>
<span><b>Headers:</b></span <br />
><br /> <span>Headers:</span>
<code class="code"> <br />
<div class="code pa-4">
Accept: text/html,application/xhtml+xml,application/xml;q=0.9<br /> Accept: text/html,application/xhtml+xml,application/xml;q=0.9<br />
Pragma: no-cache<br /> Pragma: no-cache<br />
Cache-Control: no-cache<br /> Cache-Control: no-cache<br />
Connection: keep-alive </code Connection: keep-alive
><br />
<span><b>Response:</b></span
><br />
<div class="code">
<code style="background-color: rgba(0, 0, 0, 0)">
{<br />
"id": "kxOuG8jMIgI",<br />
"dateCreated": "2021-12-20T12:25:54.418014Z",<br />
"likes": 27326,<br />
"dislikes": 498153,<br />
"rating": 1.212014408444885,<br />
"viewCount": 3149885,<br />
"deleted": false<br />
}
</code>
</div> </div>
<br /><br /> <span>Response:</span><br />
<div class="code pa-4">
{
<br />
&nbsp;"id": "kxOuG8jMIgI",<br />
&nbsp;"dateCreated": "2021-12-20T12:25:54.418014Z",<br />
&nbsp;"likes": 27326,<br />
&nbsp;"dislikes": 498153,<br />
&nbsp;"rating": 1.212014408444885,<br />
&nbsp;"viewCount": 3149885,<br />
&nbsp;"deleted": false<br />
}
</div>
<br />
<v-alert border="left" color="orange" text type="info"> <v-alert border="left" color="orange" text type="info">
<span>An invalid YouTube ID will return status code 404 "Not Found".</span <span>An invalid YouTube ID will return status code 404 "Not Found".</span
><br /> ><br />
@@ -71,7 +71,10 @@ export default {
<style scoped> <style scoped>
.code { .code {
color: #aaa;
background: #353535; background: #353535;
border-radius: 0.25rem; border-radius: 0.5rem;
font-family: monospace;
line-height: 2rem;
} }
</style> </style>
+2 -2
View File
@@ -1,8 +1,8 @@
<template> <template>
<div> <div style="line-height: 3rem">
<h1> <h1>
Welcome to the <span class="primary--text">official RYD docs</span>! Welcome to the <span class="primary--text">official RYD docs</span>!
</h1> </h1>
<p>&lt;- To get started, select a section on the left.</p> To get started, select a section from the menu.
</div> </div>
</template> </template>
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div> <div style="line-height: 3rem">
<h1 class="primary--text">URL Information</h1> <h1 class="primary--text">URL Information</h1>
The API is accessible over the following base URL:<br /> The API is accessible over the following base URL:<br />
<a :href="apiUrl" target="_blank" v-text="apiUrl" /> <a :href="apiUrl" target="_blank" v-text="apiUrl" />
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div> <div style="line-height: 3rem">
<h1 class="primary--text">Usage Rights</h1> <h1 class="primary--text">Usage Rights</h1>
<p> <p>
Third party use of this open API is allowed with the following Third party use of this open API is allowed with the following
+2 -2
View File
@@ -1,11 +1,11 @@
<template> <template>
<div> <div style="width: 90vw" class="mx-auto">
<h1 class="title-text">Frequently Asked Questions</h1> <h1 class="title-text">Frequently Asked Questions</h1>
<p style="color: #999; margin-top: 0.5rem; margin-bottom: 1.5rem"> <p style="color: #999; margin-top: 0.5rem; margin-bottom: 1.5rem">
Still have questions? Feel free to join our Discord! Still have questions? Feel free to join our Discord!
</p> </p>
<v-expansion-panels class="col-xs-12 col-sm-11 col-md-9 col-lg-7"> <v-expansion-panels class="col-xs-12 col-sm-11 col-md-9 col-lg-8">
<v-expansion-panel v-for="(item, i) in items" :key="i"> <v-expansion-panel v-for="(item, i) in items" :key="i">
<v-expansion-panel-header> <v-expansion-panel-header>
{{ item.question }} {{ item.question }}
+22 -47
View File
@@ -1,10 +1,10 @@
<template> <template>
<div> <div
style="width: 80vw"
class="col-xs-12 col-sm-11 col-md-9 col-lg-7 mx-auto"
>
<h1 class="title-text pt-12">Troubleshooting</h1> <h1 class="title-text pt-12">Troubleshooting</h1>
<ol <ol style="line-height: 3rem; color: #aaa" class="text-left">
class="col-xs-12 col-sm-11 col-md-9 col-lg-7 q-mx-auto text-left"
style="line-height: 3rem; color: #aaa"
>
<li> <li>
Make sure you have latest version of extension installed, Make sure you have latest version of extension installed,
<code style="color: #eee"> <code style="color: #eee">
@@ -71,7 +71,8 @@
>mdi-content-copy</v-icon >mdi-content-copy</v-icon
> >
<span style="color: #f44"> Detected: </span> <span style="color: #f44"> Detected: </span>
&nbsp;{{ platform }} &nbsp;
{{ platform }}
</v-btn> </v-btn>
</li> </li>
@@ -113,11 +114,20 @@ export default {
? "swoop-left" ? "swoop-left"
: "swoop-right"; : "swoop-right";
}, },
data: () => ({ data() {
version: "2.0.0.3", return {
platform: "Unknown platform", platform:
discordLink: "https://discord.gg/mYnESY4Md5", this.$ua._parsed.os +
}), " " +
this.$ua._parsed.os_version +
", " +
this.$ua._parsed.name +
" " +
this.$ua._parsed.version,
version: "loading",
discordLink: "https://discord.gg/mYnESY4Md5",
};
},
mounted() { mounted() {
fetch( fetch(
"https://raw.githubusercontent.com/Anarios/return-youtube-dislike/main/Extensions/combined/manifest-chrome.json" "https://raw.githubusercontent.com/Anarios/return-youtube-dislike/main/Extensions/combined/manifest-chrome.json"
@@ -127,45 +137,10 @@ export default {
this.version = json.version; this.version = json.version;
}); });
// .catch(console.error); // .catch(console.error);
// This script sets OSName variable as follows:
// "Windows" for all versions of Windows
// "MacOS" for all versions of Macintosh OS
// "Linux" for all versions of Linux
// "UNIX" for all other UNIX flavors
// "Unknown OS" indicates failure to detect the OS
var OSName = "Unknown OS";
if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows";
if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS";
if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX";
if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux";
// browser parcer
navigator.sayswho = (function () {
var ua = navigator.userAgent;
var tem;
var M =
ua.match(
/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i
) || [];
if (/trident/i.test(M[1])) {
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return "IE " + (tem[1] || "");
}
if (M[1] === "Chrome") {
tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
if (tem != null) return tem.slice(1).join(" ").replace("OPR", "Opera");
}
M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, "-?"];
if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]);
return M.join(" ");
})();
this.platform = OSName + ", " + navigator.sayswho;
}, },
methods: { methods: {
copyToClipboard(text) { copyToClipboard(text) {
navigator.clipboard.writeText(text); navigator.clipboard.writeText("```" + text + "```");
}, },
}, },
}; };