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

add search functionality

+30 -2
+15 -1
navbar.js
··· 18 18 } else { return h('span')} 19 19 } 20 20 21 + const searchInput = h('input', { 22 + id: 'search', 23 + placeholder: 'Search', 24 + classList: 'material-symbols-outlined', 25 + style: 'width: 75px; float: right; margin-right: 5px; height: 14px;', 26 + oninput: () => { 27 + searchInput.classList = '' 28 + window.location.hash = '?' + searchInput.value 29 + if (!searchInput.value) { searchInput.classList = 'material-symbols-outlined' } 30 + if (searchInput.value === '?') {searchInput.value = ''} 31 + } 32 + }) 33 + 21 34 export const navbar = async () => { 22 35 const div = h('div', 23 36 {id: 'navbar'}, ··· 31 44 h('a', {href: '#archive', classList: 'material-symbols-outlined'}, ['Archive']), 32 45 ' ', 33 46 h('a', {href: '#settings', classList: 'material-symbols-outlined', style: 'float: right; margin-right: 25px;'}, ['Settings']), 34 - h('a', {href: 'https://github.com/evbogue/wiredove', classList: 'material-symbols-outlined', style: 'float: right; margin-right: 5px;'}, ['Folder_Data']) 47 + h('a', {href: 'https://github.com/evbogue/wiredove', classList: 'material-symbols-outlined', style: 'float: right; margin-right: 5px;'}, ['Folder_Data']), 48 + searchInput, 35 49 ] 36 50 ) 37 51
+15 -1
route.js
··· 81 81 } catch (err) {console.log(err)} 82 82 } 83 83 84 - else if (src.length === 44 || src.startsWith('?')) { 84 + else if (src.length === 44) { 85 85 try { 86 86 const log = await bogbot.query(src) 87 87 if (log && log[0]) { ··· 92 92 } 93 93 } catch (err) { console.log(err)} 94 94 } 95 + else if (src.startsWith('?')) { 96 + try { 97 + const log = await bogbot.query(src) 98 + if (log && log[0] && log != '') { 99 + adder(log, src, scroller) 100 + } 101 + } catch (err) {} 102 + } 95 103 else if (src.length > 44) { 96 104 const hash = await bogbot.hash(src) 97 105 const opened = await bogbot.open(src) ··· 114 122 window.onhashchange = async () => { 115 123 while (document.getElementById('scroller')) { 116 124 document.getElementById('scroller').remove() 125 + } 126 + if (window.location.hash === '#?') { 127 + const search = document.getElementById('search') 128 + search.value = '' 129 + search.classList = 'material-symbols-outlined' 130 + window.location.hash = '' 117 131 } 118 132 await route() 119 133 }