mirror of
https://github.com/amark/gun.git
synced 2026-03-22 08:03:36 +00:00
need to fix opt more, but hopefully quick fix on axe reconfig that @SunriseFox pointed out
This commit is contained in:
24
as.js
24
as.js
@@ -209,13 +209,12 @@
|
||||
;$(function(){
|
||||
$('.page').not(':first').hide();
|
||||
$.as.route(location.hash.slice(1));
|
||||
var opt = window.CONFIG || {};
|
||||
opt.peers = opt.peers || ($('body').attr('peers') || (function(){
|
||||
(console.warn || console.log)('Warning: No peer provided, defaulting to DEMO peer. Do not run in production, or your data will be regularly wiped, reset, or deleted. For more info, check https://github.com/eraeco/joydb#peers !');
|
||||
return 'https://gunjs.herokuapp.com/gun';
|
||||
}())).replace(', ', ',').split(',');
|
||||
$.as(document, window.gun = window.gun || Gun(opt), null, opt);
|
||||
$(JOY.start = JOY.start || function(){ $.as(document, gun, null, opt) });
|
||||
|
||||
if($('body').attr('peers')){ (console.warn || console.log)('Warning: Please upgrade <body peers=""> to https://github.com/eraeco/joydb#peers !') }
|
||||
|
||||
});
|
||||
;(function(){ // need to isolate into separate module!
|
||||
var joy = window.JOY = function(){};
|
||||
joy.auth = function(a,b,cb,o){
|
||||
if(!o){ o = cb ; cb = 0 }
|
||||
@@ -225,7 +224,16 @@
|
||||
}
|
||||
gun.user().auth(a,b, cb,o);
|
||||
}
|
||||
|
||||
var opt = window.CONFIG || {}, peers;
|
||||
$('link[type=peer]').each(function(){ (peers || (peers = [])).push($(this).attr('href')) });
|
||||
!window.gun && (opt.peers = opt.peers || peers || (function(){
|
||||
(console.warn || console.log)('Warning: No peer provided, defaulting to DEMO peer. Do not run in production, or your data will be regularly wiped, reset, or deleted. For more info, check https://github.com/eraeco/joydb#peers !');
|
||||
return ['https://gunjs.herokuapp.com/gun'];
|
||||
}()));
|
||||
window.gun = window.gun || Gun(opt);
|
||||
|
||||
gun.on('auth', function(ack){
|
||||
console.log("Your namespace is publicly available at", ack.soul);
|
||||
})
|
||||
});
|
||||
});
|
||||
}());
|
||||
2
axe.js
2
axe.js
@@ -140,7 +140,7 @@
|
||||
tmp = tmp.peers;
|
||||
if(!tmp || !Gun.text.is(tmp)){ return }
|
||||
if(axe.up[tmp] || 6 <= Object.keys(axe.up).length){ return }
|
||||
var o = {peers: tmp};
|
||||
var o = tmp; //{peers: tmp};
|
||||
at.$.opt(o);
|
||||
o = peers[tmp];
|
||||
if(!o){ return }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gun",
|
||||
"version": "0.2019.711",
|
||||
"version": "0.2019.712",
|
||||
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
|
||||
"main": "index.js",
|
||||
"browser": "gun.js",
|
||||
|
||||
Reference in New Issue
Block a user