~ev/tildeprotocol

18f822805a70ed8dd72f7839a147db29a3a6fc83 — Ev Bogue 2 years ago 47d926f
render src no matter if message opens orn ot
1 files changed, 13 insertions(+), 11 deletions(-)

M render.js
M render.js => render.js +13 -11
@@ 1,23 1,25 @@
function render (src, keys) {
  var div = h('div', {classList: 'message'})
  open(src, keys).then(msg => {
    var tildes = msg.split('~')
    if (msg) {
      var tildes = msg.split('~')

    var timestamp = human(new Date(Number(tildes[tildes.length - 3])))
      var timestamp = human(new Date(Number(tildes[tildes.length - 3])))

    div.appendChild(h('span', [tildes[tildes.length - 4] + ' ']))
      div.appendChild(h('span', [tildes[tildes.length - 4] + ' ']))

    div.appendChild(h('span', {classList: 'right'}, [timestamp]))
      div.appendChild(h('span', {classList: 'right'}, [timestamp]))

    var rest = h('span')
      var rest = h('span')

    for (var i = 0; i < tildes.length -4; i++) {
      rest.appendChild(h('span', [tildes[i]]))
    }
      for (var i = 0; i < tildes.length -4; i++) {
        rest.appendChild(h('span', [tildes[i]]))
      }

    div.appendChild(h('span', [rest]))
    div.appendChild(h('pre', ['~' + tildes[tildes.length - 2] + '~' + tildes[tildes.length - 1]]))
      div.appendChild(h('span', [rest]))
      //div.appendChild(h('pre', ['~' + tildes[tildes.length - 2] + '~' + tildes[tildes.length - 1]]))
    } 
  })
  
  div.appendChild(h('pre', [src]))
  return div
}