From d0c6f879f2e007dc1323a0ba0af4b8507b4fdbb9 Mon Sep 17 00:00:00 2001 From: s-ol Date: Fri, 23 Nov 2018 18:35:29 +1100 Subject: loading animations --- root/Tupdefault.lua | 11 ++++++++--- root/articles/text$moonscript -> fn -> mmm$dom.moon | 18 +++++------------- .../text$moonscript -> fn -> mmm$dom.moon | 18 +++++------------- root/games/text$moonscript -> fn -> mmm$dom.moon | 3 ++- root/meta/text$moonscript -> fn -> mmm$dom.moon | 20 ++++++-------------- root/projects/text$moonscript -> fn -> mmm$dom.moon | 16 ++++------------ root/text$moonscript -> fn -> mmm$dom.moon | 1 + 7 files changed, 31 insertions(+), 56 deletions(-) (limited to 'root') diff --git a/root/Tupdefault.lua b/root/Tupdefault.lua index 039edf0..7616065 100644 --- a/root/Tupdefault.lua +++ b/root/Tupdefault.lua @@ -2,9 +2,14 @@ local LUA_PATH = lua_path() bundle = LUA_PATH .. ' moon ' .. build .. '/bundle_fileder.moon' render = LUA_PATH .. ' moon ' .. build .. '/render_fileder.moon' --- @TODO: whish there was a better glob for this? -facets = tup.glob '*$*' -inputs = '' +local _facets, facets = {}, {} +for i, file in ipairs(tup.glob '*$*') do _facets[file] = true end +for i, file in ipairs(tup.glob '*:*') do _facets[file] = true end + +for file in pairs(_facets) do facets += file end +table.sort(facets) + +local inputs = '' for i, file in ipairs(facets) do inputs = inputs .. " '" .. file .. "'" end diff --git a/root/articles/text$moonscript -> fn -> mmm$dom.moon b/root/articles/text$moonscript -> fn -> mmm$dom.moon index 1c04309..864b604 100644 --- a/root/articles/text$moonscript -> fn -> mmm$dom.moon +++ b/root/articles/text$moonscript -> fn -> mmm$dom.moon @@ -1,18 +1,10 @@ -import div, h3, ul, li, a from require 'mmm.dom' +import div, h3, ul, li from require 'mmm.dom' +import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom' => div { - h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, + link_to @, h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, ul for child in *@children - name = child\gett 'name: alpha' - desc = child\gett 'description: text/plain' - li { - a name, { - href: child.path, - onclick: (e) => - e\preventDefault! - BROWSER\navigate child.path - }, - ': ', desc - } + desc = child\gett 'description: mmm/dom' + li (link_to child), ': ', desc } diff --git a/root/experiments/text$moonscript -> fn -> mmm$dom.moon b/root/experiments/text$moonscript -> fn -> mmm$dom.moon index 1c04309..864b604 100644 --- a/root/experiments/text$moonscript -> fn -> mmm$dom.moon +++ b/root/experiments/text$moonscript -> fn -> mmm$dom.moon @@ -1,18 +1,10 @@ -import div, h3, ul, li, a from require 'mmm.dom' +import div, h3, ul, li from require 'mmm.dom' +import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom' => div { - h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, + link_to @, h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, ul for child in *@children - name = child\gett 'name: alpha' - desc = child\gett 'description: text/plain' - li { - a name, { - href: child.path, - onclick: (e) => - e\preventDefault! - BROWSER\navigate child.path - }, - ': ', desc - } + desc = child\gett 'description: mmm/dom' + li (link_to child), ': ', desc } diff --git a/root/games/text$moonscript -> fn -> mmm$dom.moon b/root/games/text$moonscript -> fn -> mmm$dom.moon index 8609678..0139841 100644 --- a/root/games/text$moonscript -> fn -> mmm$dom.moon +++ b/root/games/text$moonscript -> fn -> mmm$dom.moon @@ -1,8 +1,9 @@ import div, h3, ul, li, a, h4, img, p from require 'mmm.dom' +import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom' => div { - h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, + link_to @, h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, ul with for child in *@children link_if_content = (opts) -> a with opts diff --git a/root/meta/text$moonscript -> fn -> mmm$dom.moon b/root/meta/text$moonscript -> fn -> mmm$dom.moon index 65ba93f..9062ae3 100644 --- a/root/meta/text$moonscript -> fn -> mmm$dom.moon +++ b/root/meta/text$moonscript -> fn -> mmm$dom.moon @@ -1,25 +1,17 @@ -import div, h3, p, br, ul, li, b, a from require 'mmm.dom' +import div, h3, p, br, ul, li, i from require 'mmm.dom' +import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom' => div { style: { 'max-width': '700px' }, - h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, + link_to @, h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, p "mmm is a collection of Lua/Moonscript modules for web development. - All modules are 'polymorphic' - they can run in the ", (b 'browser'), + All modules are 'polymorphic' - they can run in the ", (i 'browser'), ", using the native browser API for creating and interacting with DOM content, as well as on the ", - (b 'server'), ", where they operate on and produce equivalent HTML strings." + (i 'server'), ", where they operate on and produce equivalent HTML strings." p "As the two implementations of each module are designed to be compatible, mmm facilitates code and content sharing between server and client and enables serverside rendering and rehydration." ul for child in *@children - name = child\gett 'name: alpha' desc = child\gett 'description: mmm/dom' - li { - a name, { - href: child.path, - onclick: (e) => - e\preventDefault! - BROWSER\navigate child.path - }, - ': ', desc - } + li (link_to child), ': ', desc } diff --git a/root/projects/text$moonscript -> fn -> mmm$dom.moon b/root/projects/text$moonscript -> fn -> mmm$dom.moon index be9f35f..864b604 100644 --- a/root/projects/text$moonscript -> fn -> mmm$dom.moon +++ b/root/projects/text$moonscript -> fn -> mmm$dom.moon @@ -1,18 +1,10 @@ -import div, h3, ul, li, a from require 'mmm.dom' +import div, h3, ul, li from require 'mmm.dom' +import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom' => div { - h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, + link_to @, h3 @gett 'title: text/plain', style: { 'margin-bottom': '-.5em' }, ul for child in *@children - name = child\gett 'name: alpha' desc = child\gett 'description: mmm/dom' - li { - a name, { - href: child.path, - onclick: (e) => - e\preventDefault! - BROWSER\navigate child.path - }, - ': ', desc - } + li (link_to child), ': ', desc } diff --git a/root/text$moonscript -> fn -> mmm$dom.moon b/root/text$moonscript -> fn -> mmm$dom.moon index 5b4f3e0..f1e8ce1 100644 --- a/root/text$moonscript -> fn -> mmm$dom.moon +++ b/root/text$moonscript -> fn -> mmm$dom.moon @@ -22,6 +22,7 @@ import opairs from require 'mmm.ordered' } for child in *@children + continue if child\get 'hidden: bool' append div { class: 'well' (child\get 'preview: mmm/dom') or child\get 'mmm/dom' -- cgit v1.2.3