Skip to content

Use emojis as icons in the Web Workflow #6733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2022
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
4 changes: 2 additions & 2 deletions supervisor/shared/web_workflow/static/directory.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>
<h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;<span id="path"></span></h1>
<div id="usbwarning" style="display: none;">🛈 USB is using the storage. Only allowing reads. See <a href="https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage">the CircuitPython Essentials: Storage guide</a> for details.</div>
<div id="usbwarning" style="display: none;">ℹ️ USB is using the storage. Only allowing reads. See <a href="https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage">the CircuitPython Essentials: Storage guide</a> for details.</div>
<template id="row"><tr><td></td><td></td><td><a></a></td><td></td><td><button class="delete">🗑️</button></td><td><a class="edit_link" href="">Edit</a></td></tr></template>
<table>
<thead><tr><th>Type</th><th>Size</th><th>Path</th><th>Modified</th><th></th></tr></thead>
Expand All @@ -18,5 +18,5 @@ <h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;<span id="path"></span></h1>
<hr>
<input type="file" id="files" multiple><button type="submit" id="upload">Upload</button>
<hr>
+🗀&nbsp;<input type="text" id="name"><button type="submit" id="mkdir">Create Directory</button>
+📁&nbsp;<input type="text" id="name"><button type="submit" id="mkdir">Create Directory</button>
</body></html>
8 changes: 4 additions & 4 deletions supervisor/shared/web_workflow/static/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function refresh_list() {
if (window.location.path != "/fs/") {
var clone = template.content.cloneNode(true);
var td = clone.querySelectorAll("td");
td[0].textContent = "🗀";
td[0].textContent = "📁";
var path = clone.querySelector("a");
let parent = new URL("..", "file://" + current_path);
path.href = "#" + parent.pathname;
Expand All @@ -60,7 +60,7 @@ async function refresh_list() {
// Clone the new row and insert it into the table
var clone = template.content.cloneNode(true);
var td = clone.querySelectorAll("td");
var icon = "⬇";
var icon = "⬇";
var file_path = current_path + f.name;
let api_url = new URL("/fs" + file_path, url_base);
let edit_url = "/edit/#" + file_path;
Expand All @@ -72,12 +72,12 @@ async function refresh_list() {
}

if (f.directory) {
icon = "🗀";
icon = "📁";
} else if(f.name.endsWith(".txt") ||
f.name.endsWith(".py") ||
f.name.endsWith(".js") ||
f.name.endsWith(".json")) {
icon = "🖹";
icon = "📄";
} else if (f.name.endsWith(".html")) {
icon = "🌐";
}
Expand Down