forked from cory/tildefriends
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:
parent
bf5236e68b
commit
8fe7adc50e
@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "📝",
|
||||
"previous": "&CsLn1jrN7+Zztpnb3Br1yMwvmef9yQ6c090M+eT8d80=.sha256"
|
||||
"previous": "&yXKDVsBMD1J3ZAqbLuG/z2sq/6lIIUu88dennvwuins=.sha256"
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<base target="_top">
|
||||
</head>
|
||||
<body style="color: #fff">
|
||||
<tf-collections-app></tf-collections-app>
|
||||
|
@ -111,6 +111,7 @@ class TfCollectionElement extends LitElement {
|
||||
if (name) {
|
||||
await this.create(name, [this.whoami]);
|
||||
}
|
||||
this.is_creating = false;
|
||||
}
|
||||
|
||||
async on_rename(id) {
|
||||
@ -123,6 +124,7 @@ class TfCollectionElement extends LitElement {
|
||||
};
|
||||
print(message);
|
||||
await tfrpc.rpc.appendMessage(this.whoami, message);
|
||||
this.is_renaming = false;
|
||||
}
|
||||
|
||||
async on_tombstone(event) {
|
||||
@ -168,18 +170,6 @@ class TfCollectionElement extends LitElement {
|
||||
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) {
|
||||
if (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>`)}
|
||||
</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}>
|
||||
<label for="rename_name">Rename to:</label>
|
||||
<input type="text" id="rename_name"></input>
|
||||
@ -237,6 +221,12 @@ class TfCollectionElement extends LitElement {
|
||||
</span>
|
||||
<button @click=${() => self.is_renaming = true} ?hidden=${this.is_renaming}>✏️</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>
|
||||
</span>
|
||||
`;
|
||||
|
Loading…
Reference in New Issue
Block a user