diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-10-27 12:30:51 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-10-27 12:30:51 +0000 |
| commit | 663fb844b28771c62409d6924f783ea2a69c393a (patch) | |
| tree | 9a45ac374b23b92591ee25fc144771311b45948a | |
| parent | infinite table for lib.component (diff) | |
| download | mmm-663fb844b28771c62409d6924f783ea2a69c393a.tar.gz mmm-663fb844b28771c62409d6924f783ea2a69c393a.zip | |
render mmmfs in client
| -rw-r--r-- | app/init.moon | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/init.moon b/app/init.moon index e1f7a75..7d810cb 100644 --- a/app/init.moon +++ b/app/init.moon @@ -15,7 +15,7 @@ client_goto = -> { :location } = window if module = location.search\match 'client=([%w_]+)' document.body.innerHTML = '' - require 'app.' .. module + require "app.#{module}" experiments = { { @@ -49,6 +49,7 @@ experiments = { { name: 'mmmfs' desc: 'an operating, file- and living system' + render: 'client' }, } @@ -93,9 +94,14 @@ table.insert routes, { on_client client_goto } +load = (module) -> require "app.#{module}" + destify = (route) -> with route .route or= .name .dest or= "#{.route}/index.html" + + if .render == 'client' + .render = -> on_client load, .name .render or= -> require '.' .. .name routes = [ destify route for route in *routes ] |
