simplify default-data handling

This commit is contained in:
Anton Dyudin 2015-12-10 15:46:25 -08:00
parent 3f31b23500
commit 98c538eee3
4 changed files with 5 additions and 14 deletions

View File

@ -29,7 +29,7 @@ $ ->
frag = window.tree.fragpath window.location.pathname
TreeActions.setCurr frag
TreeActions.loadPath frag,window.tree.body,window.tree.kids
TreeActions.loadPath frag,window.tree.data
rend (head {}, ""),$('#nav')[0]
rend (body {}, ""),$('#cont')[0]

View File

@ -1604,7 +1604,7 @@ $(function() {
TreePersistence = require('./persistence/TreePersistence.coffee');
frag = window.tree.fragpath(window.location.pathname);
TreeActions.setCurr(frag);
TreeActions.loadPath(frag, window.tree.body, window.tree.kids);
TreeActions.loadPath(frag, window.tree.data);
rend(head({}, ""), $('#nav')[0]);
rend(body({}, ""), $('#cont')[0]);
window.tree.util = {

View File

@ -2,19 +2,12 @@
/? 314
/- tree-include
/= gas /$ fuel
/= dat /^ tree-include
/: /===/tree-gen /%
/tree-include/
::
/= kid /^ (map span tree-include)
/: /===/tree-gen /% 2 /_
/tree-include/
/= dat /: /%%/ /% /json/ :: default include
::
!:
::::
::
=+ dez=(trip &2:%)
=+ kids-json=a/(turn (~(tap by kid)) |=([a=span *] (joba %name s/a)))
=+ aut=(~(has ju aut.ced.gas) %$ (scot %p p.bem.gas))
;html
;head
@ -38,9 +31,7 @@
[;script(type "text/javascript", src "/~/as/own/~/at/home/lib/urb.js");]~
==
;body
;+ =+ mime=(jobe mite/[%s (moon p.mime.dat)] octs/[%s q.q.mime.dat] ~) :: XX factor out
=+ inject=(jobe kids/kids-json body/body.dat ?.(aut ~ [mime/mime]~))
;script(type "text/javascript"): window.tree = {(pojo inject)}
;script(type "text/javascript"): window.tree = {(pojo (joba %data dat))}
;div#nav;
;div#cont;
==

View File

@ -74,6 +74,6 @@
[tree .]
^- json
=+ ^= schem
=+ seh=(fall (~(get by qix.gas) 'q') 'body.r')
=+ seh=(fall (~(get by qix.gas) 'q') 'spur.t_mime.m_body.r_kids.name.t')
~|(bad-noun/seh ;;(schema (rash seh read-schem)))
(from-queries bem.gas(s but.gas) (to-queries schem))