| grid-area: posts; | grid-area: posts; | ||||
| overflow-y: scroll; | overflow-y: scroll; | ||||
| } | } | ||||
| .post .text p { | |||||
| margin: 0; | |||||
| } | |||||
| .post .text p:first-child { | |||||
| display: inline; | |||||
| } | |||||
| .actions { | .actions { | ||||
| grid-area: actions; | grid-area: actions; | ||||
| display: grid; | display: grid; |
| <html> | <html> | ||||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||||
| <script src="https://unpkg.com/mithril/mithril.min.js"></script> | <script src="https://unpkg.com/mithril/mithril.min.js"></script> | ||||
| <script src="https://unpkg.com/marked/marked.min.js"></script> | |||||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.0.2/purify.min.js"></script> | |||||
| <script src="/pico.js" defer></script> | <script src="/pico.js" defer></script> | ||||
| <link rel="stylesheet" href="/pico.css" /> | <link rel="stylesheet" href="/pico.css" /> | ||||
| <body>PicoChat requires JS</body> | <body>PicoChat requires JS</body> |
| rpcs: {}, | rpcs: {}, | ||||
| media: {}, | media: {}, | ||||
| } | } | ||||
| const markedOptions = { | |||||
| breaks: true, | |||||
| } | |||||
| marked.setOptions(markedOptions) | |||||
| /* | /* | ||||
| * | * | ||||
| State.posts.map(post => m('.post', {oncreate: scrollIntoView}, | State.posts.map(post => m('.post', {oncreate: scrollIntoView}, | ||||
| m('.ts', prettyTime(post.ts)), | m('.ts', prettyTime(post.ts)), | ||||
| m('.source', post.source || '~'), | m('.source', post.source || '~'), | ||||
| m('.text', post.value), | |||||
| m('.text', m.trust(DOMPurify.sanitize(marked(post.value)))), | |||||
| )), | )), | ||||
| ), | ), | ||||
| m('.actions', | m('.actions', |