Encrypt wiki docs to all editors..
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4661 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
eb3c9cd6f3
commit
f0984b19f2
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"type": "tildefriends-app",
|
"type": "tildefriends-app",
|
||||||
"emoji": "📝",
|
"emoji": "📝",
|
||||||
"previous": "&2z1RieeV0Kxp9DoT1Jor5tKImA3n4Sh4Dar0+BZpQxY=.sha256"
|
"previous": "&kjbXfJac0FNZnkr+TlnKjbJOQ/Ktw5C/TWjXu/i6IWs=.sha256"
|
||||||
}
|
}
|
@ -6,7 +6,7 @@ class TfWikiDocElement extends LitElement {
|
|||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
whoami: {type: String},
|
whoami: {type: String},
|
||||||
wiki: {type: String},
|
wiki: {type: Object},
|
||||||
value: {type: Object},
|
value: {type: Object},
|
||||||
blob: {type: String},
|
blob: {type: String},
|
||||||
blob_original: {type: String},
|
blob_original: {type: String},
|
||||||
@ -67,7 +67,7 @@ class TfWikiDocElement extends LitElement {
|
|||||||
async append_message(draft) {
|
async append_message(draft) {
|
||||||
let blob = this.blob;
|
let blob = this.blob;
|
||||||
if (draft || this.value?.private) {
|
if (draft || this.value?.private) {
|
||||||
blob = await tfrpc.rpc.encrypt(this.whoami, this.value.editors, blob);
|
blob = await tfrpc.rpc.encrypt(this.whoami, this.wiki.editors, blob);
|
||||||
}
|
}
|
||||||
let id = await tfrpc.rpc.store_blob(blob);
|
let id = await tfrpc.rpc.store_blob(blob);
|
||||||
let message = {
|
let message = {
|
||||||
@ -179,7 +179,7 @@ class TfWikiDocElement extends LitElement {
|
|||||||
<button ?disabled=${!this.is_editing} @click=${this.on_discard}>Discard</button>
|
<button ?disabled=${!this.is_editing} @click=${this.on_discard}>Discard</button>
|
||||||
<button ?disabled=${!this.is_editing} @click=${() => self.value = Object.assign({}, self.value, {private: !self.value.private})}>${this.value?.private ? 'Make Public' : 'Make Private'}</button>
|
<button ?disabled=${!this.is_editing} @click=${() => self.value = Object.assign({}, self.value, {private: !self.value.private})}>${this.value?.private ? 'Make Public' : 'Make Private'}</button>
|
||||||
</div>
|
</div>
|
||||||
<div ?hidden=${!this.value?.private} style="color: #800">document is private</div>
|
<div ?hidden=${!this.value?.private} style="color: #800">🔒 document is private</div>
|
||||||
<div style="display: flex; flex-direction: row; ${this.value?.private ? 'border-top: 4px solid #800' : ''}">
|
<div style="display: flex; flex-direction: row; ${this.value?.private ? 'border-top: 4px solid #800' : ''}">
|
||||||
<textarea
|
<textarea
|
||||||
?hidden=${!this.is_editing}
|
?hidden=${!this.is_editing}
|
||||||
@ -193,4 +193,4 @@ class TfWikiDocElement extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define('tf-wiki-doc', TfWikiDocElement);
|
customElements.define('tf-wiki-doc', TfWikiDocElement);
|
||||||
|
Loading…
Reference in New Issue
Block a user