layouts
All repositories: gitoria
2.5 KB
// components/showcase/comments.hl — `/components/comments`: the comments block, themed (the component is the verbatim copy in// components/comments/, which draws every text with the verbatim md-editor in readonly mode). The thread is the page's own copy// (lib/comments.hl): post, edit, delete and like change it, nothing is stored. "You are" switches the user.parent '../main.hl'import SiteHeader from '../site-header.hl'import SiteSidebar from '../site-sidebar.hl'import ContentFirst from '../../theme/shell/content-first.hl'import TheComments from '../comments/comments.hl'import { mockThread, withNew, withEdit, without, withLike, shownFiles } from '../../lib/comments.hl'__title = 'Comments · WorldAPI layouts'Hybrid thread = mockThreadString me = 'alice'String told = 'nothing yet'Number seq = 0posted = (text, files) => {seq = seq + 1thread = withNew(thread, me, text, seq, shownFiles(files))told = files.length > 0 ? 'post with ' + files.length + ' files' : 'post'}edited = (id, text) => {thread = withEdit(thread, id, text)told = 'edit ' + id}deleted = (id) => {thread = without(thread, id)told = 'delete ' + id}liked = (id) => {thread = withLike(thread, id)told = 'like ' + id}View {showComments {SiteHeader { current = "/components/comments" }ContentFirst {SiteSidebar { current = "/components/comments" }main {h1 { "Comments" }p { class = "muted" "A thread: avatar, name, time, “edited” with the earlier versions, the text as Markdown, a like, and Edit / Delete on your own comments. Write a new one below in the Markdown editor; attach files by choosing, dropping or pasting them (they show as rows: the showcase stores nothing, so no link)." }p { class = "row" role = "group" 'aria-label' = "Act as" "You are:"button { type = "button" id = "as-alice" "alice" on click(e) { emit showAs('alice') } }button { type = "button" id = "as-bob" "bob" on click(e) { emit showAs('bob') } }button { type = "button" id = "as-nobody" "nobody" on click(e) { emit showAs('') } }"now " output { id = "comments-me" me }}TheComments { comments = thread user = me onPost = posted onEdit = edited onDelete = deleted onLike = liked attach = "true" maxFileSize = 2097152 signInText = "Choose a user above to comment." }p { class = "muted" "The page was told: " output { id = "comments-told" told } }p { class = "readme links" a { href = "/read/readme-comments" "README of the component (how an app uses it)" } }}}}}on showAs(who) { me = who }
Branches
Latest commits
- 3dc27d78mail-demo: format Style with nested rules and bare mediamre
- cf9648afhome: format Style with nested rules and bare mediamre
- 846a6242user-menu: format Style with nested rules and bare mediamre
- 4d58708cthree-pane: format Style with nested rules and bare mediamre
- 0bbfc553main-menu: format Style with nested rules and bare mediamre
- 7755199dlist-first: format Style with nested rules and bare mediamre
- 35199303content-first: format Style with nested rules and bare mediamre
- 00f6e698app-sidebar: format Style with nested rules and bare mediamre
- bb2f29c9app-header: format Style with nested rules and bare mediamre
- 3aca2d7fSync components from 8176eb1 with reviewed nested stylesmre
- 87e4003dRe-vendor layouts to Hybriel set day35mre
- d8628cfflayouts: a startup error prints its message before exit 1 (hybriel#247)mre
- 180fd76elayouts: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows; empty Table-button table; tickets#49, notes#5)mre
- a3eda8afRe-vendor Hybriel master 7a684920 (binary 74ab3715): plugins whole, startup fault exits 1; files-upload gate 340/0mre
- 025d5880WIP re-vendor Hybriel set-day27b (a9712e61, master f5ff97bf): plugins whole, startup fault exits 1; NOT deployable: files-upload emit refused (see .scratch/rv27-upload)mre
- 42183a71Merge sb3-standby: layouts deploys through its standbymre
- 408de1f2layouts: no jobs switch needed in the standbymre
- 0b85f57elayouts: a standby container (port 45019, profile standby); deploy hands over through standby-swap.sh without a gapmre
- 31e40b8bMerge dm3-media: range handling in the layouts media routemre
- 856dcacbLayouts media route: read suffix ranges and ignore range lists and garbage, like the components route (the layouts copy still answered 416 for the last bytes)mre