This commit is contained in:
C. Guy Yarvin 2017-10-31 11:08:07 -07:00
commit b7c6567449
14 changed files with 112 additions and 39 deletions

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2015 Urbit Copyright (c) 2017 Urbit
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -128,7 +128,7 @@
|= {gol/goal mod/dojo-model} ^- dojo-command |= {gol/goal mod/dojo-model} ^- dojo-command
[[%poke gol] [0 [%ge mod(q.p [q.gol q.p.mod])]]] [[%poke gol] [0 [%ge mod(q.p [q.gol q.p.mod])]]]
:: ::
++ dp-command-line ;~(sfix dp-command (just '\0a')) ++ dp-command-line ;~(sfix dp-command (star ace) (just '\0a'))
++ dp-variable :: %verb or %brev ++ dp-variable :: %verb or %brev
|* {sym/rule src/rule} |* {sym/rule src/rule}
%+ cook %+ cook

View File

@ -158,6 +158,7 @@
++ poke-kiln-sync (wrap poke-sync):from-kiln ++ poke-kiln-sync (wrap poke-sync):from-kiln
++ poke-kiln-syncs (wrap poke-syncs):from-kiln ++ poke-kiln-syncs (wrap poke-syncs):from-kiln
++ poke-kiln-start-autoload (wrap poke-start-autoload):from-kiln ++ poke-kiln-start-autoload (wrap poke-start-autoload):from-kiln
++ poke-kiln-wipe-ford (wrap poke-wipe-ford):from-kiln
++ poke-kiln-autoload (wrap poke-autoload):from-kiln ++ poke-kiln-autoload (wrap poke-autoload):from-kiln
++ poke-kiln-overload (wrap poke-overload):from-kiln ++ poke-kiln-overload (wrap poke-overload):from-kiln
++ poke-kiln-unmount (wrap poke-unmount):from-kiln ++ poke-kiln-unmount (wrap poke-unmount):from-kiln

View File

@ -1693,6 +1693,7 @@
:: ::
++ pa-report-group :: update presence ++ pa-report-group :: update presence
|= vew/(set bone) |= vew/(set bone)
?: [no-presence=&] +>.$
%^ pa-report vew %group %^ pa-report vew %group
:- %- ~(run by locals) :- %- ~(run by locals)
|=({@ a/status} a) |=({@ a/status} a)
@ -1936,7 +1937,18 @@
++ pa-revise :: revise existing ++ pa-revise :: revise existing
|= {num/@ud gam/telegram} |= {num/@ud gam/telegram}
=+ way=(sub count num) =+ way=(sub count num)
?: =(gam (snag (dec way) grams)) =/ ole (snag (dec way) grams)
=. q.q.gam
::REVIEW let old %received override different "new" states, in an
:: attempt to stem a stale-update loop
::
%- ~(urn by q.q.gam)
|= {a/partner b/{envelope dev/delivery}} ^- {envelope delivery}
?: ?=({$~ ^ $received} (~(get by q.q.ole) a))
b(dev %received)
b
::
?: =(gam ole)
+>.$ :: no change +>.$ :: no change
=. grams (welp (scag (dec way) grams) [gam (slag way grams)]) =. grams (welp (scag (dec way) grams) [gam (slag way grams)])
(pa-refresh num gam) (pa-refresh num gam)

13
gen/hood/wipe-ford.hoon Normal file
View File

@ -0,0 +1,13 @@
:: Kiln: wipe ford cache
::
:::: /hoon/wipe-ford/hood/gen
::
/? 310
::
::::
!:
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/$~ $~}
==
[%kiln-wipe-ford ~]

View File

@ -3,18 +3,35 @@
:::: /hoon/moon/gen :::: /hoon/moon/gen
:: ::
/? 310 /? 310
/- sole
[. sole]
:: ::
:::: ::::
:: ::
:- %say :- %ask
|= $: {now/@da eny/@uvJ bec/beak} |= $: {now/@da eny/@uvJ bec/beak}
$~ $~
$~ $~
== ==
:- %tang :_ ~ :- %leaf =/ ran (clan p.bec)
=+ ran=(clan p.bec)
?: ?=({?($earl $pawn)} ran) ?: ?=({?($earl $pawn)} ran)
"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}" %- sole-so
=+ mon=(mix (lsh 5 1 (end 5 1 eny)) p.bec) :- %tang :_ ~
=+ tic=.^(@ /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon)) leaf+"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
"moon: {<`@p`mon>}; ticket: {<`@p`tic>}" =/ mon (mix (lsh 5 1 (end 5 1 eny)) p.bec)
=/ tic .^(@ /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon))
%+ sole-yo
leaf+"(see https://github.com/urbit/arvo/issues/327 for details)"
%+ sole-yo
:- %leaf
;: weld
"WARNING: linking a moon to your "
?-(ran $czar "galaxy", $king "star", $duke "planet")
" can cause networking bugs"
==
%+ sole-lo
[& %$ "enter y/yes to continue: "]
|= inp/tape
?. |(=("y" inp) =("yes" inp))
(sole-so [%tang leaf+"canceled" ~])
(sole-so [%tang leaf+"moon: {<`@p`mon>}; ticket: {<`@p`tic>}" leaf+"" ~])

