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.

index_v5s.html 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <html itemscope itemtype="http://schema.org/Product" prefix="og: http://ogp.me/ns#" xmlns="http://www.w3.org/1999/html">
  2. <head>
  3. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
  4. <!-- <script class="win_keys2 win_keys_glob_attrs" src="/ign/j9/dbg/glob_attrs.js?c=00x"></script> -->
  5. <script src="/shared_libs/jquery-3.5.1.min.js"></script>
  6. <!-- <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script> -->
  7. <!--
  8. <script class="rld" src="jsync_dep.js"></script>
  9. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  10. <script class="rld" src="jsync_ord.js"></script>
  11. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  12. <script class="rld" src="jsync_ws.js"></script>
  13. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  14. <script class="rld" src="jsync_sto.js"></script>
  15. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  16. <script class="rld" src="jsync_init.js"></script>
  17. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  18. <script class="rld" src="jsync_test.js"></script>
  19. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  20. <script class="rld" src="jsync_demo.js"></script>
  21. -->
  22. <!--
  23. <script class="rld" src="/ign/indx/jsyncdb/jsync_dep.js"></script>
  24. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  25. <script class="rld" src="/ign/indx/jsyncdb/jsync_ord.js"></script>
  26. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  27. <script class="rld" src="/ign/indx/jsyncdb/jsync_ws.js"></script>
  28. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  29. <script class="rld" src="/ign/indx/jsyncdb/jsync_sto.js"></script>
  30. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  31. <script class="rld" src="/ign/indx/jsyncdb/jsync_init.js"></script>
  32. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  33. <script class="rld" src="/ign/indx/jsyncdb/jsync_test.js"></script>
  34. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  35. <script class="rld" src="/ign/indx/jsyncdb/jsync_demo.js"></script>
  36. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  37. -->
  38. <!-- <script class="rld" type="module" src="/ign/indx/jsyncdb/jsync_lib.js"></script> -->
  39. <!-- <script class="rld" src="/jsync_lib.js"></script> -->
  40. <script class="rld" src="/jsync_dep.js"></script>
  41. <script class="rld" src="/jsync_ord.js"></script>
  42. <script class="rld" src="/jsync_ws.js"></script>
  43. <script class="rld" src="/jsync_sto.js"></script>
  44. <script class="rld" src="/jsync_init.js"></script>
  45. <script class="rld" src="/jsync_test.js"></script>
  46. <!-- <script class="rld" src="/jsync_demo.js"></script> -->
  47. <script class="rld" src="/jsync_demo.js"></script>
  48. <script class="rld" src="/jsync_2nd_db.js"></script>
  49. <script class="rld" src="/jsync_test2.js"></script>
  50. <script class="rld" src="/ev_inc.js"></script>
  51. <style type="text/css">
  52. </style>
  53. <link class="rld" rel="stylesheet" href="/jsync_demo.css">
  54. <link class="rld" rel="stylesheet" href="/ev_inc.css">
  55. <script type="text/javascript">
  56. function hide_demo(argument) {
  57. // clog("hide_demo")
  58. $(".show_demo").removeClass("show_demo").addClass("hide_demo")
  59. }
  60. function show_demo(argument) {
  61. // clog("show_demo")
  62. // body...
  63. $(".hide_demo").removeClass("hide_demo").addClass("show_demo")
  64. }
  65. function evl_btn_h(event,node){
  66. _evl_btn_h(...arguments)
  67. }
  68. function eval_h(event,node){
  69. _eval_h(...arguments)
  70. }
  71. </script>
  72. </head>
  73. <body>
  74. <div id="root_div">
  75. <span class="iblock_2"></span>
  76. <span class="iblock_1"></span>
  77. </div>
  78. <div class="json_container show_demo">
  79. <button class="demo_hide_btn" onclick="hide_demo()">hide demo</button>
  80. <button class="demo_show_btn" onclick="show_demo()">show demo</button><br>
  81. <span class="color_legend">
  82. <span class="wperm2">green: </span>you have write access<br>
  83. <span class="wperm">orange: </span>you don't have write access<br>
  84. <span >black: </span>everyone has write access<br>
  85. </span>
  86. <!-- <div class="db_disp"></div> -->
  87. <code class="db_disp"></code>
  88. &#8595; eval m.a={} {enter} &#8595;
  89. <!-- <br> <textarea class="eval_txt" onkeypress="eval_h(event,this)"></textarea> -->
  90. <span class="evl_cnt">
  91. <br> <textarea class="eval_txt" onkeyup="evl_btn_h(event,this)" data-ev_type="keyup"></textarea>
  92. <span class="btn_cnt">
  93. <button class="evl_btn evl_btn1" data-ev_type="b" data-btn-type="b" onclick="evl_btn_h(event,this)"><</button>
  94. <button class="evl_btn evl_btn2" data-ev_type="f" data-btn-type="f" onclick="evl_btn_h(event,this)">></button>
  95. <button class="evl_btn evl_btn3" data-ev_type="e" data-btn-type="e" onclick="evl_btn_h(event,this)">eval</button>
  96. </span>
  97. </span>
  98. <br>
  99. <code class="eval_result"></code>
  100. </div>
  101. <div id="oops_i_lied"><div class="code_container">
  102. in this demo the global variable msto_prx is the root of the database.
  103. we will use the global variable msto because it is a little nicer (has shortcuts to the parts you have exclusive write permissions to).
  104. <b>open devtools on two pages connected to the same database to begin</b>
  105. to get a copy of the datastructure without the Proxies:
  106. <code>jc(msto)</code><div class="hidden-boundary"></div>
  107. set values<code>
  108. msto.key = "value"<div class="hidden-boundary"></div>
  109. msto.example = {
  110. str:"these are supported data types",
  111. number:12.7,
  112. bool:true,
  113. arr:["val0",1,{z:1},["a","b"]],
  114. obj:{d:"there is a max depth of 15"},
  115. str2:"null isn't fully supported yet and can break things",
  116. }
  117. </code>
  118. you can paste this shorter statement to avoid newlines in your devtools history :)
  119. <code>msto.example={str:"str_val",bool:true,number:12.7,arr:["val0",1,{z:2},["a","b"]],obj:{d:"depth 2?"},str2:"another string"}</code><div class="hidden-boundary"></div>
  120. get values
  121. <code>
  122. msto.example.arr[0]<div class="hidden-boundary"></div>
  123. // "val0"
  124. msto.example.arr[2]<div class="hidden-boundary"></div>
  125. // {z:2}</code>
  126. the datastructure should have syncronized msto & msto_prx on both webpages
  127. <span class="db_desc">
  128. values can be strings, numbers, booleans, objects or arrays
  129. null and undefined are not supported yet
  130. local changes are immediate
  131. and deletes are local only (for now)
  132. after a value is set is pushed to everyone else who is connected
  133. msto.ws_channels and msto.participants are write protected
  134. msto.my_data links to the path you have write access to as does msto.my_channel
  135. participants and channels write only data are automatically deleted after they leave
  136. the data is not persistent it exists in the webpages of those connected
  137. if everyone leaves a room the datastructure is destroyed
  138. </span></div></div>
  139. </body>
  140. </html>