a demonstration replicated social networking web app built with anproto wiredove.net/
social ed25519 protocols

add a field to import message and blobs distributed out of band

Ev Bogue e285792e 33c81f7e

+34
+27
import.js
··· 1 + import { h } from 'h' 2 + import { bogbot } from 'bogbot' 3 + 4 + export const importBlob = async () => { 5 + const textarea = h('textarea', {placeholder: 'Import a bog5 message or blob'}) 6 + 7 + const button = h('button', { 8 + onclick: async () => { 9 + if (textarea.value) { 10 + try { 11 + const blob = await bogbot.make(textarea.value) 12 + const msg = await bogbot.open(textarea.value) 13 + window.location.hash = await bogbot.hash(textarea.value) 14 + if (msg) { 15 + await bogbot.add(textarea.value) 16 + } 17 + } catch (err) { 18 + } 19 + } 20 + } 21 + }, ['Import']) 22 + 23 + return h('div', {classList: 'message'}, [ 24 + textarea, 25 + button 26 + ]) 27 + }
+2
navbar.js
··· 26 26 ' ', 27 27 await composeButton(), 28 28 ' ', 29 + h('a', {href: '#import', classList: 'material-symbols-outlined'}, ['Post_Add']), 30 + ' ', 29 31 h('a', {href: '#archive', classList: 'material-symbols-outlined'}, ['Archive']), 30 32 ' ', 31 33 h('a', {href: '#settings', classList: 'material-symbols-outlined', style: 'float: right; margin-right: 25px;'}, ['Settings']),
+5
route.js
··· 6 6 import { makeRoom, gossip } from './gossip.js' 7 7 import { settings, importKey } from './settings.js' 8 8 import { adder } from './adder.js' 9 + import { importBlob } from './import.js' 9 10 10 11 export const route = async () => { 11 12 const src = window.location.hash.substring(1) ··· 54 55 } else { 55 56 scroller.appendChild(await importKey()) 56 57 } 58 + } 59 + 60 + else if (src === 'import') { 61 + scroller.appendChild(await importBlob()) 57 62 } 58 63 59 64 else if (src.length < 44) {