mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Add copy public id button
This commit is contained in:
@@ -161,6 +161,9 @@
|
||||
"setUsername": {
|
||||
"message": "Set Username"
|
||||
},
|
||||
"copyPublicID": {
|
||||
"message": "Copy Public UserID"
|
||||
},
|
||||
"discordAdvert": {
|
||||
"message": "Come join the official discord server to give suggestions and feedback!"
|
||||
},
|
||||
|
||||
@@ -265,7 +265,7 @@ background-color:#ec1c1c;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sbSlimButton, #additionalButtons>button, button#setUsernameButton, #submitUsername {
|
||||
.sbSlimButton, #additionalButtons>button, button#setUsernameButton, #submitUsername, #copyUserID {
|
||||
background: none;
|
||||
border: none;
|
||||
color: white;
|
||||
@@ -341,6 +341,14 @@ label>p, #disableExtension>p, #usernameValue, #usernameElement > div > p,#sponso
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#copyUserID {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#setUsernameContainer {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#usernameElement > div, #sponsorTimesContributionsContainer > div {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
|
||||
@@ -90,6 +90,9 @@
|
||||
<button id="setUsernameButton" title="__MSG_setUsername__">
|
||||
<img src="/icons/pencil.svg" alt="__MSG_setUsername__" width="16" height="16" id="sbPopupIconEdit">
|
||||
</button>
|
||||
<button id="copyUserID" title="__MSG_copyPublicID__">
|
||||
<img src="/icons/clipboard.svg" alt="__MSG_copyPublicID__" width="16" height="16" id="sbPopupIconCopyUserID">
|
||||
</button>
|
||||
</div>
|
||||
<div id="setUsername" style="display: none">
|
||||
<div id="setUsernameStatusContainer" style="display: none">
|
||||
|
||||
@@ -1457,11 +1457,13 @@ function openInfoMenu() {
|
||||
const logo = <HTMLImageElement> popup.querySelector("#sponsorBlockPopupLogo");
|
||||
const settings = <HTMLImageElement> popup.querySelector("#sbPopupIconSettings");
|
||||
const edit = <HTMLImageElement> popup.querySelector("#sbPopupIconEdit");
|
||||
const copy = <HTMLImageElement> popup.querySelector("#sbPopupIconCopyUserID");
|
||||
const check = <HTMLImageElement> popup.querySelector("#sbPopupIconCheck");
|
||||
const refreshSegments = <HTMLImageElement> popup.querySelector("#refreshSegments");
|
||||
logo.src = chrome.extension.getURL("icons/IconSponsorBlocker256px.png");
|
||||
settings.src = chrome.extension.getURL("icons/settings.svg");
|
||||
edit.src = chrome.extension.getURL("icons/pencil.svg");
|
||||
copy.src = chrome.extension.getURL("icons/clipboard.svg");
|
||||
check.src = chrome.extension.getURL("icons/check.svg");
|
||||
refreshSegments.src = chrome.extension.getURL("icons/refresh.svg");
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
"usernameInput",
|
||||
"usernameValue",
|
||||
"submitUsername",
|
||||
"sbPopupIconCopyUserID",
|
||||
// More
|
||||
"submissionSection",
|
||||
"mainControls",
|
||||
@@ -134,6 +135,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
PageElements.optionsButton.addEventListener("click", openOptions);
|
||||
PageElements.helpButton.addEventListener("click", openHelp);
|
||||
PageElements.refreshSegmentsButton.addEventListener("click", refreshSegments);
|
||||
PageElements.sbPopupIconCopyUserID.addEventListener("click", async () => navigator.clipboard.writeText(await utils.getHash(Config.config.userID)));
|
||||
|
||||
/** If true, the content script is in the process of creating a new segment. */
|
||||
let creatingSegment = false;
|
||||
|
||||
Reference in New Issue
Block a user