# HG changeset patch # User HIROSE Yuuji # Date 1630887085 -32400 # Node ID 6c2f8bb3cc6e7b76b09f958eaaabae1da9ff954f # Parent 627a7fdf3e1673c9cd1edee188d1339cfb596779 Activate direct link to attached files diff -r 627a7fdf3e16 -r 6c2f8bb3cc6e s4-blog.sh --- a/s4-blog.sh Tue Aug 17 09:46:29 2021 +0900 +++ b/s4-blog.sh Mon Sep 06 09:11:25 2021 +0900 @@ -507,6 +507,7 @@ for i in $imgids; do mrid=${i%%:*}; i=${i#*:}; sz=`size_h ${i%%:*}` _href="href=\"$catlink+$mrid\"" + _href_raw="href=\"$catlink+$mrid+raw\"" fn=`echo "${i#*:}"|unhexize` fnb=$fn"(${sz})" case "$fn" in @@ -553,7 +554,8 @@ fi ;; *) - echo "<__UNCLICKABLE__>$fnb" + echo -n "<__UNCLICKABLE__>$fnb" + echo "[Direct]" ;; esac done diff -r 627a7fdf3e16 -r 6c2f8bb3cc6e s4-main.js --- a/s4-main.js Tue Aug 17 09:46:29 2021 +0900 +++ b/s4-main.js Mon Sep 06 09:11:25 2021 +0900 @@ -90,8 +90,8 @@ text = td.textContent, author = tr.getElementsByTagName("a"); if (author) author = author[0].getAttribute("title"); - if (href.match(/\?showattc\+article_m\+([0-9+])/)) { - if (td.innerHTML.match(/x読み取り不可/)) { + if (href.match(/\?showattc\+article_m\+([0-9]+)$/)) { + if (td.innerHTML.match(/読み取り不可/)) { a.removeAttribute("href"); continue; }