Skip to content

Commit

Permalink
Merge pull request #43 from ator-dev/fixes
Browse files Browse the repository at this point in the history
Add highlight removal, fix page errors
  • Loading branch information
ator-dev authored Oct 30, 2022
2 parents 3bd45c9 + c7ccdfa commit 9c16da9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ type PagePanelInfo = {
}
type PageAlertInfo = {
text: string
timeout?: number
}
type FormField = {
question: string
Expand Down Expand Up @@ -459,11 +460,11 @@ textarea
};

const insertAlert = (alertType: PageAlertType, alertsInfo: Record<PageAlertType, PageAlertInfo> | undefined,
previousSibling: HTMLElement, timeout = -1,
tooltip = "", formatText = (text: string) => text) => {
previousSibling: HTMLElement, timeoutDefault = -1, tooltip = "", formatText = (text: string) => text) => {
if (!alertsInfo) {
return;
}
const timeout = alertsInfo[alertType].timeout ?? timeoutDefault;
const alert = document.createElement("label");
alert.classList.add("alert");
alert.classList.add(alertType);
Expand Down
3 changes: 2 additions & 1 deletion src/sendoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ However, Mark My Search will only improve if we know what needs fixing.`,
},
alerts: {
[PageAlertType.SUCCESS]: {
text: "Success",
text: "Thank you, your feedback will be carefully considered!",
timeout: -1,
},
[PageAlertType.FAILURE]: {
text: "Status {status}: {text}",
Expand Down
6 changes: 4 additions & 2 deletions src/startpage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const loadStartpage = (() => {
text: "Find matches",
onClick: (messageText, formFields, onSuccess) => {
if (chrome.runtime.getURL("/").startsWith("chrome-extension://")) {
chrome.search.query({
chrome.search["query"]({
disposition: "NEW_TAB",
text: messageText,
}, onSuccess);
Expand Down Expand Up @@ -269,7 +269,9 @@ See Features > Keyword Matching for details of these options.`,
text: "Toolbar - click keyword buttons to scroll to the next match.",
},
note: {
text: "Press [Shift+Space] to jump to the next generic match, or assign a shortcut like [Alt+Shift+1] for each term.",
text:
`Press [Alt+Space] to jump to the next generic match, and [Alt+Shift+Space] for the previous,
or assign a shortcut like [Alt+Shift+1] for individual terms.`,
},
},
{
Expand Down
1 change: 1 addition & 0 deletions src/term-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1967,6 +1967,7 @@ const getTermsFromSelection = () => {
if (message.deactivate) {
terms.splice(0);
removeControls();
restoreNodes();
}
if (message.enablePageModify !== undefined) {
controlsInfo.pageModifyEnabled = message.enablePageModify;
Expand Down

0 comments on commit 9c16da9

Please sign in to comment.