diff --git a/FireDBG/src/pages/install.js b/FireDBG/src/pages/install.js new file mode 100644 index 0000000..1bcb087 --- /dev/null +++ b/FireDBG/src/pages/install.js @@ -0,0 +1,189 @@ +import React, { useEffect, useState } from "react"; +import Layout from '@theme/Layout'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import styles from './install.module.css'; +import Highlight, { defaultProps } from "prism-react-renderer"; + +import Prism from "prism-react-renderer/prism"; +(typeof global !== "undefined" ? global : window).Prism = Prism; +require("prismjs/components/prism-bash"); + +function InstallBashScript({ mounted, code }) { + const { + siteConfig: { + themeConfig: { prism = {} }, + }, + } = useDocusaurusContext(); + + const prismTheme = prism.theme; + + return ( + + {({ className, tokens, getLineProps, getTokenProps }) => ( +
+                    {tokens.map((line, i) => (
+                        
+ {line.map((token, key) => ( + + ))} +
+ ))} +
+ )} +
+ ); +} + +function InstallPageHeader({ mounted }) { + return ( +
+
+ + +

Install FireDBG

+
+

+ You appear to be running one of Unix, Linux, MacOS. + Install by running: +

+ +
+ +
+

+ You appear to be running Windows 64-bit. + Install by running command in Windows Subsystem for Linux user: +

+ +
+ +
+

I don't recognize your platform.

+

+ We would appreciate it if you + reported an issue, + along with the following values: +

+
+
navigator.platform:
+ +
navigator.appVersion:
+ +
+
+
+
+ ); +} + +export default function Home() { + const { siteConfig } = useDocusaurusContext(); + const [mounted, setMounted] = useState(false); + // The Prism theme on SSR is always the default theme but the site theme + // can be in a different mode. React hydration doesn't update DOM styles + // that come from SSR. Hence force a re-render after mounting to apply the + // current relevant styles. There will be a flash seen of the original + // styles seen using this current approach but that's probably ok. Fixing + // the flash will require changing the theming approach and is not worth it + // at this point. + useEffect(() => { + setMounted(true); + }, []); + + useEffect(() => { + var platforms = ["unknown", "win64", "unix"]; + var platform_override = null; + + function detect_platform() { + "use strict"; + + if (platform_override !== null) { + return platforms[platform_override]; + } + + var os = "unknown"; + + if (navigator.platform == "Linux x86_64") { os = "unix"; } + if (navigator.platform == "Linux i686") { os = "unix"; } + if (navigator.platform == "Linux i686 on x86_64") { os = "unix"; } + if (navigator.platform == "Linux aarch64") { os = "unix"; } + if (navigator.platform == "Linux armv6l") { os = "unix"; } + if (navigator.platform == "Linux armv7l") { os = "unix"; } + if (navigator.platform == "Linux armv8l") { os = "unix"; } + if (navigator.platform == "Linux ppc64") { os = "unix"; } + if (navigator.platform == "Linux mips") { os = "unix"; } + if (navigator.platform == "Linux mips64") { os = "unix"; } + if (navigator.platform == "Mac") { os = "unix"; } + if (navigator.platform == "Win64" || + navigator.userAgent.indexOf("WOW64") != -1 || + navigator.userAgent.indexOf("Win64") != -1) { os = "win64"; } + if (navigator.platform == "FreeBSD x86_64") { os = "unix"; } + if (navigator.platform == "FreeBSD amd64") { os = "unix"; } + if (navigator.platform == "NetBSD x86_64") { os = "unix"; } + if (navigator.platform == "NetBSD amd64") { os = "unix"; } + + if (os == "unknown") { + if (navigator.appVersion.indexOf("Mac") != -1) { os = "unix"; } + if (navigator.appVersion.indexOf("FreeBSD") != -1) { os = "unix"; } + } + + if (navigator.oscpu) { + if (navigator.oscpu.indexOf("Win64") != -1) { os = "win64"; } + if (navigator.oscpu.indexOf("Mac") != -1) { os = "unix"; } + if (navigator.oscpu.indexOf("Linux") != -1) { os = "unix"; } + if (navigator.oscpu.indexOf("FreeBSD") != -1) { os = "unix"; } + if (navigator.oscpu.indexOf("NetBSD") != -1) { os = "unix"; } + } + + return os; + } + + function adjust_for_platform() { + "use strict"; + + var platform = detect_platform(); + + platforms.forEach(function (platform_elem) { + var platform_div = document.getElementById("platform-instructions-" + platform_elem); + if (platform_div) { + platform_div.style.display = "none"; + if (platform === platform_elem) { + platform_div.style.display = "block"; + } + } + }); + } + + function fill_in_bug_report_values() { + var nav_plat = document.getElementById("nav-plat"); + var nav_app = document.getElementById("nav-app"); + if (nav_plat) { + nav_plat.textContent = navigator.platform; + } + if (nav_app) { + nav_app.textContent = navigator.appVersion; + } + } + + adjust_for_platform(); + fill_in_bug_report_values(); + }); + + return ( + +
+ +
+
+ ); +} diff --git a/FireDBG/src/pages/install.md b/FireDBG/src/pages/install.md deleted file mode 100644 index e69de29..0000000 diff --git a/FireDBG/src/pages/install.module.css b/FireDBG/src/pages/install.module.css new file mode 100644 index 0000000..2a7e3bd --- /dev/null +++ b/FireDBG/src/pages/install.module.css @@ -0,0 +1,41 @@ +/* stylelint-disable docusaurus/copyright-header */ + +/** + * CSS files with the .module.css suffix will be treated as CSS modules + * and scoped locally. + */ + +.heroBanner { + padding: 4rem 0; + text-align: center; + position: relative; + overflow: hidden; +} + +@media screen and (max-width: 966px) { + .heroBanner { + padding: 2rem; + } +} + +.buttons { + display: flex; + align-items: center; + justify-content: center; +} + +.homepageBanner { + max-width: 300px; +} + +@media only screen and (max-width: 480px) { + .homepageBanner { + display: none; + } +} + +@media only screen and (min-width: 481px) { + .homepageLogo { + display: none; + } +} \ No newline at end of file