changeset 156:d46bce9072cd

Add link to '#bottom', recover function of auto href at the beg.of line
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 06 Jan 2016 23:07:05 +0859
parents 511406c0cbbe
children 3b2963de55ce
files s4-blog.sh
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/s4-blog.sh	Tue Jan 05 18:47:59 2016 +0859
+++ b/s4-blog.sh	Wed Jan 06 23:07:05 2016 +0859
@@ -282,9 +282,10 @@
     href2="<a href=\"?lshandout+$rowid\"> 提出状況 </a>"
     href3="(<a href=\"?gethandout+$rowid\">ファイル取得</a>)"
   fi
+  href4='<a href="#bottom"> 末尾へ</a>'
   cat<<EOF | sq -html $db \
       | sed -e "s|\(<TR><TD>\),e,|\1 $href |" \
-	    -e "s|,s,\(</TD>\)|$href2$href3\1|"
+	    -e "s|,s,\(</TD>\)|$href2$href3$href4\1|"
 -- select val from $ts where key="title" and id="$id";
 select
  coalesce((select ",e," from blog where rowid=$rowid and author='$user'),'')
@@ -371,12 +372,13 @@
   ON a.id=s.id;
 EOF
     while IFS='|' read id edit uid uname tm hte imgids; do
-      cat<<EOF
+      cat<<EOF |
 <tr id="$id">
 <td>${edit:+<a href="$elink+$edit">編集</a>}
 <a href="$hlink+$uid">$uname</a>
 $tm</td><td>`echo "$hte"|unhexize|htmlescape`
 EOF
+      sed -e "s|^href=\([-A-Za-z0-9,.:/~_%#&+?]*\)|<a &>\1</a>|"
       for i in $imgids; do
 	mrid=${i%%:*}; i=${i#*:}; sz=`size_h ${i%%:*}`
 	fn=`echo "${i#*:}"|unhexize`
@@ -721,7 +723,8 @@
   echo "$subtitle" > $tmpd/subtitle.$$
   ${BLOG_SHOW:-blog_showentry} blog $rowid \
       | m4 -D_TITLE_="spaste(\`$tmpd/title.$$')" -D_BODYCLASS_=general \
-	   -D_FORMHEAD_="spaste(\`$tmpd/subtitle.$$')" -D_FORM_="" \
+	   -D_FORMHEAD_="spaste(\`$tmpd/subtitle.$$')" \
+	   -D_FORM_='' \
 	   -D_DUMPTABLE_="syscmd(cat)" -D_DUMPHEAD_="" \
 	   $layout/html.m4.html $layout/form+dump-whead.m4.html
 }

yatex.org