Mercurial > hgrepos > hgweb.cgi > s4
comparison s4-cgi.sh @ 1013:1ffaa8b2b1bf draft
Modify blog comment form layout
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Tue, 11 Jul 2023 10:25:21 +0900 |
parents | 5d70fa029f8d |
children |
comparison
equal
deleted
inserted
replaced
1012:8de17709d0a2 | 1013:1ffaa8b2b1bf |
---|---|
58 ## err cgi_file: \$1=$1 \$2=$2 \$3="[$3]" | 58 ## err cgi_file: \$1=$1 \$2=$2 \$3="[$3]" |
59 # Using global variable $dir | 59 # Using global variable $dir |
60 case "$3" in | 60 case "$3" in |
61 *multiple*) | 61 *multiple*) |
62 onemore='<button type="button" id="morefile" title="More attachment file">添付追加</button>' | 62 onemore='<button type="button" id="morefile" title="More attachment file">添付追加</button>' |
63 multiple="$nl$onemore" | 63 # multiple="$nl$onemore" |
64 ;; | 64 ;; |
65 esac | 65 esac |
66 if [ -n "$2" -a -s "$dir/$2" ]; then | 66 if [ -n "$2" -a -s "$dir/$2" ]; then |
67 file=$dir/$2 | 67 file=$dir/$2 |
68 bn=${file##*/} | 68 bn=${file##*/} |
69 ct=`file --mime-type - < "$dir/$2" | cut -d' ' -f2` | 69 ct=`file --mime-type - < "$dir/$2" | cut -d' ' -f2` |
70 data=`percenthex "$file"` | 70 data=`percenthex "$file"` |
71 icon="<img src=\"data:$ct,$data\">" | 71 icon="<img src=\"data:$ct,$data\">" |
72 fi | 72 fi |
73 cat<<EOF | 73 cat<<EOF |
74 ${icon} | 74 <span class="fileinput">${icon} <!-- keep line hight --> |
75 <input type="file" name="$1" value="$bn" $3>$multiple | 75 <input type="file" name="$1" value="$bn" $3$multiple> |
76 </span>$onemore | |
76 EOF | 77 EOF |
77 ) | 78 ) |
78 cgi_multi() ( | 79 cgi_multi() ( |
79 # $1=name $2=dir $3=func $4=args... | 80 # $1=name $2=dir $3=func $4=args... |
80 # `dir' should contain $name.count and $name.N where N is 1 upto N | 81 # `dir' should contain $name.count and $name.N where N is 1 upto N |