mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 10:52:20 +01:00
Merge branch 'main' of https://github.com/Anarios/return-youtube-dislike
This commit is contained in:
commit
c67eb918f7
8 files changed
+184
-128
No files matched your search
@@ -0,0 +1,49 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: File a bug report!
|
||||||
|
title: "(Bug): "
|
||||||
|
labels: ["bug"]
|
||||||
|
body:
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Browser
|
||||||
|
description: Which browser are you using?
|
||||||
|
placeholder: "Example: Google Chrome"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Browser Version
|
||||||
|
description: Which browser version are you using?
|
||||||
|
placeholder: "Example: Chromium v95"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: "Extension or Userscript?"
|
||||||
|
options:
|
||||||
|
- Extension
|
||||||
|
- Userscript
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Extension/Userscript Version
|
||||||
|
description: Which extension/userscript version are you using?
|
||||||
|
placeholder: "Example: Version 0.0.0.1"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Video link where you see the problem
|
||||||
|
description: Video link where you see the problem
|
||||||
|
placeholder: "Example: https://www.youtube.com/watch?v=s4-gMgdsnHQ"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: What happened?
|
||||||
|
description: Also tell us, what did you expect to happen?
|
||||||
|
placeholder: Tell us what you see!
|
||||||
|
value: "A bug happened!"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
name: Feature Request
|
||||||
|
description: Request or suggest a new feature!
|
||||||
|
title: "(Feature Request): "
|
||||||
|
labels: ["enhancement"]
|
||||||
|
body:
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Extension or Userscript?
|
||||||
|
options:
|
||||||
|
- Extension
|
||||||
|
- Userscript
|
||||||
|
- Both
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Request or suggest a new feature!
|
||||||
|
placeholder: I want to suggest...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Ways to implement this!
|
||||||
|
placeholder: We can implement it by...
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Can you work on this?
|
||||||
|
options:
|
||||||
|
- label: "Yes"
|
||||||
|
- label: "No"
|
||||||
|
|
||||||
@@ -1,46 +1,26 @@
|
|||||||
#return-youtube-dislike-bar-container {
|
#return-youtube-dislike-bar-container {
|
||||||
background: #c6c6c6;
|
background: var(--yt-spec-icon-disabled);
|
||||||
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#return-youtube-dislike-bar {
|
#return-youtube-dislike-bar {
|
||||||
background: #5094c8;
|
background: var(--yt-spec-text-primary);
|
||||||
}
|
border-radius: 2px;
|
||||||
|
transition: all 0.15s ease-in-out;
|
||||||
[dark] #return-youtube-dislike-bar-container {
|
|
||||||
}
|
|
||||||
|
|
||||||
[dark] #return-youtube-dislike-bar {
|
|
||||||
background: #3ea6ff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ryd-tooltip {
|
.ryd-tooltip {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: block;
|
||||||
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
|
height: 2px;
|
||||||
cursor: pointer;
|
top: 9px;
|
||||||
height: 10px;
|
|
||||||
margin-bottom: -5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tooltip text */
|
.ryd-tooltip-bar-container {
|
||||||
.ryd-tooltip .ryd-tooltiptext {
|
width: 100%;
|
||||||
visibility: hidden;
|
height: 2px;
|
||||||
width: 120px;
|
|
||||||
background-color: #000000c4;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px 0;
|
|
||||||
border-radius: 6px;
|
|
||||||
|
|
||||||
/* Position the tooltip text - see examples below! */
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
padding-top: 6px;
|
||||||
bottom: 15px;
|
padding-bottom: 28px;
|
||||||
left: 10px;
|
top: -6px;
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Show the tooltip text when you mouse over the tooltip container */
|
|
||||||
.ryd-tooltip:hover .ryd-tooltiptext {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
}
|
||||||
+29
-23
@@ -163,41 +163,47 @@
|
|||||||
var rateBar = document.getElementById(
|
var rateBar = document.getElementById(
|
||||||
'return-youtube-dislike-bar-container'
|
'return-youtube-dislike-bar-container'
|
||||||
);
|
);
|
||||||
|
|
||||||
const widthPx =
|
const widthPx =
|
||||||
getButtons().children[0].clientWidth +
|
getButtons().children[0].clientWidth +
|
||||||
getButtons().children[1].clientWidth;
|
getButtons().children[1].clientWidth +
|
||||||
|
8;
|
||||||
|
|
||||||
const widthPercent =
|
const widthPercent =
|
||||||
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
|
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
|
||||||
|
|
||||||
if (!rateBar) {
|
if (!rateBar) {
|
||||||
document.getElementById('menu-container').insertAdjacentHTML(
|
document.getElementById("menu-container").insertAdjacentHTML(
|
||||||
'beforeend',
|
"beforeend",
|
||||||
`
|
`
|
||||||
<div class="ryd-tooltip">
|
<div class="ryd-tooltip" style="width: ${widthPx}px">
|
||||||
<div
|
<div class="ryd-tooltip-bar-container">
|
||||||
id="return-youtube-dislike-bar-container"
|
<div
|
||||||
style="width: ${widthPx}px;
|
id="return-youtube-dislike-bar-container"
|
||||||
height: 3px; margin-left: 6px;"
|
style="width: 100%; height: 2px;"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
id="return-youtube-dislike-bar"
|
id="return-youtube-dislike-bar"
|
||||||
style="width: ${widthPercent}%; height: 100%"
|
style="width: ${widthPercent}%; height: 100%"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<span id="ryd-dislike-tooltip" class="ryd-tooltiptext ryd-tooltip-top">${likes} / ${dislikes}</span>
|
<tp-yt-paper-tooltip position="top" id="ryd-dislike-tooltip" class="style-scope ytd-sentiment-bar-renderer" role="tooltip" tabindex="-1">
|
||||||
</div>
|
<!--css-build:shady-->${likes.toLocaleString()} / ${dislikes.toLocaleString()}
|
||||||
`
|
</tp-yt-paper-tooltip>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
document.getElementById(
|
document.getElementById(
|
||||||
'return-youtube-dislike-bar-container'
|
"return-youtube-dislike-bar-container"
|
||||||
).style.width = widthPx + 'px';
|
).style.width = widthPx + "px";
|
||||||
document.getElementById('return-youtube-dislike-bar').style.width =
|
document.getElementById("return-youtube-dislike-bar").style.width =
|
||||||
widthPercent + '%';
|
widthPercent + "%";
|
||||||
|
|
||||||
document.getElementById('ryd-dislike-tooltip').innerHTML = `${likes} / ${dislikes}`
|
document
|
||||||
|
.getElementById("ryd-dislike-tooltip")
|
||||||
|
.firstChild().innerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}</div>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +1,26 @@
|
|||||||
#return-youtube-dislike-bar-container {
|
#return-youtube-dislike-bar-container {
|
||||||
background: #c6c6c6;
|
background: var(--yt-spec-icon-disabled);
|
||||||
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#return-youtube-dislike-bar {
|
#return-youtube-dislike-bar {
|
||||||
background: #5094c8;
|
background: var(--yt-spec-text-primary);
|
||||||
}
|
border-radius: 2px;
|
||||||
|
transition: all 0.15s ease-in-out;
|
||||||
[dark] #return-youtube-dislike-bar-container {
|
|
||||||
}
|
|
||||||
|
|
||||||
[dark] #return-youtube-dislike-bar {
|
|
||||||
background: #3ea6ff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ryd-tooltip {
|
.ryd-tooltip {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: block;
|
||||||
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
|
height: 2px;
|
||||||
cursor: pointer;
|
top: 9px;
|
||||||
height: 10px;
|
|
||||||
margin-bottom: -5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tooltip text */
|
.ryd-tooltip-bar-container {
|
||||||
.ryd-tooltip .ryd-tooltiptext {
|
width: 100%;
|
||||||
visibility: hidden;
|
height: 2px;
|
||||||
width: 120px;
|
|
||||||
background-color: #000000c4;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px 0;
|
|
||||||
border-radius: 6px;
|
|
||||||
|
|
||||||
/* Position the tooltip text - see examples below! */
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
padding-top: 6px;
|
||||||
bottom: 15px;
|
padding-bottom: 28px;
|
||||||
left: 10px;
|
top: -6px;
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Show the tooltip text when you mouse over the tooltip container */
|
|
||||||
.ryd-tooltip:hover .ryd-tooltiptext {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
}
|
||||||
@@ -170,42 +170,48 @@ function setEventListeners(evt) {
|
|||||||
|
|
||||||
function createRateBar(likes, dislikes) {
|
function createRateBar(likes, dislikes) {
|
||||||
var rateBar = document.getElementById("return-youtube-dislike-bar-container");
|
var rateBar = document.getElementById("return-youtube-dislike-bar-container");
|
||||||
|
|
||||||
const widthPx =
|
const widthPx =
|
||||||
getButtons().children[0].clientWidth + getButtons().children[1].clientWidth;
|
getButtons().children[0].clientWidth +
|
||||||
|
getButtons().children[1].clientWidth +
|
||||||
|
8;
|
||||||
|
|
||||||
const widthPercent =
|
const widthPercent =
|
||||||
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
|
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
|
||||||
|
|
||||||
if (!rateBar) {
|
if (!rateBar) {
|
||||||
document.getElementById("menu-container").insertAdjacentHTML(
|
document.getElementById("menu-container").insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
`
|
`
|
||||||
<div class="ryd-tooltip">
|
<div class="ryd-tooltip" style="width: ${widthPx}px">
|
||||||
<div
|
<div class="ryd-tooltip-bar-container">
|
||||||
id="return-youtube-dislike-bar-container"
|
<div
|
||||||
style="width: ${widthPx}px;
|
id="return-youtube-dislike-bar-container"
|
||||||
height: 3px; margin-left: 6px;"
|
style="width: 100%; height: 2px;"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
id="return-youtube-dislike-bar"
|
id="return-youtube-dislike-bar"
|
||||||
style="width: ${widthPercent}%; height: 100%"
|
style="width: ${widthPercent}%; height: 100%"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<tp-yt-paper-tooltip position="top" id="ryd-dislike-tooltip" class="style-scope ytd-sentiment-bar-renderer" role="tooltip" tabindex="-1">
|
||||||
|
<!--css-build:shady-->${likes.toLocaleString()} / ${dislikes.toLocaleString()}
|
||||||
|
</tp-yt-paper-tooltip>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
document.getElementById(
|
||||||
|
"return-youtube-dislike-bar-container"
|
||||||
|
).style.width = widthPx + "px";
|
||||||
|
document.getElementById("return-youtube-dislike-bar").style.width =
|
||||||
|
widthPercent + "%";
|
||||||
|
|
||||||
<span id="ryd-dislike-tooltip" class="ryd-tooltiptext ryd-tooltip-top">${likes} / ${dislikes}</span>
|
document
|
||||||
</div>
|
.getElementById("ryd-dislike-tooltip")
|
||||||
`
|
.firstChild().innerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}</div>`;
|
||||||
);
|
}
|
||||||
} else {
|
|
||||||
document.getElementById(
|
|
||||||
"return-youtube-dislike-bar-container"
|
|
||||||
).style.width = widthPx + "px";
|
|
||||||
document.getElementById("return-youtube-dislike-bar").style.width =
|
|
||||||
widthPercent + "%";
|
|
||||||
document.getElementById(
|
|
||||||
"ryd-dislike-tooltip"
|
|
||||||
).innerHTML = `${likes} / ${dislikes}`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// function sendVideoIds() {
|
// function sendVideoIds() {
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
[](https://github.com/Anarios/return-youtube-dislike/commits/main)
|
[](https://addons.mozilla.org/en-US/firefox/addon/return-youtube-dislikes/)
|
||||||
[](https://github.com/Anarios/return-youtube-dislike/issues)
|
[](https://addons.mozilla.org/en-US/firefox/addon/return-youtube-dislikes/)
|
||||||
[](https://github.com/Anarios/return-youtube-dislike/blob/main/LICENSE)
|
[](https://chrome.google.com/webstore/detail/youtube-dislike-button/gebbhagfogifgggkldgodflihgfeippi/)
|
||||||
[](https://addons.mozilla.org/en-US/firefox/addon/return-youtube-dislikes/)
|
[](https://github.com/Anarios/return-youtube-dislike/commits/main)
|
||||||
|
[](https://github.com/Anarios/return-youtube-dislike/issues)
|
||||||
|
[](https://discord.gg/UMxyMmCgfF)
|
||||||
|
[](https://github.com/Anarios/return-youtube-dislike/blob/main/LICENSE)
|
||||||
|
<!--[](https://chrome.google.com/webstore/detail/youtube-dislike-button/gebbhagfogifgggkldgodflihgfeippi/)-->
|
||||||
|
|
||||||
# Return YouTube Dislike
|
# Return YouTube Dislike
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@
|
|||||||
<section id="downloads" class="pb-5">
|
<section id="downloads" class="pb-5">
|
||||||
<h2>Downloads:</h2>
|
<h2>Downloads:</h2>
|
||||||
<p>
|
<p>
|
||||||
<strong>This is an ALHPA version!</strong> It may be slow. It may
|
<strong>This is an ALPHA version!</strong> It may be slow. It may
|
||||||
be buggy.
|
be buggy.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in new issue
Block a user