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_v1.html 4.7KB

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