SEA + GUN alpha working!!! With PANIC test too!

This commit is contained in:
Mark Nadal 2017-10-21 10:36:59 -07:00
parent e0a9ef45f3
commit a1ac8df607

View File

@ -68,28 +68,8 @@
</div>
<script src="/jquery.js"></script>
<script src="/gun.js"></script>
<!--
<script src="/gun/lib/cryptomodules.js" type="text/javascript"></script>
<script src="/gun/sea.js"></script>
-->
<script>
var gun = Gun(location.origin+'/gun');
var user = gun.user && gun.user();
if(user){
// 1st: call create. 2nd call auth. After that, call recall
// user.create('dude', 'my secret').then(function(ack) { console.log('created ack:', ack) });
// user.recall().then(function(ack){
// if (!ack || !ack.sea){
// console.log('user.recall not bootstrapping...');
// user.auth('dude', 'my secret', {pin: 'PIN'}).then(function(user) { console.log('authenticated user:', user) });
// // user.auth('dude', 'my secret', {pin: 'PIN', newpass: 'my new secret'}).then(function(user) { console.log('authenticated user:', user) });
// } else {
// // gun.get('pub/' + ack.pub).put({ hello: 'world' });
// gun.get('pub/' + ack.pub).get('hello').val((val, key) => console.log('READ:', val, key));
// console.log('user.recall authenticated user:', ack.alias);
// }
// });
}
var chat = gun.get('converse');
chat.map().val(function(msg, field){
var ul = $('ul'), last = sort(field, ul.children('li').last()), li;