From 842d35235ad21a6e6bce9f42391d3cb4f5fbfc19 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 17 May 2020 00:23:44 -0400 Subject: [PATCH 1/7] Gave web-ext the beta name and made signing happen at the end. --- .github/workflows/release.yml | 50 ++++++++++++++++++----------------- package.json | 2 +- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50ec9d43..5a5abfdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,6 +49,30 @@ jobs: - name: Zip Artifacts run: cd ./dist ; zip -r ../builds/ChromeExtensionBeta.zip * + # Upload each release asset + - name: Upload ChromeExtension to release + uses: Shopify/upload-to-release@master + with: + args: builds/ChromeExtension.zip + name: ChromeExtension.zip + path: ./builds/ChromeExtension.zip + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload ChromeExtensionBeta to release + uses: Shopify/upload-to-release@master + with: + args: builds/ChromeExtensionBeta.zip + name: ChromeExtensionBeta.zip + path: ./builds/ChromeExtensionBeta.zip + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload FirefoxExtension to release + uses: Shopify/upload-to-release@master + with: + args: builds/FirefoxExtension.zip + name: FirefoxExtension.zip + path: ./builds/FirefoxExtension.zip + repo-token: ${{ secrets.GITHUB_TOKEN }} + + # Firefox Beta - name: Create Firefox Beta artifacts run: npm run build:firefox -- --env.stream=beta - uses: actions/upload-artifact@v1 @@ -66,36 +90,14 @@ jobs: WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} - name: Install rename run: sudo apt-get install rename - - name: Install signed file + - name: Rename signed file run: cd ./web-ext-artifacts ; rename 's/.*/FirefoxSignedInstaller.xpi/' * - uses: actions/upload-artifact@v1 with: name: FirefoxExtensionSigned.xpi path: ./web-ext-artifacts/FirefoxSignedInstaller.xpi - # Upload each release asset - - name: Upload to release - uses: Shopify/upload-to-release@master - with: - args: builds/ChromeExtension.zip - name: ChromeExtension.zip - path: ./builds/ChromeExtension.zip - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload to release - uses: Shopify/upload-to-release@master - with: - args: builds/ChromeExtensionBeta.zip - name: ChromeExtensionBeta.zip - path: ./builds/ChromeExtensionBeta.zip - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload to release - uses: Shopify/upload-to-release@master - with: - args: builds/FirefoxExtension.zip - name: FirefoxExtension.zip - path: ./builds/FirefoxExtension.zip - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload to release + - name: Upload FirefoxSignedInstaller.xpi to release uses: Shopify/upload-to-release@master with: args: web-ext-artifacts/FirefoxSignedInstaller.xpi diff --git a/package.json b/package.json index 88833083..6450ade6 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "scripts": { "web-run": "npm run web-run:chrome", - "web-sign": "web-ext sign -s dist", + "web-sign": "web-ext sign -s dist --id sponsorBlockerBETA@ajay.app", "web-run:firefox": "cd dist && web-ext run --start-url https://addons.mozilla.org/firefox/addon/ublock-origin/", "web-run:chrome": "cd dist && web-ext run --start-url https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm -t chromium", "build": "npm run build:chrome", From edf06ac9081fb11e1917e4301af3df859cbc03b4 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 17 May 2020 11:31:35 -0400 Subject: [PATCH 2/7] Fixed typo: sever -> server --- public/_locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index b9859414..a9a77c7f 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -105,7 +105,7 @@ "message": "You have already voted this way before." }, "serverDown": { - "message": "It seems the sever is down. Contact the dev immediately." + "message": "It seems the server is down. Contact the dev immediately." }, "connectionError": { "message": "A connection error has occured. Error code: " From 05acb1669e8d9c931a4fee013d0c28034cfad4f9 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 19 May 2020 23:21:51 -0400 Subject: [PATCH 3/7] Added segment chooser when skipping multiple segments. Now the skip notice supports skipping multiple segments. --- public/_locales/en/messages.json | 3 + src/components/SkipNoticeComponent.tsx | 176 ++++++++++++++++++------- src/content.ts | 81 ++++++------ src/render/SkipNotice.tsx | 15 ++- src/types.ts | 4 +- 5 files changed, 188 insertions(+), 91 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index a9a77c7f..9d8cf88a 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -566,5 +566,8 @@ }, "nonMusicCategoryOnMusic": { "message": "This video is categorized as music. Are you sure you would like to submit segments with non-music categories? Unless this video is not actually music, you should not be submitting this segment. Please read the guidelines if you are confused." + }, + "multipleSegments": { + "message": "Multiple Segments" } } diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 602b0ffc..8c71b947 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import * as CompileConfig from "../../config.json"; import Config from "../config" -import { ContentContainer, SponsorHideType } from "../types"; +import { ContentContainer, SponsorHideType, SponsorTime } from "../types"; import Utils from "../utils"; var utils = new Utils(); @@ -9,9 +9,17 @@ var utils = new Utils(); import NoticeComponent from "./NoticeComponent"; import NoticeTextSelectionComponent from "./NoticeTextSectionComponent"; +enum SkipNoticeAction { + None, + Upvote, + Downvote, + CategoryVote, + Unskip +} + +export interface SkipNoticeProps { + segments: SponsorTime[]; -export interface SkipNoticeProps { - UUID: string; autoSkip: boolean; // Contains functions and variables from the content script needed by the skip notice contentContainer: ContentContainer; @@ -29,14 +37,16 @@ export interface SkipNoticeState { countdownText: string; unskipText: string; - unskipCallback: () => void; + unskipCallback: (index: number) => void; downvoting: boolean; choosingCategory: boolean; + + actionState: SkipNoticeAction; } class SkipNoticeComponent extends React.Component { - UUID: string; + segments: SponsorTime[]; autoSkip: boolean; // Contains functions and variables from the content script needed by the skip notice contentContainer: ContentContainer; @@ -57,22 +67,30 @@ class SkipNoticeComponent extends React.Component 1 ? "multipleSegments" : "category_" + this.segments[0].category); + let noticeTitle = categoryName + " " + chrome.i18n.getMessage("skipped"); if (!this.autoSkip) { - noticeTitle = chrome.i18n.getMessage("skip") + " " + chrome.i18n.getMessage("category_" + this.getSponsorTime().category) + "?"; + noticeTitle = chrome.i18n.getMessage("skip") + " " + categoryName + "?"; } //add notice this.amountOfPreviousNotices = document.getElementsByClassName("sponsorSkipNotice").length; + + // Sort segments + if (this.segments.length > 1) { + this.segments.sort((a, b) => a.segment[0] - b.segment[0]); + } //this is the suffix added at the end of every id - this.idSuffix = this.UUID + this.amountOfPreviousNotices; + for (const segment of this.segments) { + this.idSuffix += segment.UUID; + } + this.idSuffix += this.amountOfPreviousNotices; if (this.amountOfPreviousNotices > 0) { //another notice exists @@ -92,22 +110,20 @@ class SkipNoticeComponent extends React.Component this.unskip(index), downvoting: false, - choosingCategory: false + choosingCategory: false, + + actionState: SkipNoticeAction.None } if (!this.autoSkip) { - Object.assign(this.state, this.getUnskippedModeInfo(chrome.i18n.getMessage("skip"))); + // Assume manual skip is only skipping 1 submission + Object.assign(this.state, this.getUnskippedModeInfo(0, chrome.i18n.getMessage("skip"))); } } - // Helper method - getSponsorTime() { - return utils.getSponsorTimeFromUUID(this.contentContainer().sponsorTimes, this.UUID); - } - componentDidMount() { if (Config.config.audioNotificationOnSkip && this.audio) { this.audio.volume = this.contentContainer().v.volume * 0.1; @@ -173,7 +189,7 @@ class SkipNoticeComponent extends React.Component + onClick={() => this.prepAction(SkipNoticeAction.Unskip)}> {this.state.unskipText} @@ -198,7 +214,7 @@ class SkipNoticeComponent extends React.Component this.contentContainer().vote(0, this.UUID, undefined, this)}> + onClick={() => this.prepAction(SkipNoticeAction.Downvote)}> {chrome.i18n.getMessage("downvoteDescription")} @@ -220,7 +236,7 @@ class SkipNoticeComponent extends React.Component @@ -228,11 +244,23 @@ class SkipNoticeComponent extends React.Component {/* Submit Button */} - + {chrome.i18n.getMessage("submit")} + + } + + + + } + + {/* Segment Chooser Row */} + {this.state.actionState !== SkipNoticeAction.None && + + + {this.getSubmissionChooser()} } @@ -241,6 +269,32 @@ class SkipNoticeComponent extends React.Component this.performAction(i)} + key={"submission" + i + this.segments[i].category + this.idSuffix}> + {(i + 1) + ". " + chrome.i18n.getMessage("category_" + this.segments[i].category)} + + ); + } + + return elements; + } + + prepAction(action: SkipNoticeAction) { + if (this.segments.length === 1) { + this.performAction(0, action); + } else { + this.setState({ + actionState: action + }); + } + } + getMessageBoxes(): JSX.Element[] | JSX.Element { if (this.state.messages.length === 0) { // Add a spacer if there is no text @@ -265,6 +319,31 @@ class SkipNoticeComponent extends React.Component { + if (this.segments.length > 1) { + // Use the action selectors as a submit button + this.prepAction(SkipNoticeAction.CategoryVote); + } }); } @@ -324,37 +408,38 @@ class SkipNoticeComponent extends React.Component { + this.setState(this.getUnskippedModeInfo(index, buttonText), () => { this.noticeRef.current.resetCountdown(); }); } - getUnskippedModeInfo(buttonText: string) { + getUnskippedModeInfo(index: number, buttonText: string) { + let self = this; let maxCountdownTime = function() { - let sponsorTime = this.getSponsorTime(); - let duration = Math.round((sponsorTime.segment[1] - this.contentContainer().v.currentTime) * (1 / this.contentContainer().v.playbackRate)); + let sponsorTime = self.segments[index]; + let duration = Math.round((sponsorTime.segment[1] - self.contentContainer().v.currentTime) * (1 / self.contentContainer().v.playbackRate)); return Math.max(duration, 4); - }.bind(this); + }; return { unskipText: buttonText, - unskipCallback: this.reskip.bind(this), + unskipCallback: (index) => this.reskip(index), //change max duration to however much of the sponsor is left maxCountdownTime: maxCountdownTime, @@ -363,8 +448,8 @@ class SkipNoticeComponent extends React.Component Config.config !== null, 1000, 1).then(() => videoIDChange(getYo //this only happens if there is an error var sponsorLookupRetries = 0; -//the last time in the video a sponsor was skipped -//used for the go back button -var lastSponsorTimeSkipped: number = null; -//used for ratings -var lastSponsorTimeSkippedUUID: string = null; - //if showing the start sponsor button or the end sponsor button on the player var showingStartSponsor = true; @@ -483,6 +477,19 @@ function startSponsorSchedule(includeIntersectingSegments: boolean = false, curr let timeUntilSponsor = skipTime[0] - currentTime; let videoID = sponsorVideoID; + // Find all indexes in between the start and end + let skippingSegments = [skipInfo.array[skipInfo.index]]; + if (skipInfo.index !== skipInfo.endIndex) { + skippingSegments = []; + + for (const segment of skipInfo.array) { + if (utils.getCategorySelection(segment.category).option === CategorySkipOption.AutoSkip && + segment.segment[0] >= skipTime[0] && segment.segment[1] <= skipTime[1]) { + skippingSegments.push(segment); + } + } + } + // Don't skip if this category should not be skipped if (utils.getCategorySelection(currentSkip.category).option === CategorySkipOption.ShowOverlay) return; @@ -493,7 +500,7 @@ function startSponsorSchedule(includeIntersectingSegments: boolean = false, curr if (incorrectVideoCheck(videoID, currentSkip)) return; if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) { - skipToTime(video, skipInfo.endIndex, skipInfo.array, skipInfo.openNotice); + skipToTime(video, skipTime, skippingSegments, skipInfo.openNotice); // TODO: Know the autoSkip settings for ALL items being skipped if (utils.getCategorySelection(currentSkip.category).option === CategorySkipOption.ManualSkip) { @@ -955,58 +962,58 @@ function previewTime(time: number) { } //skip from the start time to the end time for a certain index sponsor time -function skipToTime(v: HTMLVideoElement, index: number, sponsorTimes: SponsorTime[], openNotice: boolean) { - let autoSkip: boolean = utils.getCategorySelection(sponsorTimes[index].category).option === CategorySkipOption.AutoSkip; +function skipToTime(v: HTMLVideoElement, skipTime: number[], skippingSegments: SponsorTime[], openNotice: boolean) { + // There will only be one submission if it is manual skip + let autoSkip: boolean = utils.getCategorySelection(skippingSegments[0].category).option === CategorySkipOption.AutoSkip; if (autoSkip || previewResetter !== null) { - v.currentTime = sponsorTimes[index].segment[1]; + v.currentTime = skipTime[1]; } - lastSponsorTimeSkipped = sponsorTimes[index].segment[0]; - - let currentUUID: string = sponsorTimes[index].UUID; - lastSponsorTimeSkippedUUID = currentUUID; - if (openNotice) { //send out the message saying that a sponsor message was skipped if (!Config.config.dontShowNotice || !autoSkip) { - let skipNotice = new SkipNotice(currentUUID, autoSkip, skipNoticeContentContainer); - - //auto-upvote this sponsor - if (Config.config.trackViewCount && autoSkip && Config.config.autoUpvote) { - vote(1, currentUUID); - } + let skipNotice = new SkipNotice(skippingSegments, autoSkip, skipNoticeContentContainer); } //send telemetry that a this sponsor was skipped - if (Config.config.trackViewCount && !sponsorSkipped[index] && autoSkip) { - utils.sendRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + currentUUID); + if (Config.config.trackViewCount && autoSkip) { + let alreadySkipped = false; + let isPreviewSegment = false; + for (const segment of skippingSegments) { + let index = sponsorTimes.indexOf(segment); + if (index !== -1 && !sponsorSkipped[index]) { + utils.sendRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID); + + sponsorSkipped[index] = true; + } else if (sponsorSkipped[index]) { + alreadySkipped = true; + } + + if (index !== -1) isPreviewSegment = true; + } + // Count this as a skip - Config.config.minutesSaved = Config.config.minutesSaved + (sponsorTimes[index].segment[1] - sponsorTimes[index].segment[0]) / 60; - Config.config.skipCount = Config.config.skipCount + 1; - - sponsorSkipped[index] = true; + if (!alreadySkipped && !isPreviewSegment) { + Config.config.minutesSaved = Config.config.minutesSaved + (skipTime[1] - skipTime[0]) / 60; + Config.config.skipCount = Config.config.skipCount + 1; + } } } } -function unskipSponsorTime(UUID) { +function unskipSponsorTime(segment: SponsorTime) { if (sponsorTimes != null) { //add a tiny bit of time to make sure it is not skipped again - video.currentTime = utils.getSponsorTimeFromUUID(sponsorTimes, UUID).segment[0] + 0.001; + video.currentTime = segment.segment[0] + 0.001; checkIfInsideSegment(); } } -function reskipSponsorTime(UUID) { - if (sponsorTimes != null) { - video.currentTime = utils.getSponsorTimeFromUUID(sponsorTimes, UUID).segment[1]; - - // See if any skips need to be done if this is inside of another segment - startSponsorSchedule(true, utils.getSponsorTimeFromUUID(sponsorTimes, UUID).segment[1]); - } +function reskipSponsorTime(segment: SponsorTime) { + video.currentTime = segment.segment[1]; } /** @@ -1370,7 +1377,7 @@ function vote(type: number, UUID: string, category?: string, skipNotice?: SkipNo if (response.successType == 1 || (response.successType == -1 && response.statusCode == 429)) { //success (treat rate limits as a success) if (type === 0 || category) { - skipNotice.afterDownvote.bind(skipNotice)(type, category); + skipNotice.afterDownvote.bind(skipNotice)(utils.getSponsorTimeFromUUID(sponsorTimes, UUID), type, category); } } else if (response.successType == 0) { //failure: duplicate vote diff --git a/src/render/SkipNotice.tsx b/src/render/SkipNotice.tsx index 49265fb8..4b969098 100644 --- a/src/render/SkipNotice.tsx +++ b/src/render/SkipNotice.tsx @@ -2,17 +2,18 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import SkipNoticeComponent from "../components/SkipNoticeComponent"; +import { SponsorTime } from "../types"; class SkipNotice { - UUID: string; + segments: SponsorTime[]; autoSkip: boolean; // Contains functions and variables from the content script needed by the skip notice contentContainer: () => any; noticeElement: HTMLDivElement; - constructor(UUID: string, autoSkip: boolean = false, contentContainer) { - this.UUID = UUID; + constructor(segments: SponsorTime[], autoSkip: boolean = false, contentContainer) { + this.segments = segments; this.autoSkip = autoSkip; this.contentContainer = contentContainer; @@ -35,7 +36,11 @@ class SkipNotice { let amountOfPreviousNotices = document.getElementsByClassName("sponsorSkipNotice").length; //this is the suffix added at the end of every id - let idSuffix = this.UUID + amountOfPreviousNotices; + let idSuffix = ""; + for (const segment of this.segments) { + idSuffix += segment.UUID; + } + idSuffix += amountOfPreviousNotices; this.noticeElement = document.createElement("div"); this.noticeElement.id = "sponsorSkipNoticeContainer" + idSuffix; @@ -43,7 +48,7 @@ class SkipNotice { referenceNode.prepend(this.noticeElement); ReactDOM.render( - this.close()} />, diff --git a/src/types.ts b/src/types.ts index 0bf80bd9..002f4daf 100644 --- a/src/types.ts +++ b/src/types.ts @@ -5,12 +5,12 @@ interface ContentContainer { (): { vote: (type: any, UUID: any, category?: string, skipNotice?: SkipNoticeComponent) => void, dontShowNoticeAgain: () => void, - unskipSponsorTime: (UUID: any) => void, + unskipSponsorTime: (segment: SponsorTime) => void, sponsorTimes: SponsorTime[], sponsorTimesSubmitting: SponsorTime[], v: HTMLVideoElement, sponsorVideoID, - reskipSponsorTime: (UUID: any) => void, + reskipSponsorTime: (segment: SponsorTime) => void, updatePreviewBar: () => void, onMobileYouTube: boolean, sponsorSubmissionNotice: SubmissionNotice, From ef17cae9a179498a4524a85d06c9e6e0959552eb Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 20 May 2020 23:32:57 -0400 Subject: [PATCH 4/7] Changed to upvote/downvote from report --- manifest/manifest.json | 4 +- public/_locales/en/messages.json | 5 ++- public/icons/thumbs_down.svg | 58 +++++++++++++++++++++++++ public/icons/thumbs_up.svg | 59 ++++++++++++++++++++++++++ src/components/SkipNoticeComponent.tsx | 29 +++++++------ src/content.ts | 4 +- 6 files changed, 142 insertions(+), 17 deletions(-) create mode 100644 public/icons/thumbs_down.svg create mode 100644 public/icons/thumbs_up.svg diff --git a/manifest/manifest.json b/manifest/manifest.json index a64cbb13..f704bc77 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "__MSG_Name__", - "version": "1.2.28.4", + "version": "1.2.29", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [{ @@ -30,6 +30,8 @@ "icons/PlayerUploadFailedIconSponsorBlocker256px.png", "icons/upvote.png", "icons/downvote.png", + "icons/thumbs_down.svg", + "icons/thumbs_up.svg", "icons/report.png", "icons/close.png", "icons/beep.ogg", diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 9d8cf88a..c4de7a57 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -35,11 +35,14 @@ "Segments": { "message": "sponsor segments" }, + "upvoteButtonInfo": { + "message": "Upvote this submission" + }, "reportButtonTitle": { "message": "Report" }, "reportButtonInfo": { - "message": "Report this sponsor submission as incorrect." + "message": "Report this submission as incorrect." }, "Dismiss": { "message": "Dismiss" diff --git a/public/icons/thumbs_down.svg b/public/icons/thumbs_down.svg new file mode 100644 index 00000000..09b88432 --- /dev/null +++ b/public/icons/thumbs_down.svg @@ -0,0 +1,58 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/public/icons/thumbs_up.svg b/public/icons/thumbs_up.svg new file mode 100644 index 00000000..85e1b743 --- /dev/null +++ b/public/icons/thumbs_up.svg @@ -0,0 +1,59 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 8c71b947..46c58db0 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -164,19 +164,19 @@ class SkipNoticeComponent extends React.Component - {/* Report Text */} - - - {chrome.i18n.getMessage("reportButtonTitle")} - + {/* Upvote Button */} + this.prepAction(SkipNoticeAction.Upvote)}> + + {/* Report Button */} this.adjustDownvotingState(true)}> @@ -328,6 +328,9 @@ class SkipNoticeComponent extends React.Component Date: Wed, 20 May 2020 23:36:03 -0400 Subject: [PATCH 5/7] Added padding to vote buttons --- src/components/SkipNoticeComponent.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 46c58db0..51aa3722 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -167,6 +167,7 @@ class SkipNoticeComponent extends React.Component this.prepAction(SkipNoticeAction.Upvote)}> From 0f82c169403dd119f2f8c5c670c756462a030e37 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 20 May 2020 23:47:13 -0400 Subject: [PATCH 6/7] Fixed "voted" text. --- src/components/SkipNoticeComponent.tsx | 86 ++++++++++++-------------- 1 file changed, 38 insertions(+), 48 deletions(-) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 51aa3722..7e6c4751 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -41,6 +41,7 @@ export interface SkipNoticeState { downvoting: boolean; choosingCategory: boolean; + thanksForVotingText: boolean; //null until the voting buttons should be hidden actionState: SkipNoticeAction; } @@ -114,6 +115,7 @@ class SkipNoticeComponent extends React.Component {/* Vote Button Container */} - + {!this.state.thanksForVotingText ? + - {/* Upvote Button */} - this.prepAction(SkipNoticeAction.Upvote)}> - - + {/* Upvote Button */} + this.prepAction(SkipNoticeAction.Upvote)}> + + - {/* Report Button */} - this.adjustDownvotingState(true)}> - - + {/* Report Button */} + this.adjustDownvotingState(true)}> + + - + + + : + + + {this.state.thanksForVotingText} + + } {/* Unskip Button */} @@ -499,37 +511,15 @@ class SkipNoticeComponent extends React.Component Date: Wed, 20 May 2020 23:50:26 -0400 Subject: [PATCH 7/7] Removed autoUpvote config --- public/_locales/en/messages.json | 6 ------ public/options/options.html | 17 ----------------- src/config.ts | 7 +++++-- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index c4de7a57..c8fa5bb9 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -380,12 +380,6 @@ "currentInstances": { "message": "Current Instances:" }, - "enableAutoUpvote": { - "message": "Auto Upvote" - }, - "whatAutoUpvote": { - "message": "With this enabled, the extension will upvote all submissions you view if you do not report them. If the notice is disabled, this will not occur." - }, "minDuration": { "message": "Minimum duration (seconds):" }, diff --git a/public/options/options.html b/public/options/options.html index 0a93ad22..3cd69b01 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -237,23 +237,6 @@

-
- - -
-
- -
__MSG_whatAutoUpvote__
-
- -
-
-