tangled
alpha
login
or
join now
evbogue.com
/
wiredove
1
fork
atom
a demonstration replicated social networking web app built with anproto
wiredove.net/
social
ed25519
protocols
1
fork
atom
overview
issues
pulls
pipelines
add search functionality
Everett Bogue
9 months ago
bc48a17b
4cacc6b9
+30
-2
2 changed files
expand all
collapse all
unified
split
navbar.js
route.js
+15
-1
navbar.js
···
18
18
} else { return h('span')}
19
19
}
20
20
21
21
+
const searchInput = h('input', {
22
22
+
id: 'search',
23
23
+
placeholder: 'Search',
24
24
+
classList: 'material-symbols-outlined',
25
25
+
style: 'width: 75px; float: right; margin-right: 5px; height: 14px;',
26
26
+
oninput: () => {
27
27
+
searchInput.classList = ''
28
28
+
window.location.hash = '?' + searchInput.value
29
29
+
if (!searchInput.value) { searchInput.classList = 'material-symbols-outlined' }
30
30
+
if (searchInput.value === '?') {searchInput.value = ''}
31
31
+
}
32
32
+
})
33
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
34
-
h('a', {href: 'https://github.com/evbogue/wiredove', classList: 'material-symbols-outlined', style: 'float: right; margin-right: 5px;'}, ['Folder_Data'])
47
47
+
h('a', {href: 'https://github.com/evbogue/wiredove', classList: 'material-symbols-outlined', style: 'float: right; margin-right: 5px;'}, ['Folder_Data']),
48
48
+
searchInput,
35
49
]
36
50
)
37
51
+15
-1
route.js
···
81
81
} catch (err) {console.log(err)}
82
82
}
83
83
84
84
-
else if (src.length === 44 || src.startsWith('?')) {
84
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
95
+
else if (src.startsWith('?')) {
96
96
+
try {
97
97
+
const log = await bogbot.query(src)
98
98
+
if (log && log[0] && log != '') {
99
99
+
adder(log, src, scroller)
100
100
+
}
101
101
+
} catch (err) {}
102
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
125
+
}
126
126
+
if (window.location.hash === '#?') {
127
127
+
const search = document.getElementById('search')
128
128
+
search.value = ''
129
129
+
search.classList = 'material-symbols-outlined'
130
130
+
window.location.hash = ''
117
131
}
118
132
await route()
119
133
}