2019-11-21 02:39:46 +03:00
|
|
|
/- launch
|
2020-03-12 03:33:48 +03:00
|
|
|
/+ *server, default-agent, dbug
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
/= index
|
2020-03-20 22:06:10 +03:00
|
|
|
/^ $-([json marl] manx)
|
2019-11-21 02:39:46 +03:00
|
|
|
/: /===/app/launch/index /!noun/
|
|
|
|
/= script
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/launch/js/index
|
|
|
|
/| /js/
|
|
|
|
/~ ~
|
|
|
|
==
|
2020-03-28 01:24:37 +03:00
|
|
|
/= channel-js
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/launch/js/channel
|
|
|
|
/| /js/
|
|
|
|
/~ ~
|
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
/= style
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/launch/css/index
|
|
|
|
/| /css/
|
|
|
|
/~ ~
|
|
|
|
==
|
|
|
|
/= launch-png
|
|
|
|
/^ (map knot @)
|
|
|
|
/: /===/app/launch/img /_ /png/
|
|
|
|
::
|
|
|
|
|%
|
|
|
|
+$ versioned-state
|
2020-03-31 21:49:57 +03:00
|
|
|
$% [%0 state-zero]
|
|
|
|
[%1 state-two]
|
|
|
|
[%2 state-two]
|
2020-04-02 02:12:39 +03:00
|
|
|
[%3 state-two]
|
2019-11-21 02:39:46 +03:00
|
|
|
==
|
|
|
|
+$ state-zero
|
2020-03-31 21:49:57 +03:00
|
|
|
$: tiles=(set tile:launch)
|
2019-11-21 02:39:46 +03:00
|
|
|
data=tile-data:launch
|
|
|
|
path-to-tile=(map path @tas)
|
|
|
|
==
|
2020-03-31 21:49:57 +03:00
|
|
|
+$ state-two
|
|
|
|
$: tiles=(set tile:launch)
|
2020-03-20 22:06:10 +03:00
|
|
|
data=tile-data:launch
|
|
|
|
path-to-tile=(map path @tas)
|
|
|
|
first-time=?
|
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
+$ card card:agent:gall
|
2020-04-01 23:42:30 +03:00
|
|
|
++ launch-who
|
|
|
|
|= =desk
|
|
|
|
[%pass /who %arvo %e %serve [~ /who] desk /gen/who/hoon ~]
|
2019-11-21 02:39:46 +03:00
|
|
|
--
|
|
|
|
::
|
2020-04-02 02:12:39 +03:00
|
|
|
=| [%3 state-two]
|
2019-11-21 02:39:46 +03:00
|
|
|
=* state -
|
2020-03-12 03:33:48 +03:00
|
|
|
%- agent:dbug
|
2019-11-21 02:39:46 +03:00
|
|
|
^- agent:gall
|
|
|
|
|_ bol=bowl:gall
|
|
|
|
+* this .
|
|
|
|
def ~(. (default-agent this %|) bol)
|
|
|
|
++ on-init
|
|
|
|
^- (quip card _this)
|
2020-04-02 02:12:39 +03:00
|
|
|
:_ this(state *[%3 state-two])
|
2020-04-01 23:42:30 +03:00
|
|
|
:~ (launch-who q.byk.bol)
|
2020-03-31 02:04:40 +03:00
|
|
|
[%pass / %arvo %e %connect [~ /] %launch]
|
2020-03-28 05:58:15 +03:00
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
++ on-save !>(state)
|
|
|
|
::
|
|
|
|
++ on-load
|
|
|
|
|= old=vase
|
2020-03-20 22:06:10 +03:00
|
|
|
^- (quip card _this)
|
|
|
|
=/ old-state !<(versioned-state old)
|
2020-03-28 05:58:15 +03:00
|
|
|
=| cards=(list card)
|
2020-03-31 21:49:57 +03:00
|
|
|
|-
|
2020-03-20 22:06:10 +03:00
|
|
|
?- -.old-state
|
|
|
|
%0
|
2020-03-31 02:04:40 +03:00
|
|
|
$(old-state [%1 tiles data path-to-tile %.n]:old-state)
|
2020-03-20 22:06:10 +03:00
|
|
|
::
|
2020-03-31 21:49:57 +03:00
|
|
|
%1
|
|
|
|
=/ new-state=state-two
|
2020-04-02 02:12:39 +03:00
|
|
|
=, old-state
|
2020-03-31 02:04:40 +03:00
|
|
|
:* (~(del in tiles) [%contact-view /primary])
|
|
|
|
(~(del by data) %contact-view)
|
|
|
|
(~(del by path-to-tile) /primary)
|
|
|
|
first-time
|
2020-03-31 21:49:57 +03:00
|
|
|
==
|
2020-04-02 02:12:39 +03:00
|
|
|
$(old-state [%2 new-state])
|
2020-03-20 22:06:10 +03:00
|
|
|
::
|
2020-04-02 02:12:39 +03:00
|
|
|
%2
|
|
|
|
$(old-state [%3 +.old-state], cards [(launch-who q.byk.bol) cards])
|
|
|
|
::
|
|
|
|
%3
|
|
|
|
[(flop cards) this(state old-state)]
|
2020-03-20 22:06:10 +03:00
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
++ on-poke
|
|
|
|
|= [mar=mark vas=vase]
|
|
|
|
^- (quip card _this)
|
|
|
|
?+ mar (on-poke:def mar vas)
|
2020-03-20 22:06:10 +03:00
|
|
|
%json
|
|
|
|
?> (team:title our.bol src.bol)
|
|
|
|
=/ jon !<(json vas)
|
|
|
|
:- ~
|
|
|
|
?. =(jon [%s 'disable welcome message'])
|
|
|
|
this
|
|
|
|
this(first-time %.n)
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
%launch-action
|
|
|
|
=/ act !<(action:launch vas)
|
2020-03-26 00:53:12 +03:00
|
|
|
?- -.act
|
|
|
|
%add
|
|
|
|
=/ beforedata (~(get by data) name.act)
|
|
|
|
=/ newdata
|
|
|
|
?~ beforedata
|
|
|
|
(~(put by data) name.act [*json url.act])
|
|
|
|
(~(put by data) name.act [jon.u.beforedata url.act])
|
|
|
|
=/ new-tile `tile:launch`[`@tas`name.act `path`subscribe.act]
|
|
|
|
:- [%pass subscribe.act %agent [our.bol name.act] %watch subscribe.act]~
|
|
|
|
%= this
|
|
|
|
tiles (~(put in tiles) new-tile)
|
|
|
|
data newdata
|
|
|
|
path-to-tile (~(put by path-to-tile) subscribe.act name.act)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%remove
|
|
|
|
:- [%pass subscribe.act %agent [our.bol name.act] %leave ~]~
|
|
|
|
%= this
|
|
|
|
tiles (~(del in tiles) [name.act subscribe.act])
|
|
|
|
data (~(del by data) name.act)
|
|
|
|
path-to-tile (~(del by path-to-tile) subscribe.act)
|
|
|
|
==
|
2019-11-21 02:39:46 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
%handle-http-request
|
|
|
|
=+ !<([eyre-id=@ta =inbound-request:eyre] vas)
|
|
|
|
:_ this
|
|
|
|
%+ give-simple-payload:app eyre-id
|
|
|
|
%+ require-authorization:app inbound-request
|
|
|
|
|= =inbound-request:eyre
|
|
|
|
^- simple-payload:http
|
|
|
|
=/ request-line (parse-request-line url.request.inbound-request)
|
|
|
|
=/ name=@t
|
|
|
|
=/ back-path (flop site.request-line)
|
|
|
|
?~ back-path
|
|
|
|
''
|
|
|
|
i.back-path
|
|
|
|
?+ site.request-line
|
|
|
|
not-found:gen
|
|
|
|
::
|
2020-04-03 05:01:36 +03:00
|
|
|
[~ ~]
|
2019-11-21 02:39:46 +03:00
|
|
|
=/ hym=manx
|
2020-03-20 22:06:10 +03:00
|
|
|
%+ index
|
|
|
|
[%b first-time]
|
2019-11-21 02:39:46 +03:00
|
|
|
^- marl
|
|
|
|
%+ turn ~(tap by data)
|
|
|
|
|= [key=@tas [jon=json url=@t]]
|
|
|
|
^- manx
|
|
|
|
;script@"{(trip url)}";
|
|
|
|
(manx-response:gen hym)
|
|
|
|
::
|
|
|
|
[%'~launch' %css %index ~] :: styling
|
|
|
|
(css-response:gen style)
|
|
|
|
::
|
|
|
|
[%'~launch' %js %index ~] :: javascript
|
|
|
|
(js-response:gen script)
|
|
|
|
::
|
|
|
|
[%'~launch' %img *] :: images
|
|
|
|
=/ img=(unit @) (~(get by launch-png) `@ta`name)
|
|
|
|
?~ img
|
|
|
|
not-found:gen
|
|
|
|
(png-response:gen (as-octs:mimes:html u.img))
|
|
|
|
::
|
|
|
|
[%'~modulo' %session ~]
|
|
|
|
=/ session-js
|
|
|
|
%- as-octt:mimes:html
|
|
|
|
;: weld
|
|
|
|
"window.ship = '{+:(scow %p our.bol)}';"
|
|
|
|
"window.urb = new Channel();"
|
|
|
|
==
|
|
|
|
(js-response:gen session-js)
|
2020-03-28 01:24:37 +03:00
|
|
|
::
|
|
|
|
[%'~channel' %channel ~]
|
|
|
|
(js-response:gen channel-js)
|
2019-11-21 02:39:46 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ on-watch
|
|
|
|
|= pax=path
|
|
|
|
^- (quip card _this)
|
|
|
|
?: ?=([%http-response *] pax)
|
|
|
|
[~ this]
|
|
|
|
?. ?=([%main *] pax)
|
|
|
|
(on-watch:def pax)
|
|
|
|
=/ data=json
|
|
|
|
%- pairs:enjs:format
|
|
|
|
%+ turn ~(tap by data)
|
|
|
|
|= [key=@tas [jon=json url=@t]]
|
|
|
|
[key jon]
|
|
|
|
:_ this
|
|
|
|
[%give %fact ~ %json !>(data)]~
|
|
|
|
::
|
|
|
|
++ on-leave on-leave:def
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
++ on-fail on-fail:def
|
|
|
|
++ on-agent
|
|
|
|
|= [wir=wire sin=sign:agent:gall]
|
|
|
|
^- (quip card _this)
|
|
|
|
?. ?=(%fact -.sin)
|
|
|
|
(on-agent:def wir sin)
|
|
|
|
?. ?=(%json p.cage.sin)
|
|
|
|
(on-agent:def wir sin)
|
|
|
|
::
|
|
|
|
=/ jon=json !<(json q.cage.sin)
|
|
|
|
=/ name=@tas (~(got by path-to-tile) wir)
|
|
|
|
=/ dat=(unit [json url=@t]) (~(get by data) name)
|
|
|
|
?~ dat [~ this]
|
|
|
|
:_ this(data (~(put by data) name [jon url.u.dat]))
|
2019-12-22 23:12:28 +03:00
|
|
|
[%give %fact ~[/main] %json !>((frond:enjs:format name jon))]~
|
2019-11-21 02:39:46 +03:00
|
|
|
::
|
|
|
|
++ on-arvo
|
|
|
|
|= [wir=wire sin=sign-arvo]
|
|
|
|
^- (quip card:agent:gall _this)
|
|
|
|
?. ?=(%bound +<.sin)
|
|
|
|
(on-arvo:def wir sin)
|
|
|
|
[~ this]
|
|
|
|
--
|