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.

jsync_demo_db_only.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. function jsyncdb_init_helper(){
  2. // clog("WS_HELPER")
  3. var fns = window.glob_u.ws.fns
  4. var room_name=glob_u.fns.get_room_name()
  5. let ws_protocol = "wss:"
  6. var port = location.port || "5000"
  7. location.protocol == "https:" ? "was already set to wss:" : ws_protocol = "ws:"
  8. var o = {
  9. include_participants_data:1,
  10. include_ws_channel_data:1, // required for participants_data to work
  11. // msto.participants and msto.ws_channels will be defined in either case so we don't need to handle cases where some users enable this and some don't
  12. AutoReconnect:false,
  13. // the following options attributes
  14. url:'wss://' + window.location.hostname +`/djc_srv/ws/chat/${room_name}`,
  15. url: `${ws_protocol}//${location.hostname}:5000/echo_c1${location.search}`,
  16. url: `${ws_protocol}//${location.hostname}:${port}/echo_c1${location.search}`,
  17. socket_name:"ws1",
  18. ord:glob_u.cb.ws,
  19. methods:{
  20. onmessage:fns.onmessage,
  21. onclose:fns.onclose,
  22. onerror:fns.onerror,
  23. onopen:fns.onopen,
  24. },
  25. fns:{
  26. },
  27. }
  28. var socket = window.glob_u.fns.connect_ws(o)
  29. // clog({socket})
  30. }
  31. // window.dev_flag = 1
  32. function set_rldi_int(){
  33. window?.rldi?.setint?.(400)
  34. }
  35. addEventListener("load",set_rldi_int)
  36. jsyncdb_init_helper()
  37. // window?.rldi?.setint?.(400)
  38. // window.rldi.setint(400)
  39. // clog("????")