diff --git a/public/_locales b/public/_locales index 7c71786b..322a245d 160000 --- a/public/_locales +++ b/public/_locales @@ -1 +1 @@ -Subproject commit 7c71786bb3d27f9ff6d62d2575f17b4bfee89b34 +Subproject commit 322a245df5b39875a0e30725b7b2980ed008aef1 diff --git a/public/help/index.html b/public/help/index.html index f3ac8212..d2e848f4 100644 --- a/public/help/index.html +++ b/public/help/index.html @@ -34,6 +34,20 @@ Come contribute, make some suggestions and help out on Discord or on Matrix.
+ +__MSG_helpPageReviewOptions__
diff --git a/public/help/styles.css b/public/help/styles.css
index 99ff809d..9c4720d0 100644
--- a/public/help/styles.css
+++ b/public/help/styles.css
@@ -322,4 +322,33 @@ svg {
cursor: default;
background-color: var(--disabled);
color: grey;
+}
+
+.dearrow-link {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text-decoration: none;
+
+ font-size: 16px;
+}
+
+.dearrow-link img {
+ width: 35px;
+ padding: 10px
+}
+
+.dearrow-link .close-button {
+ opacity: 0;
+ width: 15px;
+ filter: invert(0.3);
+ transition: opacity 0.2s;
+}
+
+.dearrow-link:hover .close-button {
+ opacity: 1;
+}
+
+.hidden {
+ display: none;
}
\ No newline at end of file
diff --git a/public/options/options.css b/public/options/options.css
index 4ff811de..13cad69d 100644
--- a/public/options/options.css
+++ b/public/options/options.css
@@ -717,4 +717,16 @@ svg {
.dearrow-link > img {
width: 40px;
margin-right: 4px;
+}
+
+.dearrow-link .close-button {
+ opacity: 0;
+ width: 15px;
+ filter: invert(0.3);
+ transition: opacity 0.2s;
+ margin-left: 10px;
+}
+
+.dearrow-link:hover .close-button {
+ opacity: 1;
}
\ No newline at end of file
diff --git a/public/options/options.html b/public/options/options.html
index 5e9f32de..6c09cfd9 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -75,6 +75,8 @@
__MSG_DeArrowPromotionMessage__
+
+
diff --git a/src/config.ts b/src/config.ts
index e820160d..95a36421 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -75,6 +75,7 @@ interface SBConfig {
allowScrollingToEdit: boolean;
deArrowInstalled: boolean;
showDeArrowPromotion: boolean;
+ showDeArrowInSettings: boolean;
showZoomToFillError2: boolean;
// Used to cache calculated text color info
@@ -317,6 +318,7 @@ const syncDefaults = {
allowScrollingToEdit: true,
deArrowInstalled: false,
showDeArrowPromotion: false,
+ showDeArrowInSettings: true,
showZoomToFillError2: true,
categoryPillColors: {},
diff --git a/src/help.ts b/src/help.ts
index 3b8c636b..67296473 100644
--- a/src/help.ts
+++ b/src/help.ts
@@ -3,6 +3,7 @@ import Config from "./config";
import { showDonationLink } from "./utils/configUtils";
import { waitFor } from "../maze-utils/src";
+import { isDeArrowInstalled } from "./utils/crossExtension";
if (document.readyState === "complete") {
init();
@@ -10,6 +11,32 @@ if (document.readyState === "complete") {
document.addEventListener("DOMContentLoaded", init);
}
+// DeArrow promotion
+waitFor(() => Config.isReady()).then(() => {
+ if (Config.config.showNewFeaturePopups && Config.config.showUpsells) {
+ isDeArrowInstalled().then((installed) => {
+ if (!installed) {
+ const deArrowPromotion = document.getElementById("dearrow-link");
+ deArrowPromotion.classList.remove("hidden");
+
+ deArrowPromotion.addEventListener("click", () => Config.config.showDeArrowPromotion = false);
+
+ const text = deArrowPromotion.querySelector("#dearrow-link-text");
+ text.textContent = `${chrome.i18n.getMessage("DeArrowPromotionMessage2").split("?")[0]}? ${chrome.i18n.getMessage("DeArrowPromotionMessage3")}`;
+
+ const closeButton = deArrowPromotion.querySelector(".close-button");
+ closeButton.addEventListener("click", (e) => {
+ e.preventDefault();
+
+ deArrowPromotion.classList.add("hidden");
+ Config.config.showDeArrowPromotion = false;
+ Config.config.showDeArrowInSettings = false;
+ });
+ }
+ });
+ }
+});
+
async function init() {
localizeHtmlPage();
diff --git a/src/options.ts b/src/options.ts
index 965c9840..8acdd86e 100644
--- a/src/options.ts
+++ b/src/options.ts
@@ -74,13 +74,22 @@ async function init() {
}
// DeArrow promotion
- if (Config.config.showNewFeaturePopups && Config.config.showUpsells) {
+ if (Config.config.showNewFeaturePopups && Config.config.showUpsells && Config.config.showDeArrowInSettings) {
isDeArrowInstalled().then((installed) => {
if (!installed) {
const deArrowPromotion = document.getElementById("deArrowPromotion");
deArrowPromotion.classList.remove("hidden");
deArrowPromotion.addEventListener("click", () => Config.config.showDeArrowPromotion = false);
+
+ const closeButton = deArrowPromotion.querySelector(".close-button");
+ closeButton.addEventListener("click", (e) => {
+ e.preventDefault();
+
+ deArrowPromotion.classList.add("hidden");
+ Config.config.showDeArrowPromotion = false;
+ Config.config.showDeArrowInSettings = false;
+ });
}
});
}