Skip to content

Commit

Permalink
Progress on browser support
Browse files Browse the repository at this point in the history
  • Loading branch information
fileformat committed Oct 9, 2024
1 parent e148cbd commit 1568aad
Show file tree
Hide file tree
Showing 9 changed files with 321 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
[![react.js](https://www.vectorlogo.zone/logos/reactjs/reactjs-ar21.svg)](https://reactjs.org/ "UI Framework")
[![TypeScript](https://www.vectorlogo.zone/logos/typescriptlang/typescriptlang-ar21.svg)](https://www.typescriptlang.org/ "Programming Language")
[![SimpleShare.dev](https://www.vectorlogo.zone/logos/simplesharedev/simplesharedev-ar21.svg)](http://simpleshare.dev/ "Privacy-friendly sharing links")
[![VectorLogoZone](https://www.vectorlogo.zone/logos/vectorlogozone/vectorlogozone-ar21.svg)](https://www.vectorlogo.zone/ "Logos")
[![svgrepo](https://www.vectorlogo.zone/logos/svgrepo/svgrepo-ar21.svg)](https://www.svgrepo.com/svg/249535/browser-accept "browser icon (modified)")
[![VectorLogoZone](https://www.vectorlogo.zone/logos/vectorlogozone/vectorlogozone-ar21.svg)](https://www.vectorlogo.zone/ "Logos")

5 changes: 4 additions & 1 deletion docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ docker build \
#exit 0

docker run \
--env PORT='4000' \
--env PORT=4000 \
--expose 4000 \
--interactive \
--publish 4000:4000 \
--rm \
--tty \
regexplanet-next
153 changes: 153 additions & 0 deletions public/images/browsers/browser-ar21.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
149 changes: 149 additions & 0 deletions public/images/browsers/browser-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app/advanced/[engine]/index.html/TestForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function TestForm(props: TestFormProps) {
const [testInput, setTestInput] = useState<TestInput>(props.testInput);

const inputRows = testInput.inputs.map((input, index) => (
<div className="mb-2" key={`key${index}`}>
<div className="mb-2" key={`ikey${index}`}>
{index <= 0 ? <label htmlFor={`row${index}`} className="col-sm-2 col-form-label">Inputs</label> : <></> }
<input type="text" className="form-control" id={`input${index}`} name="input" defaultValue={input} />
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/app/share/index.html/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ async function lookupShareCode(shareCode: string): Promise<ShareFormState> {
};
}
//shareCode = "yyyyfud6z4r";
const response = await fetch(`https://www.regexplanet.com/share/index.json?share=${shareCode}`);
const shareApiUrl = shareCode.indexOf('-') === -1
? `https://appengine.regexplanet.com/share/index.json?share=${shareCode}`
: `https://www.regex.zone/share/lookup.json?share=${shareCode}`;
const response = await fetch(shareApiUrl);
const data = await response.json();
console.log(`server response=${JSON.stringify(data)}`);
if (data.success) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function Footer() {
{link.label}
</Link>);
if (index < links.length - 1) {
initial.push(<span className="mx-1" key={`key${index}`}>|</span>);
initial.push(<span className="mx-1" key={`fkey${index}`}>|</span>);
}
}
);
Expand Down
7 changes: 4 additions & 3 deletions src/engines/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ export const browser: RegexEngine = {
handle: "browser",
level: "alpha",
links: {},
logo_icon: "https://www.vectorlogo.zone/logos/firefox/firefox-icon.svg", // LATER: dynamic
logo_ar21: "https://www.vectorlogo.zone/logos/firefox/firefox-ar21.svg", // LATER: dynamic
logo_icon: "/images/browsers/browser-icon.svg",
logo_ar21: "/images/browsers/browser-ar21.svg",
nodeping_url: undefined,
notfound: ["javascript", "typescript"],
options: [
{
code: "d",
Expand Down Expand Up @@ -63,7 +64,7 @@ export const browser: RegexEngine = {
short_name: "Your Browser",
source_url: "https://github.com/regexplanet/regexplanet-next",
status_url: undefined,
//test_url: "javascript:browserTest",
test_url: "javascript:",
};


2 changes: 2 additions & 0 deletions src/engines/dotnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ export const dotnet: RegexEngine = {
logo_ar21: "https://www.vectorlogo.zone/logos/dotnet/dotnet-ar21.svg",
options: [],
short_name: ".NET",
status_url: "https://dotnet.gcr.regexplanet.com/status.json",
test_url: "https://dotnet.gcr.regexplanet.com/test.json",
};

0 comments on commit 1568aad

Please sign in to comment.