From 455a67262eba02f53d5549abdb5b6cedd65e077d Mon Sep 17 00:00:00 2001 From: Affan Zaman <47723802+afnzmn@users.noreply.github.com> Date: Fri, 10 Jun 2022 10:31:39 -0400 Subject: [PATCH 1/2] TEMPORARILY UNAVAILABLE -> TEMP N/A #641 only for English --- Extensions/combined/_locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extensions/combined/_locales/en/messages.json b/Extensions/combined/_locales/en/messages.json index 28c476c..99deba7 100644 --- a/Extensions/combined/_locales/en/messages.json +++ b/Extensions/combined/_locales/en/messages.json @@ -36,7 +36,7 @@ "message": "Stops counting your likes and dislikes." }, "textTempUnavailable": { - "message": "temporarily unavailable" + "message": "temp n/a" }, "textUpdate": { "message": "update to" From 08bdfe1632dab00d768299a1a1e2a293bd8e2e2f Mon Sep 17 00:00:00 2001 From: Aaron Kerckhoff Date: Sun, 24 Jul 2022 18:48:10 +0200 Subject: [PATCH 2/2] Add ratio bar to new design --- Extensions/combined/content-style.css | 2 +- Extensions/combined/src/bar.js | 13 ++++++++++--- Extensions/combined/src/state.js | 5 +++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Extensions/combined/content-style.css b/Extensions/combined/content-style.css index e2e5fa2..d8da7db 100644 --- a/Extensions/combined/content-style.css +++ b/Extensions/combined/content-style.css @@ -41,6 +41,6 @@ height: 2px; position: absolute; padding-top: 6px; - padding-bottom: 28px; + padding-bottom: 12px; top: -6px; } diff --git a/Extensions/combined/src/bar.js b/Extensions/combined/src/bar.js index c56ab57..0c8e328 100644 --- a/Extensions/combined/src/bar.js +++ b/Extensions/combined/src/bar.js @@ -1,5 +1,5 @@ import { getButtons } from "./buttons"; -import { extConfig, isMobile, isLikesDisabled } from "./state"; +import { extConfig, isMobile, isLikesDisabled, isNewDesign } from "./state"; import { cLog, getColorFromTheme } from "./utils"; function createRateBar(likes, dislikes) { @@ -23,12 +23,12 @@ function createRateBar(likes, dislikes) { } ( - document.getElementById("menu-container") || + document.getElementById(isNewDesign() ? "actions-inner" : "menu-container") || document.querySelector("ytm-slim-video-action-bar-renderer") ).insertAdjacentHTML( "beforeend", ` -
+
` ); + + // Add border between info and comments + if (isNewDesign()) { + let descriptionAndActionsElement = document.getElementById("top-row"); + descriptionAndActionsElement.style.borderBottom = "1px solid var(--yt-spec-10-percent-layer)"; + descriptionAndActionsElement.style.paddingBottom = "10px"; + } } else { document.getElementById("ryd-bar-container").style.width = widthPx + "px"; document.getElementById("ryd-bar").style.width = widthPercent + "%"; diff --git a/Extensions/combined/src/state.js b/Extensions/combined/src/state.js index 7160903..15684eb 100644 --- a/Extensions/combined/src/state.js +++ b/Extensions/combined/src/state.js @@ -40,6 +40,10 @@ function isShorts() { return location.pathname.startsWith("/shorts"); } +function isNewDesign() { + return document.getElementById("comment-teaser") !== null; +} + let mutationObserver = new Object(); if (isShorts() && mutationObserver.exists !== true) { @@ -332,6 +336,7 @@ export { isShorts, isVideoDisliked, isVideoLiked, + isNewDesign, getState, setState, setInitialState,