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.

39 lines
2.1 KiB

  1. <div if(!state.removed) class=["post", component.kindClass("pk-"), state.multipart ? "multipart" : null, state.anchored ? "anchored" : null, state.dark ? "dark" : 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. <irc-caret-notation class="post-content" source=state.text />
  23. </annotation>
  24. </div>
  25. <div if(input.post.kind === "chars") class="post-body color-menu" >
  26. <p><em>Character hint: ${input.post.text}</em></p>
  27. </div>
  28. <div if(input.post.kind === "scene") class="post-body color-text">
  29. <irc-caret-notation class="post-content post-scene" source=state.text />
  30. </div>
  31. <div if(input.post.kind === "action") class="post-body color-text">
  32. $ const prefix = ((!state.multipart || state.prevWasText) ? state.shortName + state.nameSuffix + " " : "");
  33. <irc-caret-notation class="post-content post-action" source=(prefix + state.text) />
  34. </div>
  35. <div if(input.post.kind === "text") class="post-body color-text">
  36. <irc-caret-notation class="post-content post-text" source=state.text />
  37. </div>
  38. <remove-post-modal enabled=(state.modal === "remove") post=input.post on-close("close") on-remove("remove") />
  39. <edit-post-modal enabled=(state.modal === "edit") post=input.post on-close("close") on-edited("edited") />
  40. </div>