wiki: Make it possible for links to work. Minor cleanup.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4600 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-11-02 01:43:32 +00:00
parent bf5236e68b
commit 8fe7adc50e
3 changed files with 10 additions and 19 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "📝", "emoji": "📝",
"previous": "&CsLn1jrN7+Zztpnb3Br1yMwvmef9yQ6c090M+eT8d80=.sha256" "previous": "&yXKDVsBMD1J3ZAqbLuG/z2sq/6lIIUu88dennvwuins=.sha256"
} }

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<base target="_top">
</head> </head>
<body style="color: #fff"> <body style="color: #fff">
<tf-collections-app></tf-collections-app> <tf-collections-app></tf-collections-app>

View File

@ -111,6 +111,7 @@ class TfCollectionElement extends LitElement {
if (name) { if (name) {
await this.create(name, [this.whoami]); await this.create(name, [this.whoami]);
} }
this.is_creating = false;
} }
async on_rename(id) { async on_rename(id) {
@ -123,6 +124,7 @@ class TfCollectionElement extends LitElement {
}; };
print(message); print(message);
await tfrpc.rpc.appendMessage(this.whoami, message); await tfrpc.rpc.appendMessage(this.whoami, message);
this.is_renaming = false;
} }
async on_tombstone(event) { async on_tombstone(event) {
@ -168,18 +170,6 @@ class TfCollectionElement extends LitElement {
this._select_by_name = name; this._select_by_name = name;
} }
render_collection(collection) {
return html`
<div>
<button @click=${() => this.set_selected(collection.id, collection, true)}>${collection.name}</button>
<span>${collection.id}</span>
</div>
<div>
${collection.editors.map(id => html`<span>${id}</span>`)}
</div>
`;
}
on_selected(event) { on_selected(event) {
if (this.collections) { if (this.collections) {
for (let collection of this.collections) { for (let collection of this.collections) {
@ -223,12 +213,6 @@ class TfCollectionElement extends LitElement {
${this.collections?.map(x => html`<option value=${x.id} ?selected=${this.selectid === x.id}>${x.name}</option>`)} ${this.collections?.map(x => html`<option value=${x.id} ?selected=${this.selectid === x.id}>${x.name}</option>`)}
</select> </select>
`} `}
<span ?hidden=${!this.is_creating}>
<label for="create_name">New ${this.type} name:</label>
<input type="text" id="create_name"></input>
<button @click=${this.on_create}>Create ${this.type}</button>
<button @click=${() => self.is_creating = false}>x</button>
</span>
<span ?hidden=${!this.is_renaming}> <span ?hidden=${!this.is_renaming}>
<label for="rename_name">Rename to:</label> <label for="rename_name">Rename to:</label>
<input type="text" id="rename_name"></input> <input type="text" id="rename_name"></input>
@ -237,6 +221,12 @@ class TfCollectionElement extends LitElement {
</span> </span>
<button @click=${() => self.is_renaming = true} ?hidden=${this.is_renaming}></button> <button @click=${() => self.is_renaming = true} ?hidden=${this.is_renaming}></button>
<button @click=${self.on_tombstone}>🪦</button> <button @click=${self.on_tombstone}>🪦</button>
<span ?hidden=${!this.is_creating}>
<label for="create_name">New ${this.type} name:</label>
<input type="text" id="create_name"></input>
<button @click=${this.on_create}>Create ${this.type}</button>
<button @click=${() => self.is_creating = false}>x</button>
</span>
<button @click=${() => self.is_creating = true} ?hidden=${this.is_creating}>+</button> <button @click=${() => self.is_creating = true} ?hidden=${this.is_creating}>+</button>
</span> </span>
`; `;