A lot of clean up
This commit is contained in:
parent
d89744f46f
commit
931fa141dc
62 changed files with 447 additions and 993 deletions
|
|
@ -1,47 +1,47 @@
|
|||
// Navigation Commands Module
|
||||
if (window.terminal) {
|
||||
// Navigate to URL command
|
||||
window.terminal.registerCommand("goto", "Navigate to a URL", (args) => {
|
||||
if (args.length === 0) {
|
||||
window.terminal.printError("Usage: goto <url>");
|
||||
window.terminal.print("Examples:");
|
||||
window.terminal.print(" goto google.com");
|
||||
window.terminal.print(" goto https://github.com");
|
||||
return;
|
||||
}
|
||||
// window.terminal.registerCommand("goto", "Navigate to a URL", (args) => {
|
||||
// if (args.length === 0) {
|
||||
// window.terminal.printError("Usage: goto <url>");
|
||||
// window.terminal.print("Examples:");
|
||||
// window.terminal.print(" goto google.com");
|
||||
// window.terminal.print(" goto https://github.com");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const url = args[0];
|
||||
window.terminal.printInfo(`Navigating to ${url}...`);
|
||||
// const url = args[0];
|
||||
// window.terminal.printInfo(`Navigating to ${url}...`);
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.href = url.startsWith("http") ? url : `https://${url}`;
|
||||
}, 500);
|
||||
});
|
||||
// setTimeout(() => {
|
||||
// window.location.href = url.startsWith("http") ? url : `https://${url}`;
|
||||
// }, 500);
|
||||
// });
|
||||
|
||||
// Open in new tab command
|
||||
window.terminal.registerCommand("open", "Open URL in new tab", (args) => {
|
||||
if (args.length === 0) {
|
||||
window.terminal.printError("Usage: open <url>");
|
||||
window.terminal.print("Examples:");
|
||||
window.terminal.print(" open google.com");
|
||||
window.terminal.print(" open https://github.com");
|
||||
return;
|
||||
}
|
||||
// window.terminal.registerCommand("open", "Open URL in new tab", (args) => {
|
||||
// if (args.length === 0) {
|
||||
// window.terminal.printError("Usage: open <url>");
|
||||
// window.terminal.print("Examples:");
|
||||
// window.terminal.print(" open google.com");
|
||||
// window.terminal.print(" open https://github.com");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const url = args[0];
|
||||
window.terminal.printInfo(`Opening ${url} in new tab...`);
|
||||
// const url = args[0];
|
||||
// window.terminal.printInfo(`Opening ${url} in new tab...`);
|
||||
|
||||
const fullUrl = url.startsWith("http") ? url : `https://${url}`;
|
||||
window.open(fullUrl, "_blank");
|
||||
});
|
||||
// const fullUrl = url.startsWith("http") ? url : `https://${url}`;
|
||||
// window.open(fullUrl, "_blank");
|
||||
// });
|
||||
|
||||
// Reload page command
|
||||
window.terminal.registerCommand("reload", "Reload the current page", () => {
|
||||
window.terminal.printInfo("Reloading page...");
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 500);
|
||||
});
|
||||
// window.terminal.registerCommand("reload", "Reload the current page", () => {
|
||||
// window.terminal.printInfo("Reloading page...");
|
||||
// setTimeout(() => {
|
||||
// window.location.reload();
|
||||
// }, 500);
|
||||
// });
|
||||
|
||||
// PAGE NAVIGATION
|
||||
|
||||
|
|
@ -57,4 +57,16 @@ if (window.terminal) {
|
|||
window.location.href = "/audio/";
|
||||
},
|
||||
);
|
||||
|
||||
window.terminal.registerCommand("blog", "Read my blog posts", () => {
|
||||
window.location.href = "/blog/";
|
||||
});
|
||||
|
||||
window.terminal.registerCommand(
|
||||
"now",
|
||||
"What I'm doing now and tools I use",
|
||||
() => {
|
||||
window.location.href = "/now/";
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue