all repos — underbbs @ 2244bbcf7af3ee1b3489243a3fc74e3b6eb603ba

decentralized social media client

ts/message-element.ts (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import util from "./util"
var _ = util._

export class MessageElement extends HTMLElement {
  static observedAttributes = [ "data-id", "data-adapter", "data-replyCt", "data-reactionCt", "data-boostCt" ]
  
  private _id: string | null = null;
  private _adapter: any;
  
  constructor() {
    super();
  }
  
  connectedCallback() {
    this._id = this.getAttribute("data-id");
    this._adapter = _("settings").adapters.filter((a: any)=>a.nickname == this.getAttribute("data-adapter"))[0];
    
    // grab message content from the store and format our innerHTML
  }
}