Compare commits

..

4 Commits
5.4.2 ... 5.4.4

Author SHA1 Message Date
Ajay
da1be6c87b bump version 2023-04-30 16:49:45 -04:00
Ajay
62a60daac7 Fix preview bar not being created on video element change if not created previously 2023-04-30 14:54:50 -04:00
Ajay
45d45b0068 Fix preview bar not appearing on all videos 2023-04-30 14:35:37 -04:00
Ajay
d3fa735481 Don't show harmful vote option for non chapters 2023-04-27 22:29:08 -04:00
5 changed files with 45 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "5.4.2",
"version": "5.4.4",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",

14
package-lock.json generated
View File

@@ -27,7 +27,7 @@
],
"license": "LGPL-3.0-or-later",
"dependencies": {
"@ajayyy/maze-utils": "1.1.22",
"@ajayyy/maze-utils": "1.1.23",
"content-scripts-register-polyfill": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
@@ -67,9 +67,9 @@
}
},
"node_modules/@ajayyy/maze-utils": {
"version": "1.1.22",
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.22.tgz",
"integrity": "sha512-1BLVVqPHkf+mUlutFiKulQAa1Rt/IJ88ahwIYUAYkBrAVG0T5i75jEzHatsxdILYsg4bxDEpnUcOlrhvhSIdRQ==",
"version": "1.1.23",
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.23.tgz",
"integrity": "sha512-Q6oOHtUWgCwHZdn/wBXoOzwjFxNN/0OuC4HaISHk7tSProwu9tzA/R8YHeGm+TxldAGOJCZ4buOYene2ocrS1w==",
"funding": [
{
"type": "individual",
@@ -13602,9 +13602,9 @@
},
"dependencies": {
"@ajayyy/maze-utils": {
"version": "1.1.22",
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.22.tgz",
"integrity": "sha512-1BLVVqPHkf+mUlutFiKulQAa1Rt/IJ88ahwIYUAYkBrAVG0T5i75jEzHatsxdILYsg4bxDEpnUcOlrhvhSIdRQ=="
"version": "1.1.23",
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.23.tgz",
"integrity": "sha512-Q6oOHtUWgCwHZdn/wBXoOzwjFxNN/0OuC4HaISHk7tSProwu9tzA/R8YHeGm+TxldAGOJCZ4buOYene2ocrS1w=="
},
"@ampproject/remapping": {
"version": "2.2.0",

View File

@@ -4,7 +4,7 @@
"description": "",
"main": "background.js",
"dependencies": {
"@ajayyy/maze-utils": "1.1.22",
"@ajayyy/maze-utils": "1.1.23",
"content-scripts-register-polyfill": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"

View File

@@ -1,6 +1,6 @@
import * as React from "react";
import Config from "../config";
import { Category, SegmentUUID, SponsorTime } from "../types";
import { ActionType, Category, SegmentUUID, SponsorTime } from "../types";
import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
@@ -65,35 +65,39 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
this.tooltip.close();
this.tooltip = null;
} else {
const referenceNode = chapterNode?.parentElement?.parentElement;
if (referenceNode) {
const outerBounding = referenceNode.getBoundingClientRect();
const buttonBounding = (e.target as HTMLElement)?.parentElement?.getBoundingClientRect();
this.tooltip = new Tooltip({
referenceNode: chapterNode?.parentElement?.parentElement,
prependElement: chapterNode?.parentElement,
showLogo: false,
showGotIt: false,
bottomOffset: `${outerBounding.height + 25}px`,
leftOffset: `${buttonBounding.x - outerBounding.x}px`,
extraClass: "centeredSBTriangle",
buttons: [
{
name: chrome.i18n.getMessage("incorrectVote"),
listener: (event) => this.vote(event, 0, e.target as HTMLElement).then(() => {
this.tooltip?.close();
this.tooltip = null;
})
}, {
name: chrome.i18n.getMessage("harmfulVote"),
listener: (event) => this.vote(event, 30, e.target as HTMLElement).then(() => {
this.tooltip?.close();
this.tooltip = null;
})
}
]
});
if (this.state.segment?.actionType === ActionType.Chapter) {
const referenceNode = chapterNode?.parentElement?.parentElement;
if (referenceNode) {
const outerBounding = referenceNode.getBoundingClientRect();
const buttonBounding = (e.target as HTMLElement)?.parentElement?.getBoundingClientRect();
this.tooltip = new Tooltip({
referenceNode: chapterNode?.parentElement?.parentElement,
prependElement: chapterNode?.parentElement,
showLogo: false,
showGotIt: false,
bottomOffset: `${outerBounding.height + 25}px`,
leftOffset: `${buttonBounding.x - outerBounding.x}px`,
extraClass: "centeredSBTriangle",
buttons: [
{
name: chrome.i18n.getMessage("incorrectVote"),
listener: (event) => this.vote(event, 0, e.target as HTMLElement).then(() => {
this.tooltip?.close();
this.tooltip = null;
})
}, {
name: chrome.i18n.getMessage("harmfulVote"),
listener: (event) => this.vote(event, 30, e.target as HTMLElement).then(() => {
this.tooltip?.close();
this.tooltip = null;
})
}
]
});
}
} else {
this.vote(e, 0, e.target as HTMLElement)
}
}
}}>

View File

@@ -1335,9 +1335,9 @@ function videoElementChange(newVideo: boolean): void {
if (previewBar && !utils.findReferenceNode()?.contains(previewBar.container)) {
previewBar.remove();
previewBar = null;
createPreviewBar();
}
createPreviewBar();
}
/**