mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Added testing server option.
This commit is contained in:
@@ -516,5 +516,14 @@
|
|||||||
},
|
},
|
||||||
"showOverlay": {
|
"showOverlay": {
|
||||||
"message": "Show Overlay On Player"
|
"message": "Show Overlay On Player"
|
||||||
|
},
|
||||||
|
"enableTestingServer": {
|
||||||
|
"message": "Enable Beta Testing Server"
|
||||||
|
},
|
||||||
|
"whatEnableTestingServer": {
|
||||||
|
"message": "Your submissions and votes WILL NOT COUNT towards the main server. Only use this for testing."
|
||||||
|
},
|
||||||
|
"testingServerWarning": {
|
||||||
|
"message": "All submissions and votes WILL NOT COUNT towards the main server while connecting to the test server. Make sure to disable this when you want to make real submissions."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -352,7 +352,23 @@
|
|||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
<div option-type="toggle" sync-option="testingServer" confirm-message="testingServerWarning">
|
||||||
|
<label class="switch-container" label-name="__MSG_enableTestingServer__">
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox">
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<div class="small-description">__MSG_whatEnableTestingServer__</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
<div option-type="text-change" sync-option="serverAddress">
|
<div option-type="text-change" sync-option="serverAddress">
|
||||||
<label class="text-label-container">
|
<label class="text-label-container">
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ interface SBConfig {
|
|||||||
audioNotificationOnSkip,
|
audioNotificationOnSkip,
|
||||||
checkForUnlistedVideos: boolean,
|
checkForUnlistedVideos: boolean,
|
||||||
mobileUpdateShowCount: number,
|
mobileUpdateShowCount: number,
|
||||||
|
testingServer: boolean,
|
||||||
|
|
||||||
// What categories should be skipped
|
// What categories should be skipped
|
||||||
categorySelections: CategorySelection[]
|
categorySelections: CategorySelection[]
|
||||||
@@ -125,6 +126,8 @@ var Config: SBObject = {
|
|||||||
audioNotificationOnSkip: false,
|
audioNotificationOnSkip: false,
|
||||||
checkForUnlistedVideos: false,
|
checkForUnlistedVideos: false,
|
||||||
mobileUpdateShowCount: 0,
|
mobileUpdateShowCount: 0,
|
||||||
|
testingServer: false,
|
||||||
|
|
||||||
categorySelections: [{
|
categorySelections: [{
|
||||||
name: "sponsor",
|
name: "sponsor",
|
||||||
option: CategorySkipOption.AutoSkip
|
option: CategorySkipOption.AutoSkip
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ async function init() {
|
|||||||
let checkbox = optionsElements[i].querySelector("input");
|
let checkbox = optionsElements[i].querySelector("input");
|
||||||
let reverse = optionsElements[i].getAttribute("toggle-type") === "reverse";
|
let reverse = optionsElements[i].getAttribute("toggle-type") === "reverse";
|
||||||
|
|
||||||
|
let confirmMessage = optionsElements[i].getAttribute("confirm-message");
|
||||||
|
|
||||||
if (optionResult != undefined) {
|
if (optionResult != undefined) {
|
||||||
checkbox.checked = optionResult;
|
checkbox.checked = optionResult;
|
||||||
|
|
||||||
@@ -49,6 +51,12 @@ async function init() {
|
|||||||
|
|
||||||
// Add click listener
|
// Add click listener
|
||||||
checkbox.addEventListener("click", () => {
|
checkbox.addEventListener("click", () => {
|
||||||
|
// Confirm if required
|
||||||
|
if (checkbox.checked && confirmMessage && !confirm(chrome.i18n.getMessage(confirmMessage))){
|
||||||
|
checkbox.checked = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Config.config[option] = reverse ? !checkbox.checked : checkbox.checked;
|
Config.config[option] = reverse ? !checkbox.checked : checkbox.checked;
|
||||||
|
|
||||||
// See if anything extra must be run
|
// See if anything extra must be run
|
||||||
|
|||||||
Reference in New Issue
Block a user