-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf99d4a
commit a544237
Showing
147 changed files
with
4,118 additions
and
3,419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
{ | ||
"singleQuote": true | ||
} | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default { runtime: { openOptionsPage: jest.fn() } }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module.exports = { | ||
presets: ['@babel/preset-env', '@babel/preset-react'], | ||
presets: [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript", | ||
"@babel/preset-react", | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
plugins: [ | ||
['postcss-preset-env', {}], | ||
['cssnano', { preset: 'default' }], | ||
["postcss-preset-env", {}], | ||
["cssnano", { preset: "default" }], | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// <reference types="react" /> | ||
|
||
declare module "*.svg" { | ||
export const ReactComponent: React.FunctionComponent< | ||
React.SVGProps<SVGSVGElement> & { title?: string } | ||
>; | ||
|
||
const src: string; | ||
export default src; | ||
} | ||
|
||
// Unfortunately there are no type definitions for "micro-match" at the moment | ||
declare module "micro-match"; | ||
|
||
// This global const is defined by Webpack DefinePlugin | ||
declare const COMMITHASH: string; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import browser from "webextension-polyfill"; | ||
|
||
async function getTickets() { | ||
const [tab] = await browser.tabs.query({ active: true, currentWindow: true }); | ||
const results = await browser.tabs.sendMessage(tab.id!, { tickets: true }); // eslint-disable-line @typescript-eslint/no-non-null-assertion | ||
return results; | ||
} | ||
|
||
Object.assign(window, { getTickets }); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import browser from "webextension-polyfill"; | ||
|
||
import stdsearch from "../core/search"; | ||
|
||
if (window === window.top) { | ||
browser.runtime.onMessage.addListener((req) => { | ||
if (req.tickets) { | ||
const url = new URL(window.location.toString()); | ||
return stdsearch(url, document); | ||
} | ||
|
||
return undefined; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export function trim(string: string | null) { | ||
return string ? string.replace(/^\s+|\s+$/g, "") : null; | ||
} | ||
|
||
// Finders | ||
|
||
export function $find(selector: string, context: HTMLDocument | HTMLElement) { | ||
return context.querySelector<HTMLElement>(selector); | ||
} | ||
|
||
export function $all(selector: string, context: HTMLDocument | HTMLElement) { | ||
return Array.from(context.querySelectorAll<HTMLElement>(selector)); | ||
} | ||
|
||
export function $has(selector: string, context: HTMLDocument | HTMLElement) { | ||
return $find(selector, context) !== null; | ||
} | ||
|
||
// Properties | ||
|
||
export function $text(selector: string, context: HTMLDocument | HTMLElement) { | ||
const node = $find(selector, context); | ||
return node ? trim(node.textContent) : null; | ||
} | ||
|
||
export function $value(selector: string, context: HTMLDocument | HTMLElement) { | ||
const node = $find(selector, context); | ||
return node ? trim(node.getAttribute("value")) : null; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.