2014-09-12 06:11:03 +04:00
|
|
|
:: Terminal
|
|
|
|
::
|
|
|
|
:::: /hook/core/terminal/app
|
|
|
|
::
|
|
|
|
/? 314 :: need urbit 314
|
|
|
|
/- term-line
|
|
|
|
::
|
|
|
|
:::: structures
|
|
|
|
::
|
|
|
|
|% ::
|
2014-10-02 06:09:11 +04:00
|
|
|
++ axle $: %1 ::
|
|
|
|
hiz=(map path term-line) ::
|
2014-09-12 06:11:03 +04:00
|
|
|
== ::
|
|
|
|
++ gilt ::
|
|
|
|
$% [%term-line p=term-line] ::
|
|
|
|
[%hymn p=manx] ::
|
|
|
|
[%json p=json] ::
|
|
|
|
== ::
|
|
|
|
++ gift ::
|
|
|
|
$% [%rush gilt] ::
|
|
|
|
[%rust gilt] ::
|
|
|
|
[%mean p=ares] ::
|
|
|
|
[%nice ~] ::
|
|
|
|
== ::
|
|
|
|
++ hapt ,[p=ship q=path] ::
|
|
|
|
++ move ,[p=bone q=(mold note gift)] ::
|
|
|
|
++ note ::
|
|
|
|
$% $: %g ::
|
2014-09-23 02:20:47 +04:00
|
|
|
$% [%cide p=span] ::
|
|
|
|
[%show p=hapt q=ship r=path] ::
|
2014-09-12 06:11:03 +04:00
|
|
|
[%sire p=term q=span] ::
|
|
|
|
[%mess p=hapt q=ship r=[%txt vase]] ::
|
|
|
|
== == == ::
|
|
|
|
++ sign ::
|
|
|
|
$% $: %g ::
|
2014-09-23 02:20:47 +04:00
|
|
|
$% [%gone p=hapt] ::
|
2014-09-12 06:11:03 +04:00
|
|
|
[%mean p=ares] ::
|
2014-09-23 02:20:47 +04:00
|
|
|
[%nice ~] ::
|
2014-10-03 02:21:23 +04:00
|
|
|
[%rust p=%term-line q=term-line] ::
|
|
|
|
[%rush p=%term-line q=term-line] ::
|
2014-09-12 06:11:03 +04:00
|
|
|
== == ==
|
|
|
|
--
|
2014-10-02 06:09:11 +04:00
|
|
|
::
|
2014-10-02 23:46:00 +04:00
|
|
|
:::: libs
|
2014-10-02 06:09:11 +04:00
|
|
|
::
|
|
|
|
|%
|
|
|
|
++ encode
|
|
|
|
|= [a=term b=path] ^- span
|
|
|
|
(rap 3 a (turn b |=(c=span (cat 3 '_' c))))
|
|
|
|
::
|
|
|
|
++ decode |=(a=span `[p=term q=path]`(rash a (most cab sym)))
|
|
|
|
--
|
2014-09-12 06:11:03 +04:00
|
|
|
!:
|
|
|
|
:::: program
|
|
|
|
::
|
|
|
|
|_ [hid=hide axle]
|
|
|
|
++ page
|
2014-10-02 06:09:11 +04:00
|
|
|
|= pax=path
|
2014-09-12 06:11:03 +04:00
|
|
|
^- manx
|
|
|
|
;html
|
|
|
|
;head
|
|
|
|
;title: Hi
|
2014-09-23 05:00:25 +04:00
|
|
|
;script(src "/gen/main/lib/urb.js");
|
2014-09-18 06:56:49 +04:00
|
|
|
;script(src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
|
2014-09-12 06:11:03 +04:00
|
|
|
;script: urb.appl = "{(trip app.hid)}"
|
2014-10-02 06:09:11 +04:00
|
|
|
;script: urb.term = \{pax: "{(spud pax)}"}
|
2014-09-18 06:56:49 +04:00
|
|
|
;script:'''
|
|
|
|
jpok = function(a,b){
|
2014-10-02 06:09:11 +04:00
|
|
|
var dat = {pax:urb.term.pax, act:{}}
|
|
|
|
dat.act[a] = b
|
2014-09-18 06:56:49 +04:00
|
|
|
urb.send({data:dat})
|
|
|
|
}
|
|
|
|
'''
|
|
|
|
;style:'''
|
2014-09-27 05:34:28 +04:00
|
|
|
html {
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
|
|
|
body {
|
|
|
|
margin: 2rem;
|
|
|
|
}
|
|
|
|
body,
|
|
|
|
span,
|
|
|
|
input {
|
|
|
|
font-family: monospace;
|
|
|
|
font-size: 1rem;
|
|
|
|
background-color: #000;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
button {
|
|
|
|
border: none;
|
|
|
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
|
|
font-weight: 600;
|
|
|
|
font-size: .8rem;
|
|
|
|
text-transform: uppercase;
|
|
|
|
letter-spacing: 1px;
|
|
|
|
color: #000;
|
|
|
|
background-color: #fff;
|
|
|
|
padding: 1rem;
|
|
|
|
}
|
|
|
|
input {
|
|
|
|
border: 0;
|
|
|
|
outline: none;
|
2014-10-01 01:53:37 +04:00
|
|
|
width: 90%;
|
2014-09-18 06:56:49 +04:00
|
|
|
}
|
|
|
|
'''
|
2014-09-12 06:11:03 +04:00
|
|
|
==
|
|
|
|
;body
|
2014-09-18 06:56:49 +04:00
|
|
|
;pre#cont;
|
2014-10-01 23:20:08 +04:00
|
|
|
;span#prem:">" ;input#prom;
|
2014-09-27 05:34:28 +04:00
|
|
|
;br;
|
2014-10-01 23:20:08 +04:00
|
|
|
;button(onclick "jpok('res', 'shell')"): Reboot
|
2014-09-18 06:56:49 +04:00
|
|
|
;script:'''
|
|
|
|
$(prom).keydown(function(e){
|
|
|
|
if(e.which != 13) return;
|
|
|
|
prem.textContent += prom.value
|
|
|
|
jpok('line', prom.value)
|
|
|
|
$(this).val('')
|
|
|
|
})
|
2014-09-23 05:00:25 +04:00
|
|
|
$(prom).focus()
|
2014-09-27 05:34:28 +04:00
|
|
|
$(prem).on('click', function() { $(prom).focus(); })
|
2014-10-02 23:46:00 +04:00
|
|
|
var pax = '/lines'
|
|
|
|
if(urb.term.pax != "/") pax += urb.term.pax
|
|
|
|
urb.subscribe({path: pax}, function(e, dat){
|
2014-09-18 06:56:49 +04:00
|
|
|
if(dat.data.ok) return;
|
|
|
|
cont.textContent = dat.data.lines.join('\n')
|
|
|
|
prem.textContent = dat.data.prompt + '> '
|
|
|
|
})
|
|
|
|
'''
|
2014-09-12 06:11:03 +04:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ peer
|
|
|
|
|= [ost=bone you=ship pax=path]
|
|
|
|
^- [(list move) _+>]
|
|
|
|
?~ pax
|
2014-10-02 06:09:11 +04:00
|
|
|
$(pax /term)
|
2014-09-12 06:11:03 +04:00
|
|
|
?+ -.pax !!
|
2014-10-02 06:09:11 +04:00
|
|
|
%lines
|
|
|
|
:_ +>.$
|
|
|
|
:_ ~
|
|
|
|
(jell ost t.pax)
|
|
|
|
%term
|
|
|
|
=+ tel=(fall (~(get by hiz) t.pax) *term-line)
|
|
|
|
=^ mof q.tel
|
|
|
|
=+ aut=%shell
|
|
|
|
?: (~(has by cub.hid) (encode aut t.pax))
|
|
|
|
[~ q.tel]
|
2014-10-03 02:21:23 +04:00
|
|
|
:- :_ [ost %pass hi/mar/[t.pax] %g %sire [aut (encode aut t.pax)]]~
|
|
|
|
:^ ost %pass hi/in/[t.pax]
|
|
|
|
:^ %g %show [our.hid (encode aut t.pax) imp.hid]
|
|
|
|
:- you /out
|
2014-10-02 06:09:11 +04:00
|
|
|
:_(q.tel leaf/"+ {(trip aut)}")
|
2014-10-02 23:56:53 +04:00
|
|
|
=. hiz (~(put by hiz) t.pax tel)
|
2014-10-02 23:46:00 +04:00
|
|
|
:_ +>.$
|
2014-10-02 06:09:11 +04:00
|
|
|
[[ost %give %rust %hymn (page t.pax)] mof]
|
2014-09-12 06:11:03 +04:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ poke-json
|
|
|
|
|= [ost=bone you=ship jon=json]
|
|
|
|
^- [(list move) _+>]
|
2014-10-02 06:09:11 +04:00
|
|
|
=+ ^- [pax=path jof=$%([%line p=span] [%res p=span])]
|
|
|
|
%- need
|
|
|
|
%. jon
|
|
|
|
(ot pax/(su ;~(pfix fas (more fas sym))) act/(of line/so res/so ~) ~):jo
|
|
|
|
=+ tel=(fall (~(get by hiz) pax) *term-line)
|
2014-09-12 06:11:03 +04:00
|
|
|
?- -.jof
|
2014-10-01 23:20:08 +04:00
|
|
|
%res
|
2014-10-02 06:09:11 +04:00
|
|
|
=^ mof q.tel
|
|
|
|
?. (~(has by cub.hid) (encode p.jof pax))
|
|
|
|
[~ q.tel]
|
|
|
|
:_ :_(q.tel leaf/"- {(trip p.jof)}")
|
|
|
|
[ost %pass hi/mar/pax %g %cide (encode p.jof pax)]~
|
2014-10-02 23:46:00 +04:00
|
|
|
::~& poke-sire/[jof cub.hid]
|
2014-10-02 06:09:11 +04:00
|
|
|
=. q.tel :_(q.tel leaf/"+ {(trip p.jof)}")
|
2014-10-02 23:46:00 +04:00
|
|
|
=. hiz (~(put by hiz) pax tel)
|
|
|
|
:_ +>.$
|
2014-10-01 23:20:08 +04:00
|
|
|
%+ welp mof
|
2014-10-03 02:21:23 +04:00
|
|
|
:^ [ost %give %nice ~]
|
|
|
|
:^ ost %pass hi/in/pax
|
|
|
|
:^ %g %show [our.hid (encode p.jof pax) imp.hid]
|
|
|
|
:- you /out
|
2014-10-02 06:09:11 +04:00
|
|
|
[ost %pass hi/mar/pax %g %sire [p.jof (encode p.jof pax)]]
|
|
|
|
(spam pax)
|
2014-09-23 02:20:47 +04:00
|
|
|
::
|
2014-09-12 06:11:03 +04:00
|
|
|
%line
|
2014-10-02 06:09:11 +04:00
|
|
|
=. q.tel :_(q.tel leaf/"{(trip p.tel)}> {(trip p.jof)}")
|
2014-10-02 23:46:00 +04:00
|
|
|
=. hiz (~(put by hiz) pax tel)
|
|
|
|
:_ +>.$
|
2014-10-02 06:09:11 +04:00
|
|
|
%+ murn (~(tap by cub.hid))
|
2014-09-12 06:11:03 +04:00
|
|
|
|= [p=span q=term]
|
2014-10-02 06:09:11 +04:00
|
|
|
?. =(pax q:(decode p)) ~
|
|
|
|
%- some
|
|
|
|
[ost %pass [%txt p pax] %g %mess [our.hid p imp.hid] you %txt !>(p.jof)]
|
2014-09-12 06:11:03 +04:00
|
|
|
==
|
|
|
|
::
|
2014-10-02 06:09:11 +04:00
|
|
|
++ jell
|
|
|
|
|= [a=bone b=path]
|
|
|
|
[a %give %rust %json (tel-to-jon (fall (~(get by hiz) b) *term-line))]
|
2014-10-02 23:46:00 +04:00
|
|
|
::
|
2014-10-02 06:09:11 +04:00
|
|
|
++ spam
|
|
|
|
|= pax=path
|
|
|
|
%+ murn
|
|
|
|
(~(tap by sup.hid))
|
|
|
|
|= [ost=bone @ paf=path]
|
|
|
|
?. =([%lines pax] paf) ~
|
|
|
|
(some (jell ost pax))
|
2014-10-02 23:46:00 +04:00
|
|
|
::
|
2014-09-12 06:11:03 +04:00
|
|
|
++ pour
|
2014-09-18 06:56:49 +04:00
|
|
|
|= [ost=bone pax=path sih=sign]
|
2014-09-12 06:11:03 +04:00
|
|
|
^- [(list move) _+>]
|
2014-10-03 02:21:23 +04:00
|
|
|
?: &(!?=(~ pax) !?=(~ |1.pax) ?=(%hi &1.pax) ?=(%in &2.pax))
|
|
|
|
?+ +<.sih !!
|
|
|
|
%nice `+>.$
|
|
|
|
?(%rust %rust)
|
|
|
|
=+ tol=(fall (~(get by hiz) |2.pax) *term-line)
|
|
|
|
=. tol [p.q.sih (weld q.q.sih q.tol)]
|
|
|
|
=. hiz (~(put by hiz) |2.pax tol)
|
|
|
|
[(spam |2.pax) +>.$]
|
|
|
|
==
|
2014-09-23 02:20:47 +04:00
|
|
|
?: ?=(%gone +<.sih)
|
|
|
|
`+>.$
|
2014-10-02 23:56:53 +04:00
|
|
|
=+ paf=|2.pax
|
|
|
|
=+ tel=(fall (~(get by hiz) paf) *term-line)
|
|
|
|
=+ old=tel
|
2014-10-02 06:09:11 +04:00
|
|
|
=. q.tel
|
|
|
|
?. ?=(%mean &2.sih) q.tel
|
|
|
|
=- %- welp :_ q.tel
|
2014-10-01 01:07:40 +04:00
|
|
|
%+ turn
|
2014-10-01 04:29:32 +04:00
|
|
|
(flop -)
|
2014-10-01 01:07:40 +04:00
|
|
|
|=(a=tank rose/[~ "! " ~]^[a]~)
|
|
|
|
^- (list tank)
|
|
|
|
?~ p.sih ~
|
|
|
|
:- leaf/(trip p.u.p.sih)
|
2014-09-25 04:37:29 +04:00
|
|
|
(flop q.u.p.sih)
|
2014-10-02 23:56:53 +04:00
|
|
|
=. hiz (~(put by hiz) paf tel)
|
2014-10-02 23:46:00 +04:00
|
|
|
:_ +>.$
|
2014-09-25 04:37:29 +04:00
|
|
|
:- [ost %give +.sih]
|
2014-10-02 23:56:53 +04:00
|
|
|
?:(=(old tel) ~ (spam paf))
|
2014-09-12 06:11:03 +04:00
|
|
|
::
|
|
|
|
++ tel-to-jon
|
|
|
|
|= tel=term-line
|
|
|
|
%- jobe
|
|
|
|
:~ [%prompt %s p.tel]
|
|
|
|
:+ %lines %a
|
|
|
|
%- turn :_ jape
|
|
|
|
^- wall %- zing
|
|
|
|
^- (list wall)
|
|
|
|
%- flop
|
|
|
|
(turn q.tel (cury wash 0 80))
|
|
|
|
==
|
|
|
|
--
|