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.

jsyncdb_index_v3.html 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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="/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. <!--
  39. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  40. <script src="/ign/j7/rldjs/rldjs5.js?v=139"></script>
  41. <script class="rld rrld" src="/ign/rls.js?<!--#echo var='rtqs'-->"></script>
  42. <script class="rld rrld_u" src="/ign/rls_u.js?<!--#echo var='rtqs'-->"></script>
  43. <script class="rld" src="/ign/indx/jsyncdb/jsync_test2.js"></script>
  44. <script class="win_keys" src="/ign/j9/dbg/win_keys.js?c=00x"></script>
  45. -->
  46. <!-- <script class="rld" type="module" src="/ign/indx/jsyncdb/jsync_lib.js"></script> -->
  47. <script class="rld" src="/jsync_lib.js"></script>
  48. <script class="rld" src="/jsync_demo.js"></script>
  49. <style type="text/css">
  50. </style>
  51. <link class="rld" rel="stylesheet" href="/jsync_demo.css">
  52. </head>
  53. <body>
  54. <div id="root_div">
  55. <span class="iblock_2"></span>
  56. <span class="iblock_1"></span>
  57. </div>
  58. <div id="oops_i_lied"><div class="code_container">
  59. in this demo the global variable msto_prx is the root of the database.
  60. we will use the global variable msto because it is a little nicer (has shortcuts to the parts you have exclusive write permissions to).
  61. <b>open devtools on two pages connected to the same database to begin</b>
  62. to get a copy of the datastructure without the Proxies:
  63. <code>jc(msto)
  64. </code> set values<code>
  65. msto.key = "value"
  66. msto.example = {
  67. str:"these are supported data types",
  68. number:12.7,
  69. arr:["val0",1,{z:1},["a","b"]],
  70. obj:{d:"there is a max depth of 15"},
  71. str2:"null isn't fully supported yet and can break things",
  72. }
  73. </code>
  74. you can paste this shorter statement to avoid newlines in your devtools history :)
  75. <code>msto.example = {str:"str_val",number:12.7,arr:["val0",1,{z:2},["a","b"]],obj:{d:"depth of 2?"},str2:"yet another string",}</code>
  76. get values
  77. <code>
  78. msto.example.arr[0]
  79. // "val0"
  80. msto.example.arr[2]
  81. // {z:2}</code>
  82. the datastructure should have syncronized msto & msto_prx on both webpages
  83. <span class="db_desc">
  84. values can be strings,numbers,objects or arrays
  85. null and undefined are not supported yet
  86. local changes are immediate
  87. and deletes are local only (for now)
  88. after a value is set is pushed to everyone else who is connected
  89. msto.ws_channels and msto.participants are write protected
  90. msto.my_data links to the path you have write access to as does msto.my_channel
  91. participants and channels write only data are automatically deleted after they leave
  92. the data is not persistent it exists in the webpages of those connected
  93. if everyone leaves a room the datastructure is destroyed
  94. </span></div></div>
  95. </body>
  96. </html>