The frontend/UI server, written in JS using the MarkoJS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.9 KiB

  1. <div if(!state.removed) class=["post", component.kindClass("pk-"), state.multipart ? "multipart" : null, state.anchored ? "anchored" : null]>
  2. <a class="anchor" id=input.post.id />
  3. <div class="post-meta-row">
  4. <div class="options color-menu">
  5. <a on-click("link") href=("#" + input.post.id) class="color-menu">Link</a>
  6. <if-permitted user=input.user permission="post.move">
  7. <a on-click("move", -1, true)>Up</a>
  8. <a on-click("move", +1, true)>Down</a>
  9. </if-permitted>
  10. <if-permitted user=input.user permission="post.edit">
  11. <a on-click("open", "edit") >Edit</a>
  12. </if-permitted>
  13. <if-permitted user=input.user permission="post.remove">
  14. <a on-click("open", "remove")>Remove</a>
  15. </if-permitted>
  16. </div>
  17. <post-meta kind="timestamp" value=input.post.time />
  18. <post-meta kind="nick" class=("pk-"+input.post.kind) value=input.post.nick />
  19. </div>
  20. <div if(input.post.kind.startsWith("annotation.")) class="post-body" >
  21. <annotation level=(input.post.kind.substring(11))>
  22. <markdown class="post-content" source=state.text />
  23. </annotation>
  24. </div>
  25. <div if(input.post.kind === "scene") class="post-body color-text">
  26. <markdown class="post-content post-scene" source=state.text />
  27. </div>
  28. <div if(input.post.kind === "action") class="post-body color-text">
  29. $ const prefix = ((!state.multipart || state.prevWasText) ? state.shortName + state.nameSuffix + " " : "");
  30. <markdown class="post-content post-action" source=(prefix + state.text) />
  31. </div>
  32. <div if(input.post.kind === "text") class="post-body color-text">
  33. <markdown class="post-content post-text" source=state.text />
  34. </div>
  35. <remove-post-modal enabled=(state.modal === "remove") post=input.post on-close("close") on-remove("remove") />
  36. <edit-post-modal enabled=(state.modal === "edit") post=input.post on-close("close") on-edited("edited") />
  37. </div>