From 8fbd8070f2585dd70e4460fe6e5f40c78fdccfb8 Mon Sep 17 00:00:00 2001 From: Cutls Date: Tue, 17 Sep 2019 00:22:55 +0900 Subject: [PATCH] For Pleroma tags --- app/js/tl/card.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/js/tl/card.js b/app/js/tl/card.js index b649c0f9..ebd14da9 100644 --- a/app/js/tl/card.js +++ b/app/js/tl/card.js @@ -6,17 +6,21 @@ function additional(acct_id, tlid) { $("#timeline-container .mention").addClass("parsed"); - $("#timeline-container .hashtag").each(function (i, elem) { + $("#timeline-container .hashtag, #timeline-container [rel=tag]").each(function (i, elem) { var tags = $(this).attr("href").match( /https?:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/ ); - $(this).attr("href", "#"); - if (tags) { - if (tags[2]) { - $(this).attr("onclick", 'tagShow(\'' + tags[2] + '\')'); - } - + if(tags){ + var tagThis = tags[2] + }else{ + var tagThis = $(this).attr("data-tag") } + + if(tagThis){ + $(this).attr("onclick", 'tagShow(\'' + tagThis + '\')'); + $(this).attr("href", "#"); + } + }); //トゥートサムネ