Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

29
LINES

< > BotCompany Repo | #1021156 // Input Field [Web Bot]

JavaX module [tags: butter use-pretranspiled] - homepage

Download Jar. Libraryless. Click here for Pure Java version (10588L/71K/237K).

!7

static int maxLineLength = tenK();

concept Dialog {
  new L<Entry> entries;
}

concept Entry {
  S text;
  S ip;
}

p { db(); }

html {
  S text = mapGet text(params);
  Dialog dialog = null;
  if (nempty(text)) {
    text = shorten(text, maxLineLength);
    dialog = cnew(Dialog);
    dialog.entries.add(cnew(Entry, ip := subBot_clientIP(), +text));
    dialog.change();
  }
  ret hhtml_head_title_body("Talk",
    hcommentIfNempty(dialog != null ? dialog.id : null)
    + hfullcenter(hform(htextfield('text, autofocus := true, style := "width: 400px; text-align: center")))
  );
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021156
Snippet name: Input Field [Web Bot]
Eternal ID of this version: #1021156/10
Text MD5: f41c9314bbc98875744e7dbf2a828616
Transpilation MD5: 9394de07bb8d3a846e6ae9233b26e8f5
Author: stefan
Category: javax / web
Type: JavaX module
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-31 06:01:27
Source code size: 615 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 298 / 1436
Version history: 9 change(s)
Referenced in: [show references]