Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions server/static/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,25 @@ class NeovimClient {
let link = document.querySelector("link[rel*='icon']");
if (!link) {
link = document.createElement("link");
link.type = "image/x-icon";
link.type = "image/svg+xml";
link.rel = "shortcut icon";
document.head.appendChild(link);
}

let svgContent;
switch (status) {
case "connected":
svgContent =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">✅</text></svg>';
case "error": {
link.href = "neovim-inactive.svg";
break;
case "connecting":
svgContent =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">🔄</text></svg>';
}
case "connecting": {
link.href = "neovim-inactive.svg";
break;
case "error":
svgContent =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">❌</text></svg>';
}
default: {
link.href = "neovim.svg";
break;
default:
svgContent =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">📝</text></svg>';
}
}

link.href = "data:image/svg+xml," + encodeURIComponent(svgContent);
}

handleMessage(msg) {
Expand Down
1 change: 1 addition & 0 deletions server/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<head>
<title>Neovim Server</title>
<link rel="stylesheet" href="styles.css">
<link rel="icon" type="image/svg+xml" href="neovim.svg">
</head>

<body>
Expand Down
27 changes: 27 additions & 0 deletions server/static/neovim-inactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions server/static/neovim.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.