From c6e30236e973e7764582bf7a0b8f0f10bdc73fbb Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 1 Sep 2022 15:15:30 -0400 Subject: [PATCH] Add license requirement --- public/_locales/en/messages.json | 47 +++ public/options/options.css | 9 + public/options/options.html | 12 + public/res/countries.json | 1 + public/upsell/index.html | 94 +++++ public/upsell/styles.css | 387 ++++++++++++++++++ .../options/CategorySkipOptionsComponent.tsx | 40 +- .../options/ToggleOptionComponent.tsx | 7 +- src/config.ts | 18 +- src/content.ts | 2 +- src/popup.ts | 9 +- src/svg-icons/lock_svg.tsx | 22 + src/upsell.ts | 71 ++++ src/utils/licenseKey.ts | 65 +++ webpack/webpack.common.js | 3 +- 15 files changed, 775 insertions(+), 12 deletions(-) create mode 100644 public/res/countries.json create mode 100644 public/upsell/index.html create mode 100644 public/upsell/styles.css create mode 100644 src/svg-icons/lock_svg.tsx create mode 100644 src/upsell.ts create mode 100644 src/utils/licenseKey.ts diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index ab6c4e4c..ae14284a 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -1103,5 +1103,52 @@ "Import": { "message": "Import", "description": "Button to initiate importing segments. Appears under the textbox where they paste in the data" + }, + "redeemSuccess": { + "message": "Reedem Successful!" + }, + "redeemFailed": { + "message": "License key is invalid" + }, + "hideUpsells": { + "message": "Hide options not available without extra payment" + }, + "chooseACountry": { + "message": "Choose a country" + }, + "noDiscount": { + "message": "You do not qualify for a discount" + }, + "discountLink": { + "message": "Discount Link (See the pink price)" + }, + "selectYourCountry": { + "message": "Select your country" + }, + "alreadyDonated": { + "message": "If you've donated any amount before now, you may redeem free access by emailing:", + "description": "After the colon is an email address" + }, + "cantAfford": { + "message": "If you can't afford to purchase a license, click {here} to see if you are eligible for a discount", + "description": "Keep the curly braces" + }, + "patreonSignIn": { + "message": "Sign in with Patreon" + }, + "redeem": { + "message": "Redeem" + }, + "joinOnPatreon": { + "message": "Subscribe on Patreon" + }, + "oneTimePurchase": { + "message": "One Time Purchase" + }, + "enterLicenseKey": { + "message": "Enter License Key" + }, + "chaptersPage1": { + "message": "SponsorBlock crowd-sourced chapters feature is only available to people who purchase a license, or for people who are granted access for free due their past contributions" } } diff --git a/public/options/options.css b/public/options/options.css index 36f4d5d7..2bd27161 100644 --- a/public/options/options.css +++ b/public/options/options.css @@ -317,6 +317,10 @@ input[type='number'] { color: grey; } +tr.disabled { + opacity: 0.3; +} + #options { height: 100vh; flex-basis: 80%; @@ -678,4 +682,9 @@ svg { #options > div { max-width: 100%; } +} + +.upsellButton { + cursor: pointer; + vertical-align: middle; } \ No newline at end of file diff --git a/public/options/options.html b/public/options/options.html index 150212ce..765134ec 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -302,6 +302,18 @@ +
+
+ + +
+
+