s4
changeset 939:6c2f8bb3cc6e
Activate direct link to attached files
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Mon, 06 Sep 2021 09:11:25 +0900 |
parents | 627a7fdf3e16 |
children | 102c2b14c5d8 |
files | s4-blog.sh s4-main.js |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line diff
1.1 --- a/s4-blog.sh Tue Aug 17 09:46:29 2021 +0900 1.2 +++ b/s4-blog.sh Mon Sep 06 09:11:25 2021 +0900 1.3 @@ -507,6 +507,7 @@ 1.4 for i in $imgids; do 1.5 mrid=${i%%:*}; i=${i#*:}; sz=`size_h ${i%%:*}` 1.6 _href="href=\"$catlink+$mrid\"" 1.7 + _href_raw="href=\"$catlink+$mrid+raw\"" 1.8 fn=`echo "${i#*:}"|unhexize` 1.9 fnb=$fn"(${sz})" 1.10 case "$fn" in 1.11 @@ -553,7 +554,8 @@ 1.12 fi 1.13 ;; 1.14 *) 1.15 - echo "<__UNCLICKABLE__><a $_href><img src=\"$deficon\">$fnb</a>" 1.16 + echo -n "<__UNCLICKABLE__><a $_href><img src=\"$deficon\">$fnb</a>" 1.17 + echo "[<a ${_href_raw}>Direct</a>]" 1.18 ;; 1.19 esac 1.20 done
2.1 --- a/s4-main.js Tue Aug 17 09:46:29 2021 +0900 2.2 +++ b/s4-main.js Mon Sep 06 09:11:25 2021 +0900 2.3 @@ -90,8 +90,8 @@ 2.4 text = td.textContent, 2.5 author = tr.getElementsByTagName("a"); 2.6 if (author) author = author[0].getAttribute("title"); 2.7 - if (href.match(/\?showattc\+article_m\+([0-9+])/)) { 2.8 - if (td.innerHTML.match(/x読み取り不可/)) { 2.9 + if (href.match(/\?showattc\+article_m\+([0-9]+)$/)) { 2.10 + if (td.innerHTML.match(/読み取り不可/)) { 2.11 a.removeAttribute("href"); 2.12 continue; 2.13 }