changeset 513:3fcaea2892a8

File accept warnings added
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 02 Apr 2019 17:34:31 +0900
parents 24a5010a131b
children fa3f78ce3e26
files s4-blog.sh s4-funcs.sh
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/s4-blog.sh	Thu Mar 14 16:23:50 2019 +0900
+++ b/s4-blog.sh	Tue Apr 02 17:34:31 2019 +0900
@@ -397,14 +397,16 @@
 ' *語群* ' で強調(両側の空白必要、** でもっと強調。*の代わりに _ でも可)
 - [ ] と - [x] でチェックボックス"
   touchhelp="${touchpanel:+<p class=\"help\">$help</p>}"
+  filehelp="《添付の注意》
+$file_accept_help"
   textform='<div class="fold">
 <input type="checkbox" id="cmt" checked><label
  accesskey="c" title="C" for="cmt">コメントする</label><div>
 <table class="b">
 <tr><td><textarea name="text" cols="72" rows="4" title="'"$help"'">
-</textarea>'"$touchhelp"'</td></tr>
-<tr><td>添付ファイル:
-<input type="file" name="image"'" $file_accept multiple></td></tr>"'
+</textarea>'"$touchhelp</td></tr>
+<tr><td>添付ファイル(${filesize_max_MB}以下):"'
+<input type="file" name="image"'" $file_accept title=\"$filehelp\" multiple></td></tr>"'
 </table>
 <input type="submit" value="送信">
 <input type="reset" value="リセット"></div></div>
--- a/s4-funcs.sh	Thu Mar 14 16:23:50 2019 +0900
+++ b/s4-funcs.sh	Tue Apr 02 17:34:31 2019 +0900
@@ -30,11 +30,14 @@
 maximagexy=1600x1600
 ### maximagexy=400x400
 filesize_max=$((5*1024*1024))
+filesize_max_MB="$((filesize_max/1024/1024))MB"
 file_accept='accept="image/*,text/*,audio/*,application/vnd.oasis.*,application/pdf,application/x-*"'
 file_accept_egrep='^(text/|message/|image/|audio/|video/|application/(vnd.oasis|pdf|epub|xml|zip||[xz]-))'
-file_warn="
-添付可能ファイル: 5MB以内のテキスト、画像、音声、動画、ODT、PDF、
+file_accept_help="添付可能ファイル: テキスト、画像、音声、動画、ODT、PDF、
 圧縮ファイル、データベースファイル
+(いずれも ${filesize_max_MB} 以内)
+"
+file_warn="$file_accept_help
 [編集]リンクから修正してください。"
 blogreadflagrowid=0
 blogcutoffflagrowid=-1

yatex.org