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

View File

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