Assign all stock apps an emoji, show them in the app list, and let the editor set them.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4242 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-03-21 23:08:04 +00:00
parent 53692a1ea8
commit ec65faa12d
12 changed files with 49 additions and 18 deletions

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "🎛"
}

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "📜"
}

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "💻"
}

View File

@ -1,18 +1,28 @@
async function fetch_info(apps) {
let result = {};
for (let [key, value] of Object.entries(apps)) {
let blob = await ssb.blobGet(value);
blob = blob ? utf8Decode(blob) : '{}';
result[key] = JSON.parse(blob);
}
return result;
}
async function main() {
var apps = await core.apps();
var core_apps = await core.apps('core');
var apps = await fetch_info(await core.apps());
var core_apps = await fetch_info(await core.apps('core'));
var doc = `<!DOCTYPE html>
<html>
<head>
<style>
.container {
display: grid;
grid-template-columns: repeat(auto-fill, 8em);
grid-template-columns: repeat(auto-fill, 64px);
justify-content: space-around;
}
.app {
height: 8em;
width: 8em;
height: 96px;
width: 64px;
display: flex;
flex-direction: column;
align-items: center;
@ -21,7 +31,7 @@ async function main() {
}
.app > a {
text-decoration: none;
max-width: 8em;
max-width: 64px;
text-overflow: ellipsis ellipsis;
overflow: hidden;
}
@ -42,7 +52,7 @@ async function main() {
let icon_a = document.createElement('a');
let icon = document.createElement('div');
icon.appendChild(document.createTextNode('📦'));
icon.appendChild(document.createTextNode(apps[app].emoji || '📦'));
icon.style.fontSize = 'xxx-large';
icon_a.appendChild(icon);
icon_a.href = '/~' + name + '/' + app + '/';
@ -63,4 +73,4 @@ async function main() {
app.setDocument(doc);
}
main();
main();

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "💽"
}

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "📚"
}

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "➡️"
}

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "🐌"
}

View File

@ -79,7 +79,7 @@ class TfElement extends LitElement {
WHERE author = ? AND
rowid > ? AND
rowid <= ? AND
json_extract(content, "$.type") = "contact"
json_extract(content, '$.type') = 'contact'
ORDER BY sequence
`,
[id, last_row_id, max_row_id]);

View File

@ -1,3 +1,4 @@
{
"type": "tildefriends-app"
"type": "tildefriends-app",
"emoji": "☑️"
}