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.

34 lines
552 B

  1. const moment = require("moment")
  2. const {postApi} = require("../../../../../rpdata/api/Post")
  3. module.exports = class {
  4. onCreate(input) {
  5. this.state = {
  6. error: null,
  7. clicked: false,
  8. timestamp: moment(input.post.time).format("YYYY-MM-DD HH:mm:ss")
  9. }
  10. }
  11. change(key, ev) {
  12. this.state.values[key] = ev.target.value
  13. }
  14. open() {
  15. }
  16. close() {
  17. this.emit("close")
  18. }
  19. doIt() {
  20. if (this.state.clicked) {
  21. return
  22. }
  23. this.state.clicked = true
  24. this.emit("remove")
  25. this.emit("close")
  26. }
  27. }