Make messages clickable and add them to notes in inquiry

Only apply to the `mod/:username/communication/private` pages. Does not interfere with the public-chat page.
pull/9536/head
kraktus 2021-08-05 16:13:18 +02:00
parent bd4b740367
commit c040432554
3 changed files with 12 additions and 2 deletions

View File

@ -145,7 +145,7 @@ object communication {
)(
userIdLink(line.userIdMaybe, withOnline = false, withTitle = false),
nbsp,
highlightBad(line.text)
span(cls := "message")(highlightBad(line.text))
)
}
)
@ -164,7 +164,7 @@ object communication {
tr(cls := List("post" -> true, "author" -> author))(
td(momentFromNowOnce(msg.date)),
td(strong(if (author) u.username else convo.contact.name)),
td(highlightBad(msg.text))
td(cls := "message")(highlightBad(msg.text))
)
}
)

View File

@ -37,4 +37,10 @@ $(function () {
.replaceAll(/(?:https:\/\/)?lichess\.org\/([\w\/]+)/g, '<a href="/$1">lichess.org/$1</a>')
);
});
$('#communication').on('click', '.line.author, .post.author', function () {
const message = $(this).find('.message').text();
const storedNote = noteStore.get();
noteStore.set((storedNote ? storedNote + ', ' : '') + `"${message}"`);
});
});

View File

@ -96,6 +96,10 @@
.player_chats .line.author,
.threads .post.author {
opacity: 1;
cursor: pointer;
&:hover {
background: fade-out($c-accent, 0.8);
}
}
.thread {