changeset 976:ae6c5df09f22 draft

Add class="author" to link of author
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 29 May 2022 08:36:39 +0900
parents ec5cb1790119
children eb0ffd3b37c0
files s4-blog.sh s4-main.js
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/s4-blog.sh	Sun May 29 07:55:44 2022 +0900
+++ b/s4-blog.sh	Sun May 29 08:36:39 2022 +0900
@@ -505,7 +505,7 @@
 	cat<<EOF
 <tr id="$id">
 <td class="$tdcls">${picon}__EDIT__<a href="#$aid">#$aid</a>
-<a href="$hlink+$uid" title="${author%@*}">`echo $uname|htmlescape`</a>
+<a class="author" href="$hlink+$uid" title="${author%@*}">`echo $uname|htmlescape`</a>
 <span title="$tm">${reki:-$tm}</span>
 <__NOTIFY__></td>
 EOF
--- a/s4-main.js	Sun May 29 07:55:44 2022 +0900
+++ b/s4-main.js	Sun May 29 08:36:39 2022 +0900
@@ -1040,8 +1040,7 @@
 	    if (repltd) {
 		let txt = repltd.innerText,
 		    authtd = repltd.parentNode.getElementsByTagName("td")[0],
-		    authAs = authtd.getElementsByTagName("a"),
-		    author = authAs[authAs.length-1].innerText,
+		    author = authtd.querySelector("a.author").innerText,
 		    digest = txt.split("\n").splice(0, hoverTextLines).join("\n");
 		return "[[ "+author+" ]]\n"+digest;
 	    } else

yatex.org