urbit/main/app/demo/core.hook

59 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-09-25 04:37:29 +04:00
/- demo-args
2014-07-06 20:57:37 +04:00
!:
2014-07-29 03:43:33 +04:00
::::::::: Appbug: a simple application.
2014-06-25 02:00:07 +04:00
::
|_ [hid=hide vat=[%0 p=@ud]]
++ poke
2014-09-25 04:37:29 +04:00
|= [ost=bone you=ship *]
2014-06-25 02:00:07 +04:00
:_ +>(p.vat +(p.vat))
2014-09-25 04:37:29 +04:00
~& %poke
:~ [ost %give %nice ~]
2014-06-25 02:00:07 +04:00
==
::
2014-09-25 04:37:29 +04:00
++ poke-demo-args
|= [ost=bone you=ship arg=demo-args]
~& [%poke-demo-args arg]
:_ +>(p.vat +(p.vat))
:* [ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
2014-09-26 04:10:17 +04:00
:- ost
2014-09-26 04:54:51 +04:00
:^ %give %rush %wut
[p.arg %says q.arg]
2014-09-25 04:37:29 +04:00
==
::
2014-09-24 05:03:20 +04:00
++ peer
|= [ost=bone you=ship pax=path]
2014-09-25 04:37:29 +04:00
?^ pax
:_ +>.$ :_ ~
[ost %give %rust %txt (crip "demo peeking {<p.vat>}")]
2014-09-24 05:03:20 +04:00
:_ +>.$ :_ ~
:+ ost %give
:- %meta
!>
:+ %rust %hymn
2014-06-25 02:00:07 +04:00
^- manx
;html
;head
2014-08-06 02:09:19 +04:00
;title: Demo!
;script: urb.appl = '{(trip app.hid)}'
2014-06-25 02:00:07 +04:00
==
;body
2014-08-06 02:09:19 +04:00
;p: State is {<p.vat>}.
2014-07-01 00:07:56 +04:00
;button(onclick "bump()"): (Bump.)
2014-06-25 02:00:07 +04:00
;script
2014-08-06 02:09:19 +04:00
; var mess = 0
;
2014-06-25 02:00:07 +04:00
; function bump() {
2014-08-06 02:09:19 +04:00
; xhr = new XMLHttpRequest()
; xhr.onload = function() { mess++}
; xhr.open("PUT", "/tim/" + [urb.user, urb.port, mess].join("/"))
; xhr.setRequestHeader("content-type", "text/json")
; xyro = {ship: urb.ship, appl: urb.appl, data: {}}
; xhr.send(JSON.stringify({oryx: urb.oryx, xyro: xyro}))
2014-06-25 02:00:07 +04:00
; }
==
==
==
--