Minor identity interface improvements.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4735 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
4e5f9c86a8
commit
ebc4533b10
@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🪪",
|
||||
"previous": "&1RskhkBW1UheJRrw7xcTjS8ELDMnBXNAuKqW5BiT72c=.sha256"
|
||||
"previous": "&BOmGofChv5mvgZq61xy5mSS0fshtttcG68uL1ILu+qo=.sha256"
|
||||
}
|
@ -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() {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<input type="text" id="add_id"></input><button id="add">Add ID</button>`+
|
||||
<h1>SSB Identity Management</h1>
|
||||
<h2>Import an SSB Identity from 12 BIP39 English Words</h2>
|
||||
<textarea id="add_id" style="width: 100%" rows="4"></textarea><button id="add">Add ID</button>
|
||||
<h2>Export Identities</h2>`+
|
||||
ids.map(id => `<div><button>${id}</button></div>`).join('\n')+
|
||||
`</body>`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user