aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2020-02-08 22:18:03 -0500
committerAjay Ramachandran <[email protected]>2020-02-08 22:18:03 -0500
commit51d2886f701b30c2255241af0037f4e939ecb849 (patch)
treefc0fb748aacfde4994de1d41774c9fcf3a35e3ac
parentc2eb973a28599566c60840df1488d14b755805c7 (diff)
downloadSponsorBlock-51d2886f701b30c2255241af0037f4e939ecb849.tar.gz
SponsorBlock-51d2886f701b30c2255241af0037f4e939ecb849.zip
Seperated show upload button option from info button.
-rw-r--r--public/_locales/en/messages.json6
-rw-r--r--public/options/options.html17
-rw-r--r--src/config.ts2
-rw-r--r--src/content.ts2
4 files changed, 26 insertions, 1 deletions
diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json
index 0900962e..7daaea3b 100644
--- a/public/_locales/en/messages.json
+++ b/public/_locales/en/messages.json
@@ -395,5 +395,11 @@
},
"shortCheck": {
"message": "The following submission is shorter than your minimum duration option. This could mean that this is already submitted, and just being ignored due to this option. Are you sure you would like to submit?"
+ },
+ "showUploadButton": {
+ "message": "Show Upload Button"
+ },
+ "whatUploadButton": {
+ "message": "This button appears on the YouTube player after you have selected a timestamp and are ready to submit."
}
}
diff --git a/public/options/options.html b/public/options/options.html
index 37aac281..e537ae29 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -201,6 +201,23 @@
<br/>
<br/>
+ <div option-type="toggle" toggle-type="reverse" sync-option="hideUploadButtonPlayerControls">
+ <label class="switch-container" label-name="__MSG_showUploadButton__">
+ <label class="switch">
+ <input type="checkbox" checked>
+ <span class="slider round"></span>
+ </label>
+ </label>
+
+ <br/>
+ <br/>
+
+ <div class="small-description">__MSG_whatUploadButton__</div>
+ </div>
+
+ <br/>
+ <br/>
+
<div option-type="toggle" sync-option="autoUpvote">
<label class="switch-container" label-name="__MSG_enableAutoUpvote__">
<label class="switch">
diff --git a/src/config.ts b/src/config.ts
index 59356dc8..1e56d5d6 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -14,6 +14,7 @@ interface SBConfig {
hideVideoPlayerControls: boolean,
hideInfoButtonPlayerControls: boolean,
hideDeleteButtonPlayerControls: boolean,
+ hideUploadButtonPlayerControls: boolean,
hideDiscordLaunches: number,
hideDiscordLink: boolean,
invidiousInstances: string[],
@@ -107,6 +108,7 @@ var Config: SBObject = {
hideVideoPlayerControls: false,
hideInfoButtonPlayerControls: false,
hideDeleteButtonPlayerControls: false,
+ hideUploadButtonPlayerControls: false,
hideDiscordLaunches: 0,
hideDiscordLink: false,
invidiousInstances: ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
diff --git a/src/content.ts b/src/content.ts
index 87fea5cd..4ca4f1e5 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -807,7 +807,7 @@ async function changeStartSponsorButton(showStartSponsor, uploadButtonVisible) {
(<HTMLImageElement> document.getElementById("startSponsorImage")).src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
document.getElementById("startSponsorButton").setAttribute("title", chrome.i18n.getMessage("sponsorStart"));
- if (document.getElementById("startSponsorImage").style.display != "none" && uploadButtonVisible && !Config.config.hideInfoButtonPlayerControls) {
+ if (document.getElementById("startSponsorImage").style.display != "none" && uploadButtonVisible && !Config.config.hideUploadButtonPlayerControls) {
document.getElementById("submitButton").style.display = "unset";
} else if (!uploadButtonVisible) {
//disable submit button