diff --git a/README.md b/README.md index 921bba13..cf3370c4 100644 --- a/README.md +++ b/README.md @@ -1003,7 +1003,7 @@ available functions: * `$lpad(text, length, pad_char)` * `$rpad(text, length, pad_char)` -two counters are available; `.n.s` is the nth file in the selection, and `.n.d` the nth file in the folder, for example rename-output `file(.n.d).(ext)` gives `file5.bin`, and `beach-$lpad((.n.s),3,0).(ext)` is `beach-017.jpg` +two counters are available; `.n.s` is the nth file in the selection, and `.n.d` the nth file in the folder, for example rename-output `file(.n.d).(ext)` gives `file5.bin`, and `beach-$lpad((.n.s),3,0).(ext)` is `beach-017.jpg` and the initial value of each counter can be set in the textboxes underneath the preset dropdown so, diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 0a0afc5c..25d417d2 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1939,6 +1939,8 @@ html.y #tree.nowrap .ntree a+a:hover { #rui td input[type="text"] { width: 100%; } +#rui #rn_n_d, +#rui #rn_n_s, #shui td.exs input[type="text"] { width: 3em; } diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 030a7d97..880d295e 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -15944,11 +15944,16 @@ var fileman = (function () { var f = [], sn = ++r.sn, base = vsplit(sel[0].vp)[0], + s2d = {}, mkeys; r.f = f; + r.n_s = 1; + r.n_d = 1; for (var a = 0; a < sel.length; a++) { + s2d[a] = all.indexOf(sel[a]); + var vp = sel[a].vp; if (vp.endsWith('/')) vp = vp.slice(0, -1); @@ -15961,8 +15966,7 @@ var fileman = (function () { mkeys = [".n.d", ".n.s"].concat(vars[1], vars[2]); var md = vars[0]; - md[".n.s"] = '' + (1 + a); - md[".n.d"] = '' + (1 + all.indexOf(sel[a])); + md[".n.s"] = md[".n.d"] = 0; for (var k in md) { if (!md.hasOwnProperty(k)) continue; @@ -16009,6 +16013,10 @@ var fileman = (function () { '
n.d=
',
+ 'n.s=
',
+ '