Merge remote-tracking branches 'joemfb/syncs', 'joemfb/drum-refactor', 'ohaitch/talk-fix-federation' and 'ohaitch/tree-null-check-ship'

Simplifies |syncs
Refactors drum
Reinterprets audience in federated messages
tree@f726ff4
This commit is contained in:
Raymond Pasco 2016-09-21 15:37:32 -04:00
5 changed files with 368 additions and 495 deletions

View File

@ -1867,7 +1867,13 @@
+>.$
=. q.q.gam
=+ ole=(~(get by q.q.gam) [%& our.hid man])
?^ ole (~(put by q.q.gam) [%& our.hid man] -.u.ole %received)
:: for fedearted stations, pretend station src/foo is also our/foo
:: XX pass src through explicitly instead of relying on implicit
:: value in hid from the subscription to src/foo
=+ ole=(~(get by q.q.gam) [%& src.hid man])
?~ ole q.q.gam
=. q.q.gam (~(del by q.q.gam) [%& src.hid man])
(~(put by q.q.gam) [%& our.hid man] -.u.ole %received)
=+ old=(~(get by known) p.q.gam)
?~ old

File diff suppressed because it is too large Load Diff

View File

@ -119,15 +119,13 @@
abet:(spam (render "already syncing" [sud her syd]:hos) ~)
abet:abet:(start-sync:(auto hos) |)
::
++ poke-syncs ::
++ poke-syncs :: print sync config
|= $~
=< abet %- spam
=+ a=(~(tap by syn))
?: =(0 (lent a))
?: =(0 ~(wyt by syn))
[%leaf "no syncs configured"]~
%- flop %+ turn a
|= a/(pair kiln-sync *)
(render "sync configured" [sud her syd]:p.a)
%+ turn (~(tap in ~(key by syn)))
|=(a/kiln-sync (render "sync configured" [sud her syd]:a))
::
++ poke-init-sync
|= hos/kiln-sync

View File

@ -97,6 +97,7 @@
date: {<now>}
title: {(trip hed)}
author: {<him>}
navsort: bump
navuptwo: true
comments: reverse
---

View File

@ -421,13 +421,14 @@ extras = {
kids: {
name: 't',
head: 'r',
meta: 'j'
meta: 'j',
bump: 't'
}
}, name("Next", function(arg) {
var curr, index, keys, kids, next, path, ref1, ref2;
curr = arg.curr, path = arg.path, kids = arg.kids;
var curr, index, keys, kids, meta, next, path, ref1, ref2;
curr = arg.curr, meta = arg.meta, path = arg.path, kids = arg.kids;
if ((ref1 = kids[curr]) != null ? (ref2 = ref1.meta) != null ? ref2.next : void 0 : void 0) {
keys = util.getKeys(kids);
keys = util.getKeys(kids, meta.navsort);
if (keys.length > 1) {
index = keys.indexOf(curr);
next = index + 1;
@ -537,7 +538,8 @@ module.exports = query({
color: this.props.meta.logo
}), reactify(this.props.body, 'body'), extra('next', {
dataPath: this.props.sein,
curr: this.props.name
curr: this.props.name,
meta: this.props.meta
}), extra('comments'), extra('footer', {
container: this.props.meta.container
})
@ -805,7 +807,7 @@ module.exports = Dpad = function(arg) {
var arrowSibs, arrowUp, curr, index, keys, kids, meta, next, prev, sein;
sein = arg.sein, curr = arg.curr, kids = arg.kids, meta = arg.meta;
arrowUp = sein ? meta.navuptwo ? Arrow("up", sein.replace(/\/[^\/]*$/, "")) : Arrow("up", sein) : void 0;
arrowSibs = (keys = util.getKeys(kids), keys.length > 1 ? (index = keys.indexOf(curr), prev = index - 1, next = index + 1, prev < 0 ? prev = keys.length - 1 : void 0, next === keys.length ? next = 0 : void 0, prev = keys[prev], next = keys[next]) : void 0, sein ? (sein === "/" ? sein = "" : void 0, div({}, prev ? Arrow("prev", sein + "/" + prev) : void 0, next ? Arrow("next", sein + "/" + next) : void 0)) : void 0);
arrowSibs = (keys = util.getKeys(kids, meta.navsort), keys.length > 1 ? (index = keys.indexOf(curr), prev = index - 1, next = index + 1, prev < 0 ? prev = keys.length - 1 : void 0, next === keys.length ? next = 0 : void 0, prev = keys[prev], next = keys[next]) : void 0, sein ? (sein === "/" ? sein = "" : void 0, div({}, prev ? Arrow("prev", sein + "/" + prev) : void 0, next ? Arrow("next", sein + "/" + next) : void 0)) : void 0);
return div({
className: 'dpad',
key: 'dpad'
@ -1832,7 +1834,11 @@ module.exports = query({
className: "mono"
}, "~" + urb.ship), (who != null) || this.state.edit ? h6({}, editable('who', who, "Sun Tzu")) : void 0, Grid({
className: "grid"
}, ["Location:", editable('loc', loc, "Unknown")], ["Issued by:", issuedBy], [
}, ["Location:", editable('loc', loc, "Unknown")], [
"Issued by:", a({
href: "//" + urb.sein + ".urbit.org"
}, issuedBy)
], [
"Immutable link:", a({
href: beak + "/web" + path
}, beak)
@ -2316,7 +2322,8 @@ module.exports = query({
head: 'r',
meta: 'j',
name: 't',
path: 't'
path: 't',
bump: 't'
}
}, recl({
displayName: "Siblings",
@ -2333,7 +2340,7 @@ module.exports = query({
},
render: function() {
var kids, navClas;
kids = util.sortKids(this.props.kids);
kids = util.sortKids(this.props.kids, this.props.meta.navsort);
navClas = {
nav: true,
'col-md-12': this.props.meta.navmode === 'navbar'
@ -3133,8 +3140,9 @@ module.exports = {
return path.replace(/\/$/, '').replace(_basepath, "");
},
shortShip: function(ship) {
var ref;
if (ship == null) {
ship = urb.user;
ship = (ref = urb.user) != null ? ref : "";
}
if (ship.length <= 13) {
return ship;
@ -3155,8 +3163,8 @@ module.exports = {
return new Date(str);
}
},
getKeys: function(kids) {
return _.map(this.sortKids(kids), 'name');
getKeys: function(kids, sortBy) {
return _.map(this.sortKids(kids, sortBy), 'name');
},
sortKids: function(kids, sortBy) {
var _k, _kids, date, k, ref, ref1, v;
@ -3170,11 +3178,13 @@ module.exports = {
});
switch (sortBy) {
case 'bump':
return _.sortBy(kids, function(arg) {
var bump, name;
bump = arg.bump, name = arg.name;
return bump || name;
}).reverse();
return _.sortBy(kids, (function(_this) {
return function(arg) {
var bump, meta, name;
bump = arg.bump, meta = arg.meta, name = arg.name;
return _this.dateFromAtom(bump || (meta != null ? meta.date : void 0) || name);
};
})(this)).reverse();
case 'date':
_kids = [];
for (k in kids) {