urbit/main/app/demo/core.hook

42 lines
914 B
Plaintext
Raw Normal View History

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
|= [ost=bone *]
2014-06-25 02:00:07 +04:00
:_ +>(p.vat +(p.vat))
:~ [ost %give %nice ~]
2014-06-25 02:00:07 +04:00
==
::
++ peek
|= [you=ship pax=path]
2014-09-23 03:06:55 +04:00
?^ pax
2014-09-23 05:00:25 +04:00
[%txt (crip "demo peeking {<p.vat>}")]
2014-06-25 02:00:07 +04:00
:- %hymn
^- 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
; }
==
==
==
--