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

27
LINES

< > BotCompany Repo | #1007761 // Instant Chat - now really without delay

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (8405L/56K/185K).

!7

static double timeout = 60; // 60 seconds safety
static double refreshDelay = 0; // 0 seconds to refresh

static L<S> data = synchroList(ll("Start."));

html {
  S add = params.get("add");
  if (nempty(add) && neq(last(data), add)) data.add(add);
  
  int i = toInt(params.get("i"));
  int n;
  long start = sysNow();
  while (l(data) == i
    && licensed()
    && sysNow() < start+timeout*1000)
    sleep(10);
  if ((n = l(data)) < i) i = 0;
  ret hrefresh(refreshDelay, selfLink(i := n))
    + hcenter(
        join("<br>", map(f dynamize, cloneList(data)))
      + p("Bla bla here:", style := "margin-top: 40px")
      + hform(htextinput("add", "", autofocus := 1, style := "text-align: center") + " " + hsubmit("Say"))
    );
    
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007761
Snippet name: Instant Chat - now really without delay
Eternal ID of this version: #1007761/5
Text MD5: 0fed4f48f648b103697dfdc6a0235b7b
Transpilation MD5: 10d75685b21caf50d6867ee5fe36f4af
Author: stefan
Category: javax / a.i. / html
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-04 00:38:26
Source code size: 766 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 443 / 900
Version history: 4 change(s)
Referenced in: [show references]