fixes for review

This commit is contained in:
Isaac Visintainer 2019-03-29 16:04:34 -07:00
parent e1a3178573
commit 8da954f3e2
4 changed files with 32 additions and 55 deletions

View File

@ -32,6 +32,7 @@
::
+$ card
$% [%http-response =http-event:http]
[%connect wire binding:http-server term]
[%peer wire dock path]
[%diff diff]
[%quit ~]
@ -43,10 +44,23 @@
::
--
::
|_ [bol=bowl:gall sta=(map @ @)]
|_ [bol=bowl:gall ~]
::
++ this .
::
++ prep
|= old=(unit ~)
^- (quip move _this)
?~ old
:_ this
[ost.bol %connect / [~ /'~landscape'] %landscape]~
[~ this]
::
++ bound
|= [wir=wire success=? binding=binding:http-server]
^- (quip move _this)
[~ this]
::
++ peer-xship
|= wir=wire
^- (quip move _this)
@ -142,8 +156,8 @@
:: collections top level page
::
[%'~landscape' %collections @t @t ~]
=/ shp/@p (slav %p i.t.t.site.request-line)
=/ col/@da (slav %da i.t.t.t.site.request-line)
=/ shp=@p (slav %p i.t.t.site.request-line)
=/ col=@da (slav %da i.t.t.t.site.request-line)
?: =(shp our.bol)
:: local request
::
@ -177,8 +191,8 @@
:: collections new post page
::
[%'~landscape' %collections @t @t %new ~]
=/ shp/@p (slav %p i.t.t.site.request-line)
=/ col/@da (slav %da i.t.t.t.site.request-line)
=/ shp=@p (slav %p i.t.t.site.request-line)
=/ col=@da (slav %da i.t.t.t.site.request-line)
?: =(shp our.bol)
=/ dif=diff (coll-elem shp col `[*@da %new] |)
?> ?=(%hymn -.dif)
@ -193,9 +207,9 @@
:: collections view post page
::
[%'~landscape' %collections @t @t @t ~]
=/ shp/@p (slav %p i.t.t.site.request-line)
=/ col/@da (slav %da i.t.t.t.site.request-line)
=/ pos/@da (slav %da i.t.t.t.t.site.request-line)
=/ shp=@p (slav %p i.t.t.site.request-line)
=/ col=@da (slav %da i.t.t.t.site.request-line)
=/ pos=@da (slav %da i.t.t.t.t.site.request-line)
?: =(shp our.bol)
=/ jon=? =(ext.request-line [~ ~.json])
=/ dif=diff (coll-elem shp col `[pos %default] jon)
@ -227,9 +241,9 @@
:: collections edit post page
::
[%'~landscape' %collections @t @t @t %edit ~]
=/ shp/@p (slav %p i.t.t.site.request-line)
=/ col/@da (slav %da i.t.t.t.site.request-line)
=/ pos/@da (slav %da i.t.t.t.t.site.request-line)
=/ shp=@p (slav %p i.t.t.site.request-line)
=/ col=@da (slav %da i.t.t.t.site.request-line)
=/ pos=@da (slav %da i.t.t.t.t.site.request-line)
?: =(shp our.bol)
=/ dif=diff (coll-elem shp col `[pos %edit] |)
?> ?=(%hymn -.dif)

View File

@ -69,15 +69,14 @@
^- (quip move _this)
?~ old
:_ this
:~ [ost.bow %connect / [~ /] %modulo]
[ost.bow %connect / [~ /'~landscape'] %landscape]
==
[~ this(sta *state)]
[ost.bow %connect / [~ /] %modulo]~
[~ this]
::
:: alerts us that we were bound. we need this because the vane calls back.
::
++ bound
|= [wir=wire success=? binding=binding:http-server]
^- (quip move _this)
[~ this]
::
++ peer-applist
@ -90,11 +89,10 @@
^- octs
:: ?~ cur.sta
:: *octs
%- as-octs:mimes:html
%- crip
%- as-octt:mimes:html
:: ;: weld
:: (trip 'window.onload = function() {')
"window.ship = '{(trip (rsh 3 1 (crip <our.bow>)))}';"
"window.ship = '{+:(scow %p our.bow)}';"
:: (trip '};')
:: ==
:: " window.state = "

View File

@ -1,35 +0,0 @@
::
:::: /hoon/http/lib
::
::
::
/? 310
::
=, mimes:html
=, html
|%
++ request
$: domain/(list cord)
end-point/path
req-type/$?($get {$post p/json})
headers/math:eyre
queries/quay:eyre
==
++ send
|= {ost/bone pour-path/wire params/request}
:^ ost %them pour-path
`(unit hiss:eyre)`[~ (request-to-hiss params)]
::
++ request-to-hiss
|= request ^- hiss:eyre
=- ~& hiss=- -
:- ^- parsed-url/purl:eyre
:+ :+ security=%.y
port=~
host=[%.y [path=domain]]
endpoint=[extensions=~ point=end-point] :: ++pork,
q-strings=queries :: ++quay
?@ req-type
[%get headers ~]
[%post headers ~ (as-octt:mimes:html (en-json p.req-type))]
--

View File

@ -11,12 +11,12 @@
++ manx-to-octs
|= man=manx
^- octs
(as-octs:mimes:html (crip (en-xml:html man)))
(as-octt:mimes:html (en-xml:html man))
::
++ json-to-octs
|= jon=json
^- octs
(as-octs:mimes:html (crip (en-json:html jon)))
(as-octt:mimes:html (en-json:html jon))
::
++ app
|%