gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit4bd111284bd11128MdEditor: the Table button's empty table is written as a real pipe table (empty cells), so it survives the source switch, a save and a reload (notes#7)mre4bd11128/components/modal/demo.hl

2.8 KB

  1. // demo.hl — `/modal`: four modals on one page, opened by the page's buttons, and the reason each one closed with. The page opens a
  2. // modal by its dialog's id (`showModal()`), closes one itself (`close('saved')`), and hears the modal's bubbling `close` on a wrapper element.
  3. parent '../main.hl'
  4. import Modal from './modal.hl'
  5. __title = 'Modal · Hybriel components'
  6. String lastClosed = 'nothing yet'
  7. String saved = ''
  8. Hybrid paragraphs = longText()
  9. longText() {
  10. out = []
  11. let i = 1
  12. while (i <= 20) { out.push('Paragraph ' + i + ': the page behind stays where it was while this scrolls.') i = i + 1 }
  13. return out
  14. }
  15. View {
  16. modalDemo { on close(e) { emit demoClosed(e) }
  17. h1 { "Modal" }
  18. p { class = "muted" "A window over the page: the page behind is dimmed and blocked. Esc, the × and a click on the dim background close it; the page is told how it was closed." }
  19. p { class = "modal-openers"
  20. button { type = "button" id = "open-info" "Information" on click(e) { emit demoOpen('info') } }
  21. button { type = "button" id = "open-confirm" "Confirm (OK / Cancel)" on click(e) { emit demoOpen('confirm') } }
  22. button { type = "button" id = "open-form" "A form (no background close)" on click(e) { emit demoOpen('form') } }
  23. button { type = "button" id = "open-long" "Long text" on click(e) { emit demoOpen('long') } }
  24. }
  25. p { "Last closed: " output { id = "modal-last" lastClosed } }
  26. p { "Saved name: " output { id = "modal-saved" saved } }
  27. p { a { id = "readme" href = "/modal/README.md" "README (how to use it)" } }
  28. Modal { id = "info" title = "Information"
  29. p { "A modal holds any content. Close it with the ×, Esc or a click on the dim background." }
  30. }
  31. Modal { id = "confirm" title = "Delete the draft?"
  32. p { "The draft will be gone. This cannot be undone." }
  33. footer {
  34. button { type = "button" value = "cancel" "Cancel" }
  35. button { type = "button" value = "ok" "Delete" }
  36. }
  37. }
  38. Modal { id = "form" title = "Your name" backdropClose = "false"
  39. p { "A click on the background does not close this one: only the ×, Esc, Cancel or Save." }
  40. p { label { "Name " input { id = "modal-name" type = "text" autocomplete = "off" } } }
  41. footer {
  42. button { type = "button" value = "cancel" "Cancel" }
  43. button { type = "button" id = "modal-save" "Save" on click(e) { emit demoSave(e) } }
  44. }
  45. }
  46. Modal { id = "long" title = "Long text"
  47. p { "The window keeps inside the screen; its content scrolls, the page behind does not." }
  48. for (t of paragraphs) { p { t } }
  49. }
  50. }
  51. }
  52. on demoOpen(id) { document.getElementById(id).showModal() }
  53. // "Save" is the page's own button: the page takes the name and closes the modal itself, with its own reason
  54. on demoSave(e) {
  55. saved = document.getElementById('modal-name').value
  56. document.getElementById('form').close('saved')
  57. }
  58. on demoClosed(e) { lastClosed = e.detail.id + ': ' + e.detail.reason }

Branches

Latest commits

  • 4bd11128MdEditor: the Table button's empty table is written as a real pipe table (empty cells), so it survives the source switch, a save and a reload (notes#7)mre
  • 7437e32bMdEditor draws its surface at once when claimed from server HTML: 1 ms mount animation, the first editor mounts all editors of the pagemre
  • 5de0264cRe-vendor onto Hybriel master acaceaf3 (set-day27b): binary, lib and plugins; exit 1 on a startup fault; .gitignore binmre
  • 79c77e7dMerge sb3-standby: components deploys through its standbymre
  • c5442043components: no jobs switch needed in the standbymre
  • 8d2fb24ccomponents: a standby container (port 45016, profile standby); deploy hands over through standby-swap.sh without a gapmre
  • c2834dd3Merge mr-fixes: media player state after a queue pick, Range handling, cover-less audio, accessibility labelsmre
  • 354fe3c6Media player: audio without a cover starts and shows its time (the mount tick sits on the seek bar, which every item has); the speed button names the current speed, the seek slider says its time in words; a gate page for the first render on cover-less audio and a fourth demo queue item without a covermre
  • ee4aee1eMedia player: a new queue item shows its own speed, mute, play state and time and starts when asked, also for two videos in a row; the media route reads suffix ranges and ignores range lists and garbage instead of answering 500; stronger gate checks (the 10 percent drag, the played bar, the queue tap)mre
  • 9a4f9b31Merge mp-player: media served from the committed filesmre
  • ab96e686Media route: serve the demo's media from the committed files in components/media-player (storage/ is not in git, the deploy gate found no files)mre
  • b2980734Merge mp-player: the media player (components/media-player), its demo and the media iconsmre
  • 1c41293eMediaPlayer: back / forward 10 s as replay / forward 10 icons (circular arrow with a 10), the play button keeps its surface background on audio and video, the media route's range end is a letmre
  • 9e1ab228MP: report, LOG line, STATUS entrymre
  • dd003e5dMediaPlayer: audio and video in one phone-first player (components/media-player), its demo /media-player with a queue, the media icons in components/icons, the demo's media files served with ranges (lib/media.hl), 35 gate checksmre
  • e54f83adMdEditor: text typed before the editor is built is kept (the build takes it in once, the input handler no longer writes it to the field first), tickets#35mre
  • 8c920932gate: the 11 old drop-zone checks now test the one-box pick mode (drop anywhere in the box, Choose files button inside it, no drop zone)mre
  • 626de199MdEditor: copy and cut put the selection's Markdown on the clipboard, a clipboard with HTML only pastes its text, gate checks for copy, cut and paste (components#20)mre
  • 5228126dUX: components synced from the tickets/layouts UX mission (comments: State select in the footer and button words; files-upload: one-box pick mode; modal: footer rule for its own footer). WIP: the gate's #18 pick-mode checks still expect the old drop zone (11 fail), see the UX2 reportmre
  • 0a9216fbMdEditor: a Table button in the toolbar, a typed pipe row fills the cells, tables take the page theme's look; gate checks updated for 12 toolbar buttonsmre