|
|
@ -11,13 +11,11 @@ pool.addRelay('wss://nostr.x1ddos.ch', {read: true, write: true});
|
|
|
|
// pool.addRelay('wss://nostr.rocks', {read: true, write: false});
|
|
|
|
// pool.addRelay('wss://nostr.rocks', {read: true, write: false});
|
|
|
|
// pool.addRelay('wss://nostr-relay.wlvs.space', {read: true, write: false});
|
|
|
|
// pool.addRelay('wss://nostr-relay.wlvs.space', {read: true, write: false});
|
|
|
|
|
|
|
|
|
|
|
|
const feedlist = document.querySelector('#feedlist');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dateTime = new Intl.DateTimeFormat(navigator.language, {
|
|
|
|
const dateTime = new Intl.DateTimeFormat(navigator.language, {
|
|
|
|
dateStyle: 'full',
|
|
|
|
dateStyle: 'full',
|
|
|
|
timeStyle: 'long',
|
|
|
|
timeStyle: 'long',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const userList = [];
|
|
|
|
const userList = [];
|
|
|
|
let max = 0;
|
|
|
|
let max = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -69,17 +67,13 @@ function renderTextNote(evt, relay) {
|
|
|
|
console.log('has tags', evt)
|
|
|
|
console.log('has tags', evt)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const [host, img, time, userName] = getMetadata(evt, relay);
|
|
|
|
const [host, img, time, userName] = getMetadata(evt, relay);
|
|
|
|
const style = evt.tags.some(tag => tag[0] === 'e') && 'padding-left: 2rem';
|
|
|
|
const body = elem('div', {className: 'mbox-body', title: dateTime.format(time)}, [
|
|
|
|
const body = elem('div', {
|
|
|
|
|
|
|
|
className: 'mbox-body',
|
|
|
|
|
|
|
|
title: dateTime.format(time),
|
|
|
|
|
|
|
|
...(style && {style})
|
|
|
|
|
|
|
|
}, [
|
|
|
|
|
|
|
|
renderProfile(userName, host),
|
|
|
|
renderProfile(userName, host),
|
|
|
|
elem('div', {}, evt.id),
|
|
|
|
elem('div', {}, evt.id),
|
|
|
|
evt.content // text
|
|
|
|
evt.content // text
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
rendernArticle([img, body]);
|
|
|
|
const isReply = evt.tags.some(tag => tag[0] === 'e');
|
|
|
|
|
|
|
|
rendernArticle([img, body], isReply && {className: 'mbox-reply'});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function renderRecommendServer(evt, relay) {
|
|
|
|
function renderRecommendServer(evt, relay) {
|
|
|
@ -97,9 +91,12 @@ function renderProfile(userName, host) {
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function rendernArticle(content) {
|
|
|
|
const feedContainer = document.querySelector('#feed');
|
|
|
|
const art = elem('article', {className: 'mbox'}, content);
|
|
|
|
|
|
|
|
feedlist.prepend(art);
|
|
|
|
function rendernArticle(content, props) {
|
|
|
|
|
|
|
|
const className = ['mbox', props?.className].join(' ');
|
|
|
|
|
|
|
|
const art = elem('article', {...props, className}, content);
|
|
|
|
|
|
|
|
feedContainer.prepend(art);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getMetadata(evt, relay) {
|
|
|
|
function getMetadata(evt, relay) {
|
|
|
|