From dc0e58afc1dae8d890f9fc0c239c453cbe2f5b36 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 13 Jan 2024 02:55:52 +0000 Subject: [PATCH] w3.css-ified ssb more. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4762 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb.json | 2 +- apps/ssb/tf-compose.js | 2 +- apps/ssb/tf-profile.js | 46 ++++++++++++------------ apps/ssb/tf-tab-connections.js | 65 ++++++++++++++++++---------------- apps/ssb/tf-tab-query.js | 6 ++-- apps/ssb/tf-tab-search.js | 6 ++-- 6 files changed, 66 insertions(+), 61 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 7ce37085b..d21e708a6 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&CU5ADSjXhLREtBlOLVFPZNcWXg7XJFWAp/VI9OJzZ18=.sha256" + "previous": "&aqKwpmeLdHyypzeyvuH0xCn5U8trsZ+NPY8safqAyYo=.sha256" } \ No newline at end of file diff --git a/apps/ssb/tf-compose.js b/apps/ssb/tf-compose.js index fc3a19417..9097cd4ae 100644 --- a/apps/ssb/tf-compose.js +++ b/apps/ssb/tf-compose.js @@ -314,7 +314,7 @@ class TfComposeElement extends LitElement { return html`
- self.remove_mention(mention.link)}> +

${mention.name}

diff --git a/apps/ssb/tf-profile.js b/apps/ssb/tf-profile.js index 71a0350ae..9a05061c0 100644 --- a/apps/ssb/tf-profile.js +++ b/apps/ssb/tf-profile.js @@ -184,47 +184,49 @@ class TfProfileElement extends LitElement { if (this.editing) { let server_follow; if (this.server_follows_me === true) { - server_follow = html` this.server_follow_me(false)}>`; + server_follow = html``; } else if (this.server_follows_me === false) { - server_follow = html` this.server_follow_me(true)}>`; + server_follow = html``; } edit = html` - - + + ${server_follow} `; } else { - edit = html``; + edit = html``; } } if (this.id !== this.whoami && this.following !== undefined) { follow = this.following ? - html`` : - html``; + html`` : + html``; } if (this.id !== this.whoami && this.blocking !== undefined) { block = this.blocking ? - html`` : - html``; + html`` : + html``; } let edit_profile = this.editing ? html` -
-
- - this.editing = Object.assign({}, this.editing, {name: event.srcElement.value})}> -
-
- -
- - self.editing = Object.assign({}, self.editing, {publicWebHosting: event.srcElement.checked})}> -
-
- +
+
+
+ + this.editing = Object.assign({}, this.editing, {name: event.srcElement.value})}> +
+
+ +
+ + self.editing = Object.assign({}, self.editing, {publicWebHosting: event.srcElement.checked})}> +
+
+ +
` : null; let image = typeof(profile.image) == 'string' ? profile.image : profile.image?.link; diff --git a/apps/ssb/tf-tab-connections.js b/apps/ssb/tf-tab-connections.js index b51b4d7fe..9ee1a77ec 100644 --- a/apps/ssb/tf-tab-connections.js +++ b/apps/ssb/tf-tab-connections.js @@ -1,5 +1,6 @@ import {LitElement, html} from './lit-all.min.js'; import * as tfrpc from '/static/tfrpc.js'; +import {styles} from './tf-styles.js'; class TfTabConnectionsElement extends LitElement { static get properties() { @@ -12,6 +13,8 @@ class TfTabConnectionsElement extends LitElement { }; } + static styles = styles; + constructor() { super(); let self = this; @@ -55,7 +58,7 @@ class TfTabConnectionsElement extends LitElement { let self = this; return html`
  • - self._tunnel(connection.tunnel.id, connection.pubkey)} value="Connect"> + 📡
  • `; @@ -64,7 +67,7 @@ class TfTabConnectionsElement extends LitElement { render_broadcast(connection) { return html`
  • - tfrpc.rpc.connect(connection)} value="Connect"> + ${this.render_connection_summary(connection)}
  • @@ -78,7 +81,7 @@ class TfTabConnectionsElement extends LitElement { render_connection(connection) { return html` - tfrpc.rpc.closeConnection(connection.id)} value="Close"> + ${connection.tunnel !== undefined ? '🚇' : html`(${connection.host}:${connection.port})`}
      @@ -91,35 +94,35 @@ class TfTabConnectionsElement extends LitElement { render() { let self = this; return html` -

      New Connection

      -
      - +
      +

      New Connection

      + + +

      Broadcasts

      +
        + ${this.broadcasts.filter(x => x.address).map(x => self.render_broadcast(x))} +
      +

      Connections

      +
        + ${this.connections.filter(x => x.tunnel === undefined).map(x => html` +
      • ${this.render_connection(x)}
      • + `)} +
      +

      Stored Connections (WIP)

      +
        + ${this.stored_connections.map(x => html` +
      • + + + ${x.address}:${x.port} +
      • + `)} +
      +

      Local Accounts

      +
        + ${this.identities.map(x => html`
      • `)} +
      - tfrpc.rpc.connect(self.renderRoot.getElementById('code').value)} value="Connect"> -

      Broadcasts

      -
        - ${this.broadcasts.filter(x => x.address).map(x => self.render_broadcast(x))} -
      -

      Connections

      -
        - ${this.connections.filter(x => x.tunnel === undefined).map(x => html` -
      • ${this.render_connection(x)}
      • - `)} -
      -

      Stored Connections (WIP)

      -
        - ${this.stored_connections.map(x => html` -
      • - self.forget_stored_connection(x)} value="Forget"> - tfrpc.rpc.connect(x)} value="Connect"> - ${x.address}:${x.port} -
      • - `)} -
      -

      Local Accounts

      -
        - ${this.identities.map(x => html`
      • `)} -
      `; } } diff --git a/apps/ssb/tf-tab-query.js b/apps/ssb/tf-tab-query.js index 566aadc14..74721a52b 100644 --- a/apps/ssb/tf-tab-query.js +++ b/apps/ssb/tf-tab-query.js @@ -99,9 +99,9 @@ class TfTabQueryElement extends LitElement { } let self = this; return html` -
      - - self.search(self.renderRoot.getElementById('search').value)}> +
      + +
      Took ${this.duration / 1000.0} seconds.
      Executing...
      diff --git a/apps/ssb/tf-tab-search.js b/apps/ssb/tf-tab-search.js index a1c7fb92e..8a70cdc73 100644 --- a/apps/ssb/tf-tab-search.js +++ b/apps/ssb/tf-tab-search.js @@ -75,9 +75,9 @@ class TfTabSearchElement extends LitElement { } let self = this; return html` -
      - - self.search(self.renderRoot.getElementById('search').value)}> +
      + +
      `;