fuzzyworld-tools / files / vscode-web / index.html
index.html
| 1 | <!doctype html> |
| 2 | <!-- VS Code in the browser for code.fuzzyworld.net: apps.fuzzyworld.net/vscode/?repo=<name>[&branch=<branch>][&file=<path>[:<line>]]. |
| 3 | Installed by vscode-web/install.sh, beside dist/ (the vscode-web build) and fw-fs/ (our read-only file system). --> |
| 4 | <html lang="en"> |
| 5 | <head> |
| 6 | <meta charset="utf-8"> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> |
| 8 | <meta name="mobile-web-app-capable" content="yes"> |
| 9 | <title>VS Code · code.fuzzyworld.net</title> |
| 10 | <link rel="icon" href="dist/favicon.ico" type="image/x-icon"> |
| 11 | <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="dist/out/vs/workbench/workbench.web.main.css"> |
| 12 | <style> |
| 13 | .fw-missing { font: 16px/1.5 system-ui, sans-serif; max-width: 40rem; margin: 3rem auto; padding: 0 16px; } |
| 14 | @media (prefers-color-scheme: dark) { body:has(.fw-missing) { background: #111113; color: #e8e8ea; } .fw-missing a { color: #79b8ff; } } |
| 15 | </style> |
| 16 | </head> |
| 17 | <body aria-label=""> |
| 18 | <script> |
| 19 | // Which repository: ?repo=<name>, optionally &branch=<branch> (the default branch otherwise), |
| 20 | // and &file=<path>[:<line>] to open a file (and jump to a line) at startup. |
| 21 | (function () { |
| 22 | var q = new URLSearchParams(location.search); |
| 23 | var repo = q.get("repo") || "", branch = q.get("branch") || ""; |
| 24 | var okName = /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(repo); |
| 25 | var file = q.get("file") || "", line = 0; |
| 26 | var lm = /:(\d+)$/.exec(file); |
| 27 | if (lm) { line = +lm[1]; file = file.slice(0, lm.index); } |
| 28 | var okFile = !file || !(/^\/|\/$|\\|[\x00-\x1f]/.test(file) || file.split("/").some(function (s) { return s === "" || s === "." || s === ".."; })); |
| 29 | var okBranch = !branch || (!/[\s~^:?*\[\\@]|\.\.|\/\/|^\/|\/$/.test(branch)); |
| 30 | if (!okName || !okBranch || !okFile) { |
| 31 | document.body.innerHTML = '<div class="fw-missing"><h1>Which repository?</h1><p>Open a repository from its page on ' + |
| 32 | '<a href="https://code.fuzzyworld.net/">code.fuzzyworld.net</a> ("Open in VS Code in the browser"), or add ' + |
| 33 | '<code>?repo=<name></code> to this address.</p></div>'; |
| 34 | window.fwStop = true; |
| 35 | return; |
| 36 | } |
| 37 | document.title = repo + (branch ? " (" + branch + ")" : "") + " · VS Code · code.fuzzyworld.net"; |
| 38 | var app = new URL(".", location.href); |
| 39 | window.product = { |
| 40 | productConfiguration: { |
| 41 | nameShort: "VS Code · code.fuzzyworld.net", |
| 42 | nameLong: "VS Code · code.fuzzyworld.net", |
| 43 | applicationName: "code-fuzzyworld", |
| 44 | dataFolderName: ".vscode-fuzzyworld", |
| 45 | version: "1.91.1", |
| 46 | extensionEnabledApiProposals: { "fuzzyworld.fuzzyworld-fs": ["fileSearchProvider", "textSearchProvider"] }, |
| 47 | // Webviews (e.g. Markdown preview) load from this site, not from Microsoft's CDN. |
| 48 | webviewContentExternalBaseUrlTemplate: new URL("dist/out/vs/workbench/contrib/webview/browser/pre/", app).href, |
| 49 | }, |
| 50 | // The query marks a visit with &file=: fw-fs then leaves the README closed. File systems read only the path. |
| 51 | folderUri: { scheme: "fuzzyworld", path: "/" + repo + (branch ? "@" + branch : ""), query: file ? "file" : "" }, |
| 52 | // force: open the file on every visit, not only the first one to this workspace. |
| 53 | defaultLayout: file ? { force: true, editors: [{ |
| 54 | uri: { scheme: "fuzzyworld", path: "/" + repo + (branch ? "@" + branch : "") + "/" + file, query: "file" }, |
| 55 | options: line ? { selection: { startLineNumber: line, startColumn: 1 } } : undefined, |
| 56 | }] } : undefined, |
| 57 | additionalBuiltinExtensions: [{ scheme: app.protocol.slice(0, -1), authority: app.host, path: app.pathname + "fw-fs" }], |
| 58 | }; |
| 59 | })(); |
| 60 | </script> |
| 61 | <script>if (!window.fwStop) document.write('<script src="dist/out/vs/loader.js"><\/script><script src="dist/out/vs/webPackagePaths.js"><\/script>');</script> |
| 62 | <script> |
| 63 | if (!window.fwStop) { |
| 64 | var dist = new URL("dist/", location.href).href; |
| 65 | Object.keys(self.webPackagePaths).forEach(function (key) { |
| 66 | self.webPackagePaths[key] = dist + "node_modules/" + key + "/" + self.webPackagePaths[key]; |
| 67 | }); |
| 68 | require.config({ |
| 69 | baseUrl: dist + "out", |
| 70 | recordStats: false, |
| 71 | trustedTypesPolicy: window.trustedTypes && window.trustedTypes.createPolicy("amdLoader", { createScriptURL: function (v) { return v; } }), |
| 72 | paths: self.webPackagePaths, |
| 73 | }); |
| 74 | document.write('<script src="dist/out/vs/workbench/workbench.web.main.nls.js"><\/script>' + |
| 75 | '<script src="dist/out/vs/workbench/workbench.web.main.js"><\/script>' + |
| 76 | '<script src="dist/out/vs/code/browser/workbench/workbench.js"><\/script>'); |
| 77 | } |
| 78 | </script> |
| 79 | </body> |
| 80 | </html> |