diff --git a/css/styles.css b/css/styles.css index 455cb78..edc49cd 100644 --- a/css/styles.css +++ b/css/styles.css @@ -304,9 +304,12 @@ button.nav > img.icon { max-height: 300px; object-fit: contain; } +.action-bar { + display: flex; +} .action-bar > button { - margin-right: 25px; opacity: 0.5; + flex: 1; } .reactions { @@ -339,7 +342,6 @@ button.nav > img.icon { .action-bar button.icon { transition: opacity 0.3s linear; - padding: 5px; } .action-bar button.icon img.icon { width: 16px; diff --git a/icon/event-options.svg b/icon/event-options.svg new file mode 100644 index 0000000..065c01b --- /dev/null +++ b/icon/event-options.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/js/event.js b/js/event.js index 60f185e..e03dc19 100644 --- a/js/event.js +++ b/js/event.js @@ -56,13 +56,11 @@ function event_calculate_pow(ev) { const target = +tag[2] if (isNaN(target)) return 0 - // if our nonce target is smaller than the difficulty, // then we use the nonce target as the actual difficulty return min(target, id_bits) } } - // not a valid pow if we don't have a difficulty target return 0 } diff --git a/js/main.js b/js/main.js index 3e79abb..27b5922 100644 --- a/js/main.js +++ b/js/main.js @@ -13,6 +13,7 @@ const SID_DMS_IN = "din"; const SID_PROFILES = "prof"; const SID_THREAD = "thrd"; const SID_FRIENDS = "frds"; +const SID_EVENT = "evnt"; // This is our main entry. // https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event @@ -235,6 +236,7 @@ async function on_pool_eose(relay, sub_id) { } case SID_NOTIFICATIONS: case SID_PROFILES: + case SID_EVENT: pool.unsubscribe(sub_id, relay); break; case SID_DMS_OUT: @@ -284,8 +286,17 @@ function fetch_profile(pubkey, pool, relay) { }], relay); } +function fetch_event(evid, pool) { + const sid = `${SID_EVENT}:${evid}`; + pool.subscribe(sid, [{ + ids: [evid] + }]); + log_debug(`fetching event ${sid}`); +} + function fetch_thread_history(evid, pool) { // TODO look up referenced relays for thread history + fetch_event(evid, pool); const sid = `${SID_THREAD}:${evid}` pool.subscribe(sid, [{ kinds: PUBLIC_KINDS, diff --git a/js/ui/render.js b/js/ui/render.js index 4c34542..e0599e3 100644 --- a/js/ui/render.js +++ b/js/ui/render.js @@ -63,10 +63,12 @@ function render_event(model, ev, opts={}) { const profile = model_get_profile(model, ev.pubkey); const delta = fmt_since_str(new Date().getTime(), ev.created_at*1000) + const target_thread_id = ev.refs.root || ev.id; let classes = "event" if (!opts.is_composing) classes += " bottom-border"; - return html`