forked from tools/josh
1
0
Fork 0
This commit is contained in:
Florine W. Dekker 2019-10-31 23:58:16 +01:00
parent 5d7894cb56
commit 0d4ba41a54
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 13 additions and 1 deletions

View File

@ -18,6 +18,10 @@ a:link.fileLink, a:visited.fileLink {
color: #FFFF00;
}
.prefixPath, a:link.prefixPath, a:visited.prefixPath, a:hover.prefixPath {
color: #008000;
}
@media (max-width: 600px) {
.wideScreenOnly {

View File

@ -116,7 +116,15 @@ export class Shell {
if (this.userSession.currentUser === undefined)
throw new IllegalStateError("User is logged in as undefined.");
return `${this.userSession.currentUser.name}@fwdekker.com <span style="color: green;">${this.fileSystem.cwd}</span>&gt; `;
let path = this.fileSystem.getPathTo("");
const parts = [];
while (path.toString() !== "/") {
parts.push(`<a href="#" class="prefixPath" onclick="execute('cd ${path}')">${path.fileName}</a>`);
path = path.parent;
}
const link = `<a href="#" class="prefixPath" onclick="execute('cd /')">/</a>` + parts.reverse().join("/");
return `${this.userSession.currentUser.name}@fwdekker.com <span class="prefixPath">${link}</span>&gt; `;
}
}