summaryrefslogtreecommitdiff
path: root/desk/mar/kaji.hoon
blob: 4061b49724aa64e3bc580d54521c6bc8dbaccaac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
::
::::  /hoon/kaji/mar
  ::
/?    310
/+  kaji
::::  A kaji html string mark
|_  efs=(list effect:kaji)  :: this only affects +grow
++  grab  |%
          ++  noun  @
          ++  json  |=  jon=^json 
          =/  mp  ((om:dejs:format so:dejs:format) jon)
          =/  action  ~|  'action not set by web input'  (~(got by mp) 'action')
          :-  action  (~(del by mp) 'action')
          --
++  grow  |%
          ++  noun  efs
          ::  for scries
          :: ++  mime  [/application/x-urb-jam (as-octs:mimes:html (crip (en-xml:html *manx)))]
          ::  for facts
          ++  json  =,  enjs:format
          |^  :-  %a  %+  turn  efs  |=  e=effect:kaji  %+  frond  -.e  
          ?-  -.e
            %refresh  ~
            %redi    [%s url.e]
            %focus   [%s sel.e]
            %scroll  [%s sel.e]
            %url     [%s url.e]
            %custom  %-  pairs 
                     :~  [%manx %s (crip (en-xml:html manx.e))] 
                         [%event data.e]
                     ==
            %modal   %+  frond  %manx  [%s (crip (en-xml:html manx.e))]
            %alert   %-  pairs  
                     :~  [%manx %s (crip (en-xml:html manx.e))] 
                         [%duration (numb dur.e)]
                     ==
            %swap    %-  pairs
                     :~  [%manx %s (crip (en-xml:html manx.e))] 
                         [%sel %s sel.e]
                         [%inner %b inner.e]
                     ==
            %add     %-  pairs
                     :~  [%manx %s (crip (en-xml:html manx.e))] 
                         [%container %s container.e]
                         [%where (en-where where.e)]
                     ==
          ==
          ++  en-where  |=  w=where.kaji  %+  frond  -.w
            ?-  -.w
              %top     ~  
              %bottom  ~
              %before  [%s sibling.w]
            ==
          --
          --
--