Tooling around with docs. Show timestamps as relative ('3 hours ago').
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3810 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
ea92fbdcea
commit
bf7d5c34f6
@ -1 +1 @@
|
|||||||
{"type":"tildefriends-app","files":{"app.js":"&WCq6ssQedT5denXPXlz2BswPD6hmt++EmWIMIDUMurA=.sha256","index.md":"&XWx2BFiunp94ESm8w3TiEr4HcCtegVojYxMFLV8DSow=.sha256","todo.md":"&4ipkgEn0imigLYwIdSK3KuZY2/ERqfzrWlw9OocIJWc=.sha256","structure.md":"&T+CBfT9XP6ooKFvD1ZCI9hsutqsNIamfBxtAho0HtlU=.sha256","guide.md":"&SgnGL0+rjetY2o9A2+lVRbNvHIkqKwMnZr9gXWneIlc=.sha256"}}
|
{"type":"tildefriends-app","files":{"app.js":"&WCq6ssQedT5denXPXlz2BswPD6hmt++EmWIMIDUMurA=.sha256","index.md":"&5EeOHUkDadC+lJsDsKXbfrVDQdePyOHZ7KwaJtR5mrs=.sha256","todo.md":"&U6hrQ6cfJ6+Uvg+wA7ahpCQaM2XiYXKjZUOz2iZDSGM=.sha256","structure.md":"&T+CBfT9XP6ooKFvD1ZCI9hsutqsNIamfBxtAho0HtlU=.sha256","guide.md":"&SgnGL0+rjetY2o9A2+lVRbNvHIkqKwMnZr9gXWneIlc=.sha256","id_refactor.md":"&RCGnByvk25SuPQ5wywVwgOhAFIxOeoUm17sD24XSSZw=.sha256"}}
|
17
apps/cory/docs/id_refactor.md
Normal file
17
apps/cory/docs/id_refactor.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# ID Refactor
|
||||||
|
[Back to index](#index)
|
||||||
|
|
||||||
|
## Goals
|
||||||
|
- no way to get private key in javascript
|
||||||
|
- ssb.c syncs/broadcasts/... efficiently for everybody
|
||||||
|
|
||||||
|
## Schema
|
||||||
|
- separate table to discourage leakage
|
||||||
|
- `CREATE TABLE identities (user TEXT, public TEXT, secret TEXT);'
|
||||||
|
|
||||||
|
## API
|
||||||
|
- `ssb.createIdentity()` -> `id`
|
||||||
|
- `ssb.getIdentities()` => `[id, ...]`
|
||||||
|
- `ssb.deleteIdentity(id)`
|
||||||
|
- `ssb.post(id, ...)`
|
||||||
|
- `ssb.appendMessage(id, ...)`
|
@ -7,4 +7,5 @@ and run code.
|
|||||||
|
|
||||||
- [Structure](#structure)
|
- [Structure](#structure)
|
||||||
- [Guide](#guide)
|
- [Guide](#guide)
|
||||||
- [TODO](#todo)
|
- [TODO](#todo)
|
||||||
|
- [ID Refactor](#id_refactor)
|
@ -4,9 +4,7 @@
|
|||||||
## MVP2
|
## MVP2
|
||||||
- update README
|
- update README
|
||||||
- update docs
|
- update docs
|
||||||
- auto-populate data on initial launch
|
|
||||||
- audit + document API exposed to apps
|
- audit + document API exposed to apps
|
||||||
- installable apps
|
|
||||||
- emoji reaction picker
|
- emoji reaction picker
|
||||||
- logging to browser
|
- logging to browser
|
||||||
- fix weird HTTP warnings
|
- fix weird HTTP warnings
|
||||||
@ -21,20 +19,23 @@
|
|||||||
- expose loads of stats
|
- expose loads of stats
|
||||||
- package standalone executable
|
- package standalone executable
|
||||||
- build for windows
|
- build for windows
|
||||||
- make the docker image good / test it / use it
|
|
||||||
- make a better connections API
|
- make a better connections API
|
||||||
- tf account timeout why
|
- tf account timeout why
|
||||||
- attribute blob wants to messages
|
- attribute blob wants to messages
|
||||||
- keep working on good error feedback
|
|
||||||
- installable apps (bring back an app message?)
|
- installable apps (bring back an app message?)
|
||||||
- make a cool independent app
|
- make a cool independent app
|
||||||
- editor without app iframe
|
- editor without app iframe
|
||||||
- indicate when workspace differs from installed
|
- indicate when workspace differs from installed
|
||||||
- file upload widget
|
|
||||||
- / => Something good.
|
- / => Something good.
|
||||||
- administrators config
|
- administrators config
|
||||||
- leaking imports / exports
|
|
||||||
- confirm posting all new messages
|
- confirm posting all new messages
|
||||||
|
|
||||||
|
## Maybe Done
|
||||||
|
- auto-populate data on initial launch
|
||||||
|
- make the docker image good / test it / use it
|
||||||
|
- leaking imports / exports
|
||||||
|
- file upload widget
|
||||||
|
- keep working on good error feedback
|
||||||
|
|
||||||
## Done
|
## Done
|
||||||
- update LICENSE
|
- update LICENSE
|
@ -1 +1 @@
|
|||||||
{"type":"tildefriends-app","files":{"app.js":"&iqkvaTLEbxeintzHb07jiFncdg3N1aS8h8ZNUzy7MZI=.sha256","index.html":"&ko7qv1Ihzmw8ibXr0RinyzNBc2xNzcGDQDPO9X3JAAQ=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&DdJwZYEo7AqFyutYMvEjykoVXxdHVog0UXye6Sbo0TU=.sha256","tf-message.js":"&wp4y+HfumjPpbG19989uy4CoGh4telO0xv3zHaNp3sQ=.sha256","tf.js":"&/yKh5E/PLaK/M3tivdldiEDnpeYQYyuLHWjjdM/QpxE=.sha256","commonmark.min.js":"&EP0OeR9zyLwZannz+0ga4s9AGES2RLvvIIQYHqqV6+k=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256","tf-shared.js":"&+qPP3g4CAUlkt8K4iBCZ+F5Fy6N7fu6MggvSVss2juE=.sha256"}}
|
{"type":"tildefriends-app","files":{"app.js":"&iqkvaTLEbxeintzHb07jiFncdg3N1aS8h8ZNUzy7MZI=.sha256","index.html":"&ko7qv1Ihzmw8ibXr0RinyzNBc2xNzcGDQDPO9X3JAAQ=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&DdJwZYEo7AqFyutYMvEjykoVXxdHVog0UXye6Sbo0TU=.sha256","tf-message.js":"&wyqn+8yC3O/m6LfZrR5RIfd6+g+rVCUaPCPT3FcQsPg=.sha256","tf.js":"&/yKh5E/PLaK/M3tivdldiEDnpeYQYyuLHWjjdM/QpxE=.sha256","commonmark.min.js":"&EP0OeR9zyLwZannz+0ga4s9AGES2RLvvIIQYHqqV6+k=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256","tf-shared.js":"&+qPP3g4CAUlkt8K4iBCZ+F5Fy6N7fu6MggvSVss2juE=.sha256"}}
|
@ -16,7 +16,27 @@ Vue.component('tf-message', {
|
|||||||
} catch {
|
} catch {
|
||||||
return this.message.content;
|
return this.message.content;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
timestamp_relative: function() {
|
||||||
|
var units = [
|
||||||
|
{value: 1, name: 'milliseconds'},
|
||||||
|
{value: 1000, name: 'seconds'},
|
||||||
|
{value: 1000 * 60, name: 'minutes'},
|
||||||
|
{value: 1000 * 60 * 60, name: 'hours'},
|
||||||
|
{value: 1000 * 60 * 60 * 24, name: 'days'},
|
||||||
|
{value: 1000 * 60 * 60 * 24 * 7, name: 'weeks'},
|
||||||
|
{value: 1000 * 60 * 60 * 24 * 30, name: 'months'},
|
||||||
|
{value: 1000 * 60 * 60 * 24 * 365, name: 'years'},
|
||||||
|
];
|
||||||
|
var v = new Date().valueOf() - this.message.timestamp;
|
||||||
|
var result = null;
|
||||||
|
for (let unit of units) {
|
||||||
|
if (v >= unit.value) {
|
||||||
|
result = Math.round(v / unit.value) + ' ' + unit.name + ' ago';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
markdown: markdown,
|
markdown: markdown,
|
||||||
@ -79,8 +99,11 @@ Vue.component('tf-message', {
|
|||||||
</h3>
|
</h3>
|
||||||
<template v-if="message.author">
|
<template v-if="message.author">
|
||||||
<div style="font-size: x-small">
|
<div style="font-size: x-small">
|
||||||
{{new Date(message.timestamp)}}
|
{{timestamp_relative}}
|
||||||
<md-tooltip>{{message.id}}</md-tooltip>
|
<md-tooltip style="height: auto">
|
||||||
|
<div>{{new Date(message.timestamp)}}</div>
|
||||||
|
<div>{{message.id}}</div>
|
||||||
|
</md-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-toolbar-section-end">
|
<div class="md-toolbar-section-end">
|
||||||
<md-menu>
|
<md-menu>
|
||||||
|
Loading…
Reference in New Issue
Block a user