diff --git a/apps/wiki.json b/apps/wiki.json index fa107554..c72ae28d 100644 --- a/apps/wiki.json +++ b/apps/wiki.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "📝", - "previous": "&Unu5AZjyD0RF/QzPh2/u7DuU8IPuSFSjYFkmiWAWcqk=.sha256" + "previous": "&G+R9QBUONLBiFGEecnE0w/qJPLOlj3WqtVUVemBdpbo=.sha256" } \ No newline at end of file diff --git a/apps/wiki/index.html b/apps/wiki/index.html index b38afe87..ca46d4bd 100644 --- a/apps/wiki/index.html +++ b/apps/wiki/index.html @@ -7,9 +7,9 @@ - + \ No newline at end of file diff --git a/apps/wiki/tf-collections-app.js b/apps/wiki/tf-wiki-app.js similarity index 81% rename from apps/wiki/tf-collections-app.js rename to apps/wiki/tf-wiki-app.js index ad3a1638..c0e03d89 100644 --- a/apps/wiki/tf-collections-app.js +++ b/apps/wiki/tf-wiki-app.js @@ -17,6 +17,7 @@ class TfCollectionsAppElement extends LitElement { hash: {type: String}, adding_editor: {type: Boolean}, + expand_editors: {type: Boolean}, }; } @@ -37,7 +38,8 @@ class TfCollectionsAppElement extends LitElement { this.ids = await tfrpc.rpc.getIdentities(); this.owner_ids = await tfrpc.rpc.getOwnerIdentities(); this.whoami = await tfrpc.rpc.localStorageGet('collections_whoami'); - this.following = Object.keys(await tfrpc.rpc.following([this.whoami], 2)).sort(); + let ids = [...new Set([...this.owner_ids, this.whoami])].sort(); + this.following = Object.keys(await tfrpc.rpc.following(ids, 2)).sort(); await this.read_wikis(); await this.read_Wiki_docs(); @@ -168,6 +170,20 @@ class TfCollectionsAppElement extends LitElement { this.adding_editor = false; } + async on_remove_editor(id) { + if (confirm(`Are you sure you want to remove ${id} as an editor?`)) { + let editors = [...this.wiki.editors]; + if (editors.indexOf(id) != -1) { + editors = editors.filter(x => x !== id); + } + await tfrpc.rpc.appendMessage(this.whoami, { + type: 'wiki', + key: this.wiki.id, + editors: editors, + }); + } + } + async on_wiki_tombstone(event) { await tfrpc.rpc.appendMessage(this.whoami, { type: 'wiki', @@ -244,14 +260,21 @@ class TfCollectionsAppElement extends LitElement { @rename=${this.on_wiki_doc_rename} @tombstone=${this.on_wiki_doc_tombstone} @change=${this.on_wiki_doc_changed}>`)} -
- Editors: ${this.wiki?.editors} - -
- - - - + +
+
+
    + ${this.wiki?.editors.map(id => html`
  • ${id}
  • `)} +
  • + +
    + + + + +
    +
  • +