View File

@ -11,4 +11,6 @@
{{her/@p $~} $~} {{her/@p $~} $~}
== ==
:- %noun :- %noun
~_ leaf+"can't ticket {<her>} (not a child of {<p.bec>})"
?> =(p.bec (sein her))
.^(@p /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p her)) .^(@p /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p her))

View File

@ -260,6 +260,8 @@
|= tym/@dr |= tym/@dr
abet:(emit %wait /kiln/overload/(scot %dr tym) (add ~s10 now)) abet:(emit %wait /kiln/overload/(scot %dr tym) (add ~s10 now))
:: ::
++ poke-wipe-ford |=($~ abet:(emit %wipe /kiln our ~))
::
++ take |=(way/wire ?>(?=({@ $~} way) (work i.way))) :: general handler ++ take |=(way/wire ?>(?=({@ $~} way) (work i.way))) :: general handler
++ take-mere :: ++ take-mere ::
|= {way/wire are/(each (set path) (pair term tang))} |= {way/wire are/(each (set path) (pair term tang))}
@ -348,11 +350,14 @@
++ start-sync ++ start-sync
|= reset/? |= reset/?
=. +>.$ (spam (render "activated sync" sud her syd) ~) =. +>.$ (spam (render "activated sync" sud her syd) ~)
=. +>.$
%- blab %- blab
:~ :* ost %warp :~ :* ost %warp
[%kiln %sync syd (scot %p her) sud ?:(reset /reset /)] [%kiln %sync syd (scot %p her) sud ?:(reset /reset /)]
[our her] sud ~ %sing %w [%da now] / [our her] sud ~ %sing %w [%da now] /
== == == ==
?. =(%home syd) +>.$ :: XX less hard-coding
(blab [ost %mont /mount syd our syd /]~)
:: ::
++ writ ++ writ
|= {reset/? rot/riot} |= {reset/? rot/riot}

11
mar/noun.hoon Normal file
View File

