2019-11-19 01:41:08 +03:00
|
|
|
:: contact-view: sets up contact JS client and combines commands
|
|
|
|
:: into semantic actions for the UI
|
|
|
|
::
|
2019-12-03 03:27:01 +03:00
|
|
|
/- *group-store
|
2019-11-19 01:41:08 +03:00
|
|
|
/+ *server, *contact-json
|
|
|
|
/= index
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/contacts/index
|
|
|
|
/| /html/
|
|
|
|
/~ ~
|
|
|
|
==
|
|
|
|
/= tile-js
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/contacts/js/tile
|
|
|
|
/| /js/
|
|
|
|
/~ ~
|
|
|
|
==
|
|
|
|
/= script
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/contacts/js/index
|
|
|
|
/| /js/
|
|
|
|
/~ ~
|
|
|
|
==
|
|
|
|
/= style
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/contacts/css/index
|
|
|
|
/| /css/
|
|
|
|
/~ ~
|
|
|
|
==
|
|
|
|
/= contact-png
|
|
|
|
/^ (map knot @)
|
|
|
|
/: /===/app/contacts/img /_ /png/
|
|
|
|
::
|
|
|
|
|%
|
|
|
|
::
|
|
|
|
+$ move [bone card]
|
|
|
|
::
|
|
|
|
+$ card
|
|
|
|
$% [%http-response =http-event:http]
|
|
|
|
[%connect wire binding:eyre term]
|
|
|
|
[%quit ~]
|
2019-12-03 03:27:01 +03:00
|
|
|
[%peer wire dock path]
|
2019-11-19 01:41:08 +03:00
|
|
|
[%poke wire dock poke]
|
2019-12-03 03:27:01 +03:00
|
|
|
[%diff %json json]
|
2019-11-19 01:41:08 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ poke
|
|
|
|
$% [%launch-action [@tas path @t]]
|
2019-12-03 03:27:01 +03:00
|
|
|
[%contact-action contact-action]
|
|
|
|
[%group-action group-action]
|
2019-11-19 01:41:08 +03:00
|
|
|
==
|
|
|
|
--
|
|
|
|
::
|
|
|
|
|_ [bol=bowl:gall ?]
|
|
|
|
::
|
|
|
|
++ this .
|
|
|
|
::
|
|
|
|
++ prep
|
|
|
|
|= old=(unit ?)
|
|
|
|
^- (quip move _this)
|
|
|
|
?~ old
|
|
|
|
:_ this
|
2019-12-03 03:27:01 +03:00
|
|
|
:~ [ost.bol %peer / [our.bol %contact-store] /updates]
|
|
|
|
[ost.bol %connect / [~ /'~contacts'] %contact-view]
|
2019-11-23 06:37:01 +03:00
|
|
|
(launch-poke [/configs '/~contacts/js/tile.js'])
|
2019-12-03 03:27:01 +03:00
|
|
|
(contact-poke [%create /~/default])
|
|
|
|
(group-poke [%bundle /~/default])
|
|
|
|
(contact-poke [%add /~/default our.bol *contact])
|
|
|
|
(group-poke [%add [our.bol ~ ~] /~/default])
|
2019-11-19 01:41:08 +03:00
|
|
|
==
|
|
|
|
[~ this(+<+ u.old)]
|
|
|
|
::
|
2019-12-03 03:27:01 +03:00
|
|
|
++ poke-json
|
|
|
|
|= jon=json
|
2019-11-19 01:41:08 +03:00
|
|
|
^- (quip move _this)
|
2019-12-03 03:27:01 +03:00
|
|
|
?> (team:title our.bol src.bol)
|
|
|
|
(poke-contact-view-action (json-to-view-action jon))
|
|
|
|
::
|
|
|
|
++ poke-contact-view-action
|
|
|
|
|= act=contact-view-action
|
|
|
|
^- (quip move _this)
|
|
|
|
?> (team:title our.bol src.bol)
|
|
|
|
:_ this
|
|
|
|
?- -.act
|
|
|
|
%create
|
|
|
|
:~ (group-poke [%bundle path.act])
|
|
|
|
(contact-poke [%create path.act])
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%delete
|
2019-12-05 01:41:44 +03:00
|
|
|
:~ (group-poke [%unbundle path.act])
|
|
|
|
(contact-poke [%delete path.act])
|
2019-12-03 03:27:01 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
%add
|
|
|
|
:~ (group-poke [%add [ship.act ~ ~] path.act])
|
|
|
|
(contact-poke [%add path.act ship.act contact.act])
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%remove
|
|
|
|
:~ (group-poke [%remove [ship.act ~ ~] path.act])
|
|
|
|
(contact-poke [%remove path.act ship.act])
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ peer-primary
|
|
|
|
|= pax=path
|
|
|
|
^- (quip move _this)
|
|
|
|
?> (team:title our.bol src.bol)
|
|
|
|
:: create inbox with 100 messages max per mailbox and send that along
|
|
|
|
:: then quit the subscription
|
|
|
|
:_ this
|
|
|
|
[ost.bol %diff %json (rolodex-to-json all-scry)]~
|
|
|
|
::
|
|
|
|
++ diff-contact-update
|
|
|
|
|= [wir=wire upd=contact-update]
|
|
|
|
^- (quip move _this)
|
|
|
|
=/ updates-json (update-to-json upd)
|
|
|
|
:_ this
|
|
|
|
%+ turn (prey:pubsub:userlib /primary bol)
|
|
|
|
|= [=bone *]
|
|
|
|
[bone %diff %json updates-json]
|
|
|
|
::
|
|
|
|
++ quit
|
|
|
|
|= wir=wire
|
|
|
|
^- (quip move _this)
|
|
|
|
:_ this
|
|
|
|
[ost.bol %peer / [our.bol %contact-store] /updates]~
|
2019-11-19 01:41:08 +03:00
|
|
|
::
|
|
|
|
++ poke-handle-http-request
|
|
|
|
%- (require-authorization:app ost.bol move this)
|
|
|
|
|= =inbound-request:eyre
|
|
|
|
^- (quip move _this)
|
|
|
|
::
|
|
|
|
=+ url=(parse-request-line url.request.inbound-request)
|
|
|
|
=/ name=@t
|
|
|
|
=+ back-path=(flop site.url)
|
|
|
|
?~ back-path
|
|
|
|
''
|
|
|
|
i.back-path
|
|
|
|
?: =(name 'tile')
|
|
|
|
[[ost.bol %http-response (js-response:app tile-js)]~ this]
|
|
|
|
?+ site.url
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response not-found:app]~
|
|
|
|
::
|
|
|
|
:: styling
|
|
|
|
::
|
|
|
|
[%'~contacts' %css %index ~]
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response (css-response:app style)]~
|
|
|
|
::
|
|
|
|
:: javascript
|
|
|
|
::
|
|
|
|
[%'~contacts' %js %index ~]
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response (js-response:app script)]~
|
|
|
|
::
|
|
|
|
:: images
|
|
|
|
::
|
|
|
|
[%'~contacts' %img *]
|
|
|
|
=/ img (as-octs:mimes:html (~(got by contact-png) `@ta`name))
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response (png-response:app img)]~
|
|
|
|
::
|
|
|
|
:: main page
|
|
|
|
::
|
|
|
|
[%'~contacts' *]
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response (html-response:app index)]~
|
|
|
|
==
|
|
|
|
::
|
2019-12-03 03:27:01 +03:00
|
|
|
++ bound
|
|
|
|
|= [wir=wire success=? binding=binding:eyre]
|
|
|
|
^- (quip move _this)
|
|
|
|
[~ this]
|
2019-11-19 01:41:08 +03:00
|
|
|
::
|
|
|
|
:: +utilities
|
|
|
|
::
|
2019-12-03 03:27:01 +03:00
|
|
|
++ contact-poke
|
|
|
|
|= act=contact-action
|
|
|
|
^- move
|
|
|
|
[ost.bol %poke / [our.bol %contact-store] [%contact-action act]]
|
|
|
|
::
|
2019-11-19 01:41:08 +03:00
|
|
|
++ launch-poke
|
|
|
|
|= [pax=path =cord]
|
|
|
|
^- move
|
|
|
|
[ost.bol %poke / [our.bol %launch] [%launch-action [%contact-view pax cord]]]
|
2019-12-03 03:27:01 +03:00
|
|
|
::
|
|
|
|
++ group-poke
|
|
|
|
|= act=group-action
|
|
|
|
^- move
|
|
|
|
[ost.bol %poke / [our.bol %group-store] [%group-action act]]
|
|
|
|
::
|
|
|
|
++ all-scry
|
|
|
|
^- rolodex
|
|
|
|
.^(rolodex %gx /=contact-store/(scot %da now.bol)/all/noun)
|
2019-11-19 01:41:08 +03:00
|
|
|
--
|