mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Show description in hover bar
This commit is contained in:
@@ -677,7 +677,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
|
|||||||
const hashPrefix = (await utils.getHash(id, 1)).substr(0, 4);
|
const hashPrefix = (await utils.getHash(id, 1)).substr(0, 4);
|
||||||
const response = await utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
|
const response = await utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
|
||||||
categories,
|
categories,
|
||||||
actionTypes: Config.config.muteSegments ? [ActionType.Skip, ActionType.Mute] : [ActionType.Skip],
|
actionTypes: Config.config.muteSegments ? [ActionType.Skip, ActionType.Mute, ActionType.Chapter] : [ActionType.Skip, ActionType.Chapter],
|
||||||
userAgent: `${chrome.runtime.id}`,
|
userAgent: `${chrome.runtime.id}`,
|
||||||
...extraRequestData
|
...extraRequestData
|
||||||
});
|
});
|
||||||
@@ -968,7 +968,8 @@ function updatePreviewBar(): void {
|
|||||||
segment: segment.segment as [number, number],
|
segment: segment.segment as [number, number],
|
||||||
category: segment.category,
|
category: segment.category,
|
||||||
unsubmitted: false,
|
unsubmitted: false,
|
||||||
showLarger: getCategoryActionType(segment.category) === CategoryActionType.POI
|
showLarger: getCategoryActionType(segment.category) === CategoryActionType.POI,
|
||||||
|
description: segment.description,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -978,7 +979,8 @@ function updatePreviewBar(): void {
|
|||||||
segment: segment.segment as [number, number],
|
segment: segment.segment as [number, number],
|
||||||
category: segment.category,
|
category: segment.category,
|
||||||
unsubmitted: true,
|
unsubmitted: true,
|
||||||
showLarger: getCategoryActionType(segment.category) === CategoryActionType.POI
|
showLarger: getCategoryActionType(segment.category) === CategoryActionType.POI,
|
||||||
|
description: segment.description,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export interface PreviewBarSegment {
|
|||||||
category: Category;
|
category: Category;
|
||||||
unsubmitted: boolean;
|
unsubmitted: boolean;
|
||||||
showLarger: boolean;
|
showLarger: boolean;
|
||||||
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PreviewBar {
|
class PreviewBar {
|
||||||
@@ -129,10 +130,11 @@ class PreviewBar {
|
|||||||
} else if (segment !== null) {
|
} else if (segment !== null) {
|
||||||
this.tooltipContainer.classList.add(TOOLTIP_VISIBLE_CLASS);
|
this.tooltipContainer.classList.add(TOOLTIP_VISIBLE_CLASS);
|
||||||
|
|
||||||
|
const name = segment.description || utils.shortCategoryName(segment.category);
|
||||||
if (segment.unsubmitted) {
|
if (segment.unsubmitted) {
|
||||||
this.categoryTooltip.textContent = chrome.i18n.getMessage("unsubmitted") + " " + utils.shortCategoryName(segment.category);
|
this.categoryTooltip.textContent = chrome.i18n.getMessage("unsubmitted") + " " + name;
|
||||||
} else {
|
} else {
|
||||||
this.categoryTooltip.textContent = utils.shortCategoryName(segment.category);
|
this.categoryTooltip.textContent = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the class if the timestamp text uses it to prevent overlapping
|
// Use the class if the timestamp text uses it to prevent overlapping
|
||||||
|
|||||||
Reference in New Issue
Block a user