mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 02:41:22 +01:00
Merge pull request #681 from Anarios/revert-622-main
Revert "Add ratio display to new design"
This commit is contained in:
3 files changed
+5
-17
No files matched your search
@@ -41,6 +41,6 @@
|
|||||||
height: 2px;
|
height: 2px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
padding-bottom: 12px;
|
padding-bottom: 28px;
|
||||||
top: -6px;
|
top: -6px;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getButtons } from "./buttons";
|
import { getButtons } from "./buttons";
|
||||||
import { extConfig, isMobile, isLikesDisabled, isNewDesign } from "./state";
|
import { extConfig, isMobile, isLikesDisabled } from "./state";
|
||||||
import { cLog, getColorFromTheme } from "./utils";
|
import { cLog, getColorFromTheme } from "./utils";
|
||||||
|
|
||||||
function createRateBar(likes, dislikes) {
|
function createRateBar(likes, dislikes) {
|
||||||
@@ -23,12 +23,12 @@ function createRateBar(likes, dislikes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(
|
(
|
||||||
document.getElementById(isNewDesign() ? "actions-inner" : "menu-container") ||
|
document.getElementById("menu-container") ||
|
||||||
document.querySelector("ytm-slim-video-action-bar-renderer")
|
document.querySelector("ytm-slim-video-action-bar-renderer")
|
||||||
).insertAdjacentHTML(
|
).insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
`
|
`
|
||||||
<div class="ryd-tooltip" style="width: ${widthPx}px${isNewDesign() ? "; margin-bottom: -2px" : ""}">
|
<div class="ryd-tooltip" style="width: ${widthPx}px">
|
||||||
<div class="ryd-tooltip-bar-container">
|
<div class="ryd-tooltip-bar-container">
|
||||||
<div
|
<div
|
||||||
id="ryd-bar-container"
|
id="ryd-bar-container"
|
||||||
@@ -46,13 +46,6 @@ function createRateBar(likes, dislikes) {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add border between info and comments
|
|
||||||
if (isNewDesign()) {
|
|
||||||
let descriptionAndActionsElement = document.getElementById("description-and-actions");
|
|
||||||
descriptionAndActionsElement.style.borderBottom = "1px solid var(--yt-spec-10-percent-layer)";
|
|
||||||
descriptionAndActionsElement.style.paddingBottom = "10px";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("ryd-bar-container").style.width = widthPx + "px";
|
document.getElementById("ryd-bar-container").style.width = widthPx + "px";
|
||||||
document.getElementById("ryd-bar").style.width = widthPercent + "%";
|
document.getElementById("ryd-bar").style.width = widthPercent + "%";
|
||||||
@@ -69,7 +62,7 @@ function createRateBar(likes, dislikes) {
|
|||||||
} else {
|
} else {
|
||||||
cLog("removing bar");
|
cLog("removing bar");
|
||||||
let ratebar = document.getElementById("ryd-bar-container");
|
let ratebar = document.getElementById("ryd-bar-container");
|
||||||
if (ratebar) {
|
if(ratebar) {
|
||||||
ratebar.parentNode.removeChild(ratebar);
|
ratebar.parentNode.removeChild(ratebar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ function isShorts() {
|
|||||||
return location.pathname.startsWith("/shorts");
|
return location.pathname.startsWith("/shorts");
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNewDesign() {
|
|
||||||
return document.getElementById("comment-teaser") !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mutationObserver = new Object();
|
let mutationObserver = new Object();
|
||||||
|
|
||||||
if (isShorts() && mutationObserver.exists !== true) {
|
if (isShorts() && mutationObserver.exists !== true) {
|
||||||
@@ -334,7 +330,6 @@ export {
|
|||||||
isShorts,
|
isShorts,
|
||||||
isVideoDisliked,
|
isVideoDisliked,
|
||||||
isVideoLiked,
|
isVideoLiked,
|
||||||
isNewDesign,
|
|
||||||
getState,
|
getState,
|
||||||
setState,
|
setState,
|
||||||
setInitialState,
|
setInitialState,
|
||||||
|
|||||||
Reference in new issue
Block a user