wok rev 24568

sokojs: add shrink.sh (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 26 16:37:15 2022 +0000 (2022-02-26)
parents 035e82f04c94
children 36a1e6790d10
files sokojs/stuff/shrink.sh
line diff
     1.1 --- a/sokojs/stuff/shrink.sh	Sat Feb 26 15:02:05 2022 +0000
     1.2 +++ b/sokojs/stuff/shrink.sh	Sat Feb 26 16:37:15 2022 +0000
     1.3 @@ -37,11 +37,12 @@
     1.4    } 
     1.5    else if (/^Row/) print "Row=" row " //!" $0
     1.6    else if (/^Col/) print "Col=" col-begin-end+length(tab) " //!" $0
     1.7 -  else if (/[0-9]\\">",$/) {
     1.8 +  else if (/\\"[0-9]*\\">",$/ && n != 0) {
     1.9      s=$0; sub(/.*value=\\"/,"",s); sub(/\\">.*/,"",s)
    1.10      l=length(line[0])-3; n-=cut+row; begin-=length(tab)
    1.11      n=s - (l*n) - begin - ((begin+end)*(int(s/l)-n))
    1.12      print "document.write(\"<INPUT TYPE=\\\"button\\\" value=\\\"" n "\\\">\", //!" $0
    1.13 +    n=0
    1.14    }
    1.15    else print }' < $file > $file.$$
    1.16  		mv -f $file.$$ $file