terminal working

This commit is contained in:
Ubuntu 2014-09-18 02:56:49 +00:00
parent e95c042e85
commit 7e445e92f4
3 changed files with 48 additions and 21 deletions

View File

@ -1,4 +1,4 @@
!: :: %gall, user-level applications
:: :: %gall, user-level applications
!? 164
::::
|= pit=vase

View File

@ -28,14 +28,18 @@
!:
:::: program
::
|_ [hid=hide ~]
|_ [hid=hide pax=_`path`%]
++ poke-txt
|= [ost=bone you=ship txt=cord]
^- [(list move) _+>]
=^ res pax
=+ paf=(rush txt (sear plex rood):(vang | pax))
?^ paf ["=% {(spud u.paf)}" u.paf]
["Yup, {(trip txt)}" pax]
:_ +>.$ :_ ~
:* ost %pass / %g %mess
[our.hid +.imp.hid] you
%term-line !>(`term-line`[(crip <lat.hid>) leaf/(trip txt) ~])
%term-line !>(`term-line`[(spat pax) leaf/res ~])
==
::
++ pour

View File

@ -42,23 +42,43 @@
|_ [hid=hide axle]
++ page
^- manx
=+ jpok=|=([a=term b=cord] "urb.send(\{data: \{{(trip a)}:{(trip b)}}})")
;html
;head
;title: Hi
;script(src "/gon/main/lib/urb.js");
;script(src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
;script: urb.appl = "{(trip app.hid)}"
;script:'''
jpok = function(a,b){
var dat = {}
dat[a] = b
urb.send({data:dat})
}
'''
;style:'''
body {
background-color: black;
color: greenyellow;
}
'''
==
;body
;p: Hello
;button(onclick (jpok %new '"shell"')): Boot
;input#prom; ;button(onclick (jpok %line 'prom.value')): Set
;pre#cont; ;script:'''
urb.subscribe({path: '/lines'}, function(e, dat){
if(dat.data.ok) return;
cont.textContent = JSON.stringify(dat.data)
})
'''
;button(onclick "jpok('new', 'shell')"): Boot
;pre#cont;
;span#prem:">" ;input#prom;
;script:'''
$(prom).keydown(function(e){
if(e.which != 13) return;
prem.textContent += prom.value
jpok('line', prom.value)
$(this).val('')
})
urb.subscribe({path: '/lines'}, function(e, dat){
if(dat.data.ok) return;
cont.textContent = dat.data.lines.join('\n')
prem.textContent = dat.data.prompt + '> '
})
'''
==
==
::
@ -69,37 +89,40 @@
?~ pax
[ost %give %rust %hymn page]
?+ -.pax !!
%lines [ost %give %rust %json (tel-to-jon hiz)]
%lines (jell ost)
==
::
++ poke-json
|= [ost=bone you=ship jon=json]
^- [(list move) _+>]
:_ +>.$
=+ jof=(need ((of line/so new/so ~):jo jon))
?- -.jof
%new
~& poke-sire/jof
:- [ost %give %nice ~]
[ost %pass /hi %g %sire [+ +]:jof]~
=. q.hiz :_(q.hiz leaf/"+ {(trip +.jof)}")
:_ +>.$
:+ [ost %give %nice ~]
[ost %pass /hi %g %sire [+ +]:jof]
(turn (~(tap in (~(get ju pus.hid) /lines))) jell)
%line
=. q.hiz :_(q.hiz leaf/"{(trip p.hiz)}> {(trip +.jof)}")
:_ +>.$
%+ turn (~(tap by cub.hid))
|= [p=span q=term]
[ost %pass /txt/[p] %g %mess [our.hid p imp.hid] you %txt !>(+.jof)]
==
::
++ jell |=(a=bone [a %give %rust %json (tel-to-jon hiz)])
++ poke-term-line
|= [ost=bone you=ship tel=term-line]
^- [(list move) _+>]
=. hiz [p.tel (weld q.tel q.hiz)]
:_ +>.$
:- [ost %give %nice ~]
%+ turn (~(tap in (~(get ju pus.hid) /lines)))
|= a=bone
[a %give %rush %json (tel-to-jon tel)]
(turn (~(tap in (~(get ju pus.hid) /lines))) jell)
::
++ pour
|= [ost=bone you=ship sih=sign]
|= [ost=bone pax=path sih=sign]
^- [(list move) _+>]
:_ +>.$
[ost %give +.sih]~