From ebc4533b10c4d28c319ca16beb3268ce27588c8d Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 6 Jan 2024 18:40:57 +0000 Subject: [PATCH] Minor identity interface improvements. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4735 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/identity.json | 2 +- apps/identity/app.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/identity.json b/apps/identity.json index 5558d38e..3e735005 100644 --- a/apps/identity.json +++ b/apps/identity.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🪪", - "previous": "&1RskhkBW1UheJRrw7xcTjS8ELDMnBXNAuKqW5BiT72c=.sha256" + "previous": "&BOmGofChv5mvgZq61xy5mSS0fshtttcG68uL1ILu+qo=.sha256" } \ No newline at end of file diff --git a/apps/identity/app.js b/apps/identity/app.js index b5d56bb5..51d214b3 100644 --- a/apps/identity/app.js +++ b/apps/identity/app.js @@ -14,13 +14,21 @@ async function main() { import * as tfrpc from '/static/tfrpc.js'; async function export_id(event) { let id = event.srcElement.innerHTML; - document.body.insertBefore(document.createTextNode(await tfrpc.rpc.get_private_key(id)), event.srcElement.parentNode.nextSibling); - event.srcElement.disabled = true; + let element = document.createElement('textarea'); + element.value = await tfrpc.rpc.get_private_key(id); + element.style = 'width: 100%; read-only: true'; + element.readOnly = true; + document.body.insertBefore(element, event.srcElement.parentNode.nextSibling); + event.srcElement.onclick = event => hide_id(event, element); } async function add_id(event) { let id = document.getElementById('add_id').value; await tfrpc.rpc.add_id(id); } + function hide_id(event, element) { + element.parentNode.removeChild(element); + event.srcElement.onclick = export_id; + } window.addEventListener('load', function() { for (let button of document.getElementsByTagName('button')) { if (button.id == "add") { @@ -31,7 +39,10 @@ async function main() { } }); - `+ +

SSB Identity Management

+

Import an SSB Identity from 12 BIP39 English Words

+ +

Export Identities

`+ ids.map(id => `
`).join('\n')+ ``); }