@ -0,0 +1,11 @@
::
:::: /hoon/noun/mar
::
/? 310
!:
:::: A minimal noun mark
|_ non/*
++ grab |%
++ noun *
--
--

View File

@ -44,7 +44,8 @@
(malt (turn t.t.a |=(b/cord (rash b account)))) (malt (turn t.t.a |=(b/cord (rash b account))))
:: ::
++ user ;~(pfix (jest 'User ') (cook crip (star prn))) ++ user ;~(pfix (jest 'User ') (cook crip (star prn)))
++ knot (sear (flit |=(a/^knot !=('' a))) urs:ab) ++ knot %+ cook crip
(plus ;~(pose nud low hig hep dot sig cab))
++ location ;~(pfix (jest 'Location ') (cook crip (star prn))) ++ location ;~(pfix (jest 'Location ') (cook crip (star prn)))
++ account ++ account
;~ plug ;~ plug

View File

@ -291,11 +291,11 @@
0w0 :: 174, ~hut, Tlon 0w0 :: 174, ~hut, Tlon
0w0 :: 175, ~tun, Tlon 0w0 :: 175, ~tun, Tlon
0w0 :: 176, ~byl, Tlon 0w0 :: 176, ~byl, Tlon
0w0 :: 177, ~sud, Tlon 0wq.wmRvk.V8tZ5.1lz5q.dbrYx :: 177, ~sud, Tlon
0w0 :: 178, ~pem, Tlon 0w3Q.0LYXy.LjTEu.~FjaT.OpTts :: 178, ~pem, Tlon
0wQ.uJzGo.M94yL.L7yw6.nGyfW :: 179, ~dev, Tlon 0wQ.uJzGo.M94yL.L7yw6.nGyfW :: 179, ~dev, Tlon
0w0 :: 180, ~lur, Tlon 0w1B.LTLDt.3Yu~s.BuzYM.fjcS3 :: 180, ~lur, Tlon
0w0 :: 181, ~def, Tlon 0w2B.9j6g-.q9DwV.tXzPz.DKEKq :: 181, ~def, Tlon
0w1m.CxbiW.SKF5E.11JQ6.yW~T4 :: 182, ~bus, Tlon 0w1m.CxbiW.SKF5E.11JQ6.yW~T4 :: 182, ~bus, Tlon
0w0 :: 183, ~bep, Tlon 0w0 :: 183, ~bep, Tlon
0w0 :: 184, ~run, Tlon 0w0 :: 184, ~run, Tlon

View File

@ -2036,6 +2036,7 @@
?+ syd [~ ~] ?+ syd [~ ~]
$serv $serv
``[%path !>((en-beam top))] ``[%path !>((en-beam top))]
::
$host $host
%- (lift (lift |=(a/hart [%hart !>(a)]))) %- (lift (lift |=(a/hart [%hart !>(a)])))
^- (unit (unit hart)) ^- (unit (unit hart))

View File

@ -778,7 +778,10 @@ module.exports = recl({
case speech.url == null: case speech.url == null:
return speechArr = speech.url.txt.split(/(\s|-)/); return speechArr = speech.url.txt.split(/(\s|-)/);
case speech.fat == null: case speech.fat == null:
return speech.fat.taf.exp.txt.split(/(\s|-)/); if (typeof speech.fat.taf.exp !== 'undefined') { return speech.fat.taf.exp.txt.split(/(\s|-)/); }
if (typeof speech.fat.taf.app !== 'undefined') { return speech.fat.taf.app.txt; }
if (typeof speech.fat.taf.lin !== 'undefined') { return speech.fat.taf.lin.txt; }
return "unsupported fat speech";
default: default:
return []; return [];
} }

View File

@ -470,8 +470,8 @@ extras = {
"This page was made by Urbit. Feedback: ", a({ "This page was made by Urbit. Feedback: ", a({
href: "mailto:urbit@urbit.org" href: "mailto:urbit@urbit.org"
}, "urbit@urbit.org"), " ", a({ }, "urbit@urbit.org"), " ", a({
href: "https://twitter.com/urbit_" href: "https://twitter.com/urbit"
}, "@urbit_") }, "@urbit")
]) ])
]); ]);
}) })
@ -1927,6 +1927,9 @@ module.exports = query({
}, },
onSubmit: function(e) { onSubmit: function(e) {
var comment, path, title; var comment, path, title;
this.setState({
loading: true
});
title = this.refs["in"].title.value; title = this.refs["in"].title.value;
comment = this.refs["in"].comment.value; comment = this.refs["in"].comment.value;
path = this.props.path || "/"; path = this.props.path || "/";
@ -1939,27 +1942,26 @@ module.exports = query({
}); });
}, },
render: function() { render: function() {
var _attr, bodyTextArea, postButton, titleInput; var bodyTextArea, postButton, titleInput;
_attr = {}; titleInput = input({
if (this.state.loading === true) { disabled: this.state.loading ? "true" : void 0,
_attr.disabled = "true";
}
titleInput = input(_.create(_attr, {
type: "text", type: "text",
name: "title", name: "title",
placeholder: "Title" placeholder: "Title"
})); });
bodyTextArea = textarea(_.create(_attr, { bodyTextArea = textarea({
disabled: this.state.loading ? "true" : void 0,
type: "text", type: "text",
name: "comment", name: "comment",
value: this.state.value, value: this.state.value,
onChange: this.onChange onChange: this.onChange
})); });
postButton = input(_.create(_attr, { postButton = input({
disabled: this.state.loading ? "true" : void 0,
type: "submit", type: "submit",
value: "Post", value: "Post",
className: "btn btn-primary" className: "btn btn-primary"
})); });
return div({}, div({ return div({}, div({
className: "add-post" className: "add-post"
}, form({ }, form({
@ -2051,7 +2053,7 @@ Virtual = name("Virtual", function(arg) {
}, function(str) { }, function(str) {
return str; return str;
}, function(arg1, key) { }, function(arg1, key) {
var c, e, error, ga, gn, props, ref1; var c, e, ga, gn, props, ref1;
gn = arg1.gn, ga = arg1.ga, c = arg1.c; gn = arg1.gn, ga = arg1.ga, c = arg1.c;
props = { props = {
key: key key: key
@ -2476,7 +2478,7 @@ module.exports = query({
if (this.props.match) { if (this.props.match) {
comp = gn === this.props.match; comp = gn === this.props.match;
} else { } else {
comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN; comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== (0/0);
} }
if (comp) { if (comp) {
ga = _.clone(ga); ga = _.clone(ga);
@ -3164,8 +3166,9 @@ module.exports = {
if (hor != null) { if (hor != null) {
d.setHours(hor); d.setHours(hor);
d.setMinutes(min); d.setMinutes(min);
return d.setSeconds(sec); d.setSeconds(sec);
} }
return d;
}, },
getKeys: function(kids, sortBy) { getKeys: function(kids, sortBy) {
return _.map(this.sortKids(kids, sortBy), 'name'); return _.map(this.sortKids(kids, sortBy), 'name');
@ -3345,8 +3348,12 @@ EventEmitter.prototype.emit = function(type) {
er = arguments[1]; er = arguments[1];
if (er instanceof Error) { if (er instanceof Error) {
throw er; // Unhandled 'error' event throw er; // Unhandled 'error' event
} else {
// At least give some kind of context to the user
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
err.context = er;
throw err;
} }
throw TypeError('Uncaught, unspecified "error" event.');
} }
} }