From d12add8d23ea8c1fead48b9385531d91dc381cb0 Mon Sep 17 00:00:00 2001 From: s-ol Date: Sat, 24 Nov 2018 18:11:58 +1100 Subject: fix hyphens in fileder names --- build/render_fileder.moon | 1 + mmm/component/init.server.moon | 2 +- mmm/dom/init.server.moon | 2 +- mmm/mmmfs/browser.moon | 2 +- mmm/mmmfs/fileder.moon | 4 ++-- mmm/ordered.moon | 11 ++++++----- root/games/vision-training-kit/description: text$plain | 1 + root/games/vision-training-kit/icon: image$png.png | Bin 0 -> 16412 bytes root/games/vision-training-kit/title: text$plain | 1 + root/games/vision_training_kit/description: text$plain | 1 - root/games/vision_training_kit/icon: image$png.png | Bin 16412 -> 0 bytes root/games/vision_training_kit/title: text$plain | 1 - root/text$moonscript -> fn -> mmm$dom.moon | 1 - 13 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 root/games/vision-training-kit/description: text$plain create mode 100755 root/games/vision-training-kit/icon: image$png.png create mode 100644 root/games/vision-training-kit/title: text$plain delete mode 100644 root/games/vision_training_kit/description: text$plain delete mode 100755 root/games/vision_training_kit/icon: image$png.png delete mode 100644 root/games/vision_training_kit/title: text$plain diff --git a/build/render_fileder.moon b/build/render_fileder.moon index f3bae31..b143f82 100644 --- a/build/render_fileder.moon +++ b/build/render_fileder.moon @@ -67,6 +67,7 @@ with io.open 'index.html', 'w' + diff --git a/mmm/component/init.server.moon b/mmm/component/init.server.moon index 300e3d7..7c7fb7e 100644 --- a/mmm/component/init.server.moon +++ b/mmm/component/init.server.moon @@ -98,7 +98,7 @@ class ReactiveElement render: => b = "<#{@element}" - for k,v in opairs @attrs + for k,v in opairs @attrs, nil, true if 'table' == type v tmp = '' for kk, vv in opairs v diff --git a/mmm/dom/init.server.moon b/mmm/dom/init.server.moon index b0a8c85..fedd109 100644 --- a/mmm/dom/init.server.moon +++ b/mmm/dom/init.server.moon @@ -14,7 +14,7 @@ element = (element) -> (...) -> attributes = {} b = "<#{element}" - for k,v in opairs attributes + for k,v in opairs attributes, nil, true if k == 'style' and 'table' == type v tmp = '' for kk, vv in opairs v diff --git a/mmm/mmmfs/browser.moon b/mmm/mmmfs/browser.moon index dd1ab9e..ef5544b 100644 --- a/mmm/mmmfs/browser.moon +++ b/mmm/mmmfs/browser.moon @@ -80,7 +80,7 @@ class Browser \append path_segment 'root', '' while path - name, rest = path\match '^([%w-_%.]+)/(.*)' + name, rest = path\match '^([%w%-_%.]+)/(.*)' if not name name = path diff --git a/mmm/mmmfs/fileder.moon b/mmm/mmmfs/fileder.moon index 114ec75..019a814 100644 --- a/mmm/mmmfs/fileder.moon +++ b/mmm/mmmfs/fileder.moon @@ -72,10 +72,10 @@ class Fileder -- * path - the path to walk to walk: (path) => -- early-out if we are outside of the path already - return unless path\match '^' .. @path + return unless @path == path\sub 1, #@path -- gotcha - return @ if path == @path + return @ if #path == #@path for child in *@children result = child\walk path diff --git a/mmm/ordered.moon b/mmm/ordered.moon index 59c07bf..cdb0e29 100644 --- a/mmm/ordered.moon +++ b/mmm/ordered.moon @@ -1,7 +1,7 @@ -- ordered table iterator, for stable(r) renderers -sort = (t, order_fn) -> - with index = [k for k,v in pairs t when 'string' == type k] +sort = (t, order_fn, only_strings) -> + with index = [k for k,v in pairs t when (not only_strings) or 'string' == type k] table.sort index, order_fn -- ordered next(t) @@ -12,12 +12,13 @@ onext = (state, key) -> if key = index[i] key, t[key] --- ordered pairs(t). order_fn is optional; see table.sort -opairs = (t, order_fn) -> +-- ordered pairs(t). +-- order_fn is optional; see table.sort +opairs = (t, order_fn, only_strings=false) -> state = { :t, i: 0, - index: sort t, order_fn + index: sort t, order_fn, only_strings } onext, state, nil diff --git a/root/games/vision-training-kit/description: text$plain b/root/games/vision-training-kit/description: text$plain new file mode 100644 index 0000000..0511e77 --- /dev/null +++ b/root/games/vision-training-kit/description: text$plain @@ -0,0 +1 @@ +a puzzle game based on a famicase cartridge design. diff --git a/root/games/vision-training-kit/icon: image$png.png b/root/games/vision-training-kit/icon: image$png.png new file mode 100755 index 0000000..ef73861 Binary files /dev/null and b/root/games/vision-training-kit/icon: image$png.png differ diff --git a/root/games/vision-training-kit/title: text$plain b/root/games/vision-training-kit/title: text$plain new file mode 100644 index 0000000..d131a1c --- /dev/null +++ b/root/games/vision-training-kit/title: text$plain @@ -0,0 +1 @@ +視能訓練キット | vision-training-kit diff --git a/root/games/vision_training_kit/description: text$plain b/root/games/vision_training_kit/description: text$plain deleted file mode 100644 index 0511e77..0000000 --- a/root/games/vision_training_kit/description: text$plain +++ /dev/null @@ -1 +0,0 @@ -a puzzle game based on a famicase cartridge design. diff --git a/root/games/vision_training_kit/icon: image$png.png b/root/games/vision_training_kit/icon: image$png.png deleted file mode 100755 index ef73861..0000000 Binary files a/root/games/vision_training_kit/icon: image$png.png and /dev/null differ diff --git a/root/games/vision_training_kit/title: text$plain b/root/games/vision_training_kit/title: text$plain deleted file mode 100644 index d131a1c..0000000 --- a/root/games/vision_training_kit/title: text$plain +++ /dev/null @@ -1 +0,0 @@ -視能訓練キット | vision-training-kit diff --git a/root/text$moonscript -> fn -> mmm$dom.moon b/root/text$moonscript -> fn -> mmm$dom.moon index f1e8ce1..7841095 100644 --- a/root/text$moonscript -> fn -> mmm$dom.moon +++ b/root/text$moonscript -> fn -> mmm$dom.moon @@ -1,5 +1,4 @@ import article, h1, h3, div, b, p, a, br, ul, tt, li, img from require 'mmm.dom' -import opairs from require 'mmm.ordered' => append, finish = do -- cgit v1.2.3