Roderic Day преди 5 години
родител
ревизия
8dbbba905d
променени са 1 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. +9
    -1
      pico.js

+ 9
- 1
pico.js Целия файл

@@ -373,13 +373,21 @@ const Chat = {
const S = `0${dt.getSeconds()}`.slice(-2)
return `${H}:${M}:${S}`
},
outboundLinks: (vnode) => {
vnode.dom.querySelectorAll('a').forEach(anchor => {
anchor.target = '_blank'
anchor.rel = 'noopener'
})
},
view() {
return m('.chat',
m('.posts',
State.posts.map(post => m('.post', {oncreate: scrollIntoView},
m('.ts', Chat.prettifyTime(post.ts)),
m('.source', post.source || '~'),
m('.text', m.trust(DOMPurify.sanitize(marked(post.value)))),
m('.text', {oncreate: Chat.outboundLinks},
m.trust(DOMPurify.sanitize(marked(post.value)))
),
)),
),
m(TextBox),

Loading…
Отказ
Запис