|
|
@ -218,9 +218,9 @@ function createTextNote(evt, relay) {
|
|
|
|
${evt.tags.length ? `\nTags ${JSON.stringify(evt.tags)}\n` : ''}
|
|
|
|
${evt.tags.length ? `\nTags ${JSON.stringify(evt.tags)}\n` : ''}
|
|
|
|
${evt.content}`
|
|
|
|
${evt.content}`
|
|
|
|
}, [
|
|
|
|
}, [
|
|
|
|
elem('a', {className: `mbox-username${name ? ' mbox-kind0-name' : ''}`, href: `/${evt.nip19.npub}`, data: {nav: true}}, name || userName),
|
|
|
|
elem('a', {className: `mbox-username${name ? ' mbox-kind0-name' : ''}`, href: `/${evt.nip19.npub}`}, name || userName),
|
|
|
|
' ',
|
|
|
|
' ',
|
|
|
|
elem('a', {href: `/${evt.nip19.note}`, data: {nav: true}}, formatTime(time)),
|
|
|
|
elem('a', {href: `/${evt.nip19.note}`}, elem('time', {dateTime: time.toISOString()}, formatTime(time))),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
elem('div', {/* data: isLongContent ? {append: evt.content.slice(280)} : null*/}, [
|
|
|
|
elem('div', {/* data: isLongContent ? {append: evt.content.slice(280)} : null*/}, [
|
|
|
|
...content,
|
|
|
|
...content,
|
|
|
@ -421,11 +421,14 @@ window.addEventListener('popstate', (event) => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const handleLink = (e, a) => {
|
|
|
|
const handleLink = (e, a) => {
|
|
|
|
if ('nav' in a.dataset) {
|
|
|
|
const href = a.getAttribute('href');
|
|
|
|
e.preventDefault();
|
|
|
|
if (
|
|
|
|
|
|
|
|
href === '/'
|
|
|
|
|
|
|
|
|| href.startsWith('/note')
|
|
|
|
|
|
|
|
|| href.startsWith('/npub')
|
|
|
|
|
|
|
|
) {
|
|
|
|
closeSettingsView();
|
|
|
|
closeSettingsView();
|
|
|
|
closePublishView();
|
|
|
|
closePublishView();
|
|
|
|
const href = a.getAttribute('href');
|
|
|
|
|
|
|
|
route(href);
|
|
|
|
route(href);
|
|
|
|
history.pushState({}, null, href);
|
|
|
|
history.pushState({}, null, href);
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|