mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-02 22:59:16 +03:00
Added warning message when changing the userID.
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div option-type="text-change" sync-option="userID">
|
||||
<div option-type="text-change" sync-option="userID" confirm-message="userIDChangeWarning">
|
||||
<div class="option-button trigger-button">
|
||||
__MSG_changeUserID__
|
||||
</div>
|
||||
|
||||
@@ -118,7 +118,13 @@ function activateTextChange(element) {
|
||||
textBox.value = SB.config[option];
|
||||
|
||||
let setButton = element.querySelector(".text-change-set");
|
||||
setButton.addEventListener("click", () => {SB.config[option] = textBox.value});
|
||||
setButton.addEventListener("click", () => {
|
||||
let confirmMessage = element.getAttribute("confirm-message");
|
||||
|
||||
if (confirmMessage === null || confirm(chrome.i18n.getMessage(confirmMessage))) {
|
||||
SB.config[option] = textBox.value;
|
||||
}
|
||||
});
|
||||
|
||||
element.querySelector(".option-hidden-section").classList.remove("hidden");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user