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

18
LINES

< > BotCompany Repo | #1014681 // subBot_html_webSocketBasedLogView

JavaX fragment (include)

static S subBot_html_webSocketBasedLogView() {
  ret loadJQuery()
    + hpre("", id := 'logView)
    + hreconnectingWebSockets()
    + hjs_htmlencode()
    + hjavascript([[
      var ws = new ReconnectingWebSocket("${URI}");
      ws.onmessage = function(event) {
        var d = event.data;
        if (d == "clear")
          $("#logView").html("");
        else {
          $("#logView").append(htmlencode(d.substring(1)));
          window.scrollBy(0, 1000000); // keeps X coordinate
        }
      };
    ]].replace("${URI}", subBot_myWebSocketURI());
}

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: #1014681
Snippet name: subBot_html_webSocketBasedLogView
Eternal ID of this version: #1014681/2
Text MD5: 5d4aad5e5d75324f4f147429a574e0d0
Author: stefan
Category: javax / web
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-30 00:21:24
Source code size: 576 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 395 / 419
